2017-01-29 19:38:00 +00:00
|
|
|
- environment = local_assigns.fetch(:environment, nil)
|
2017-05-15 17:18:19 +00:00
|
|
|
- file_hash = hexdigest(diff_file.file_path)
|
2017-09-20 14:39:12 +00:00
|
|
|
- image_diff = diff_file.rich_viewer && diff_file.rich_viewer.partial_name == 'image'
|
|
|
|
- image_replaced = diff_file.old_content_sha && diff_file.old_content_sha != diff_file.content_sha
|
|
|
|
|
2017-05-15 18:19:49 +00:00
|
|
|
.diff-file.file-holder{ id: file_hash, data: diff_file_html_data(project, diff_file.file_path, diff_file.content_sha) }
|
2017-02-05 22:28:48 +00:00
|
|
|
.js-file-title.file-title-flex-parent
|
2017-02-08 23:06:04 +00:00
|
|
|
.file-header-content
|
2017-05-15 18:19:49 +00:00
|
|
|
= render "projects/diffs/file_header", diff_file: diff_file, url: "##{file_hash}"
|
2014-09-08 13:26:49 +00:00
|
|
|
|
2016-06-20 16:57:10 +00:00
|
|
|
- unless diff_file.submodule?
|
2017-05-15 18:19:49 +00:00
|
|
|
- blob = diff_file.blob
|
2018-04-09 21:50:40 +00:00
|
|
|
.file-actions.d-none.d-sm-block
|
2018-01-04 18:54:34 +00:00
|
|
|
- if blob&.readable_text?
|
2017-01-30 10:58:30 +00:00
|
|
|
= link_to '#', class: 'js-toggle-diff-comments btn active has-tooltip', title: "Toggle comments for this file", disabled: @diff_notes_disabled do
|
2016-03-31 18:37:27 +00:00
|
|
|
= icon('comment')
|
2016-01-21 21:46:49 +00:00
|
|
|
\
|
2016-07-30 04:04:04 +00:00
|
|
|
- if editable_diff?(diff_file)
|
2016-11-07 17:09:22 +00:00
|
|
|
- link_opts = @merge_request.persisted? ? { from_merge_request_iid: @merge_request.iid } : {}
|
2018-02-22 12:54:19 +00:00
|
|
|
= edit_blob_button(@merge_request.source_project, @merge_request.source_branch, diff_file.new_path,
|
2016-08-17 15:05:00 +00:00
|
|
|
blob: blob, link_opts: link_opts)
|
2014-09-08 13:26:49 +00:00
|
|
|
|
2017-09-20 14:39:12 +00:00
|
|
|
- if image_diff && image_replaced
|
|
|
|
= view_file_button(diff_file.old_content_sha, diff_file.old_path, project, replaced: true)
|
|
|
|
|
2017-05-15 18:19:49 +00:00
|
|
|
= view_file_button(diff_file.content_sha, diff_file.file_path, project)
|
|
|
|
= view_on_environment_button(diff_file.content_sha, diff_file.file_path, environment) if environment
|
2014-09-08 13:26:49 +00:00
|
|
|
|
2017-04-22 05:54:03 +00:00
|
|
|
= render 'projects/fork_suggestion'
|
|
|
|
|
2017-05-15 18:19:49 +00:00
|
|
|
= render 'projects/diffs/content', diff_file: diff_file
|