5218da5759
Use special classes when is_compare, similar to is_commit. Default expectation is diff is being viewed in MR
32 lines
1.7 KiB
Text
32 lines
1.7 KiB
Text
- environment = local_assigns.fetch(:environment, nil)
|
|
- diff_page_context = local_assigns.fetch(:diff_page_context, nil)
|
|
- file_hash = hexdigest(diff_file.file_path)
|
|
- 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
|
|
|
|
.diff-file.file-holder{ id: file_hash, data: diff_file_html_data(project, diff_file.file_path, diff_file.content_sha) }
|
|
.js-file-title.file-title-flex-parent{ class: diff_page_context }
|
|
.file-header-content
|
|
= render "projects/diffs/file_header", diff_file: diff_file, url: "##{file_hash}"
|
|
|
|
- unless diff_file.submodule?
|
|
- blob = diff_file.blob
|
|
.file-actions.d-none.d-sm-block
|
|
- if blob&.readable_text?
|
|
= link_to '#', class: 'js-toggle-diff-comments btn active has-tooltip', title: _("Toggle comments for this file"), disabled: @diff_notes_disabled do
|
|
= icon('comment')
|
|
\
|
|
- if editable_diff?(diff_file)
|
|
- link_opts = @merge_request.persisted? ? { from_merge_request_iid: @merge_request.iid } : {}
|
|
= edit_blob_button(@merge_request.source_project, @merge_request.source_branch, diff_file.new_path,
|
|
blob: blob, link_opts: link_opts)
|
|
|
|
- if image_diff && image_replaced
|
|
= view_file_button(diff_file.old_content_sha, diff_file.old_path, project, replaced: true)
|
|
|
|
= 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
|
|
|
|
= render 'projects/fork_suggestion'
|
|
|
|
= render 'projects/diffs/content', diff_file: diff_file
|