2017-08-17 22:00:37 +05:30
|
|
|
- environment = local_assigns.fetch(:environment, nil)
|
2019-03-02 22:35:43 +05:30
|
|
|
- diff_page_context = local_assigns.fetch(:diff_page_context, nil)
|
2017-09-10 17:25:29 +05:30
|
|
|
- file_hash = hexdigest(diff_file.file_path)
|
2018-03-17 18:26:18 +05:30
|
|
|
- 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-09-10 17:25:29 +05:30
|
|
|
.diff-file.file-holder{ id: file_hash, data: diff_file_html_data(project, diff_file.file_path, diff_file.content_sha) }
|
2019-03-02 22:35:43 +05:30
|
|
|
.js-file-title.file-title-flex-parent{ class: diff_page_context }
|
2017-08-17 22:00:37 +05:30
|
|
|
.file-header-content
|
2017-09-10 17:25:29 +05:30
|
|
|
= render "projects/diffs/file_header", diff_file: diff_file, url: "##{file_hash}"
|
2015-04-26 12:48:37 +05:30
|
|
|
|
2020-11-24 15:15:51 +05:30
|
|
|
- if diff_file.submodule?
|
|
|
|
.file-actions.d-none.d-sm-block
|
|
|
|
= submodule_diff_compare_link(diff_file)
|
|
|
|
|
2016-08-24 12:49:21 +05:30
|
|
|
- unless diff_file.submodule?
|
2021-04-29 21:17:54 +05:30
|
|
|
.file-actions.gl-display-none.gl-sm-display-flex
|
2021-01-29 00:20:46 +05:30
|
|
|
- if diff_file.blob&.readable_text?
|
2021-04-29 21:17:54 +05:30
|
|
|
%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-04-17 20:07:23 +05:30
|
|
|
= sprite_icon('comment')
|
2016-01-29 22:53:50 +05:30
|
|
|
\
|
2016-09-13 17:45:13 +05:30
|
|
|
- if editable_diff?(diff_file)
|
2017-01-15 13:20:01 +05:30
|
|
|
- link_opts = @merge_request.persisted? ? { from_merge_request_iid: @merge_request.iid } : {}
|
2018-03-27 19:54:05 +05:30
|
|
|
= edit_blob_button(@merge_request.source_project, @merge_request.source_branch, diff_file.new_path,
|
2021-01-29 00:20:46 +05:30
|
|
|
blob: diff_file.blob, link_opts: link_opts)
|
2015-04-26 12:48:37 +05:30
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
- if image_diff && image_replaced
|
|
|
|
= view_file_button(diff_file.old_content_sha, diff_file.old_path, project, replaced: true)
|
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
= 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
|
2017-08-17 22:00:37 +05:30
|
|
|
|
2021-03-11 19:13:27 +05:30
|
|
|
= render_fork_suggestion
|
2015-04-26 12:48:37 +05:30
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
= render 'projects/diffs/content', diff_file: diff_file
|