2017-01-29 14:38:00 -05:00
|
|
|
- environment = local_assigns.fetch(:environment, nil)
|
2019-01-29 23:26:53 -05:00
|
|
|
- diff_page_context = local_assigns.fetch(:diff_page_context, nil)
|
2017-05-15 13:18:19 -04:00
|
|
|
- file_hash = hexdigest(diff_file.file_path)
|
2017-09-20 10:39:12 -04: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 14:19:49 -04:00
|
|
|
.diff-file.file-holder{ id: file_hash, data: diff_file_html_data(project, diff_file.file_path, diff_file.content_sha) }
|
2019-01-29 23:26:53 -05:00
|
|
|
.js-file-title.file-title-flex-parent{ class: diff_page_context }
|
2017-02-08 18:06:04 -05:00
|
|
|
.file-header-content
|
2017-05-15 14:19:49 -04:00
|
|
|
= render "projects/diffs/file_header", diff_file: diff_file, url: "##{file_hash}"
|
2014-09-08 09:26:49 -04:00
|
|
|
|
2020-09-07 08:08:27 -04:00
|
|
|
- if diff_file.submodule?
|
|
|
|
.file-actions.d-none.d-sm-block
|
|
|
|
= submodule_diff_compare_link(diff_file)
|
|
|
|
|
2016-06-20 12:57:10 -04:00
|
|
|
- unless diff_file.submodule?
|
2021-04-05 14:09:15 -04:00
|
|
|
.file-actions.gl-display-none.gl-sm-display-flex
|
2020-11-12 13:09:26 -05:00
|
|
|
- if diff_file.blob&.readable_text?
|
2021-04-05 14:09:15 -04:00
|
|
|
%span.has-tooltip.gl-mr-3{ title: _("Toggle comments for this file") }
|
|
|
|
= link_to '#', class: 'js-toggle-diff-comments btn gl-button btn-default btn-icon selected', disabled: @diff_notes_disabled do
|
2021-02-25 10:11:34 -05:00
|
|
|
= sprite_icon('comment')
|
2016-01-21 16:46:49 -05:00
|
|
|
\
|
2016-07-30 00:04:04 -04:00
|
|
|
- if editable_diff?(diff_file)
|
2016-11-07 12:09:22 -05:00
|
|
|
- link_opts = @merge_request.persisted? ? { from_merge_request_iid: @merge_request.iid } : {}
|
2018-02-22 07:54:19 -05:00
|
|
|
= edit_blob_button(@merge_request.source_project, @merge_request.source_branch, diff_file.new_path,
|
2020-11-12 13:09:26 -05:00
|
|
|
blob: diff_file.blob, link_opts: link_opts)
|
2014-09-08 09:26:49 -04:00
|
|
|
|
2017-09-20 10:39:12 -04:00
|
|
|
- if image_diff && image_replaced
|
|
|
|
= view_file_button(diff_file.old_content_sha, diff_file.old_path, project, replaced: true)
|
|
|
|
|
2017-05-15 14:19:49 -04: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 09:26:49 -04:00
|
|
|
|
2021-02-16 10:09:50 -05:00
|
|
|
= render_fork_suggestion
|
2017-04-22 01:54:03 -04:00
|
|
|
|
2017-05-15 14:19:49 -04:00
|
|
|
= render 'projects/diffs/content', diff_file: diff_file
|