diff options
author | Clement Ho <ClemMakesApps@gmail.com> | 2017-09-20 09:39:12 -0500 |
---|---|---|
committer | Clement Ho <ClemMakesApps@gmail.com> | 2017-09-20 09:39:12 -0500 |
commit | 9c096ddf28d63a89ff2844514bde9ab93a8756ae (patch) | |
tree | 749069b8452f79a5404c71bebcb8ea0942fd7c34 /app/views/projects/diffs/_file.html.haml | |
parent | 727f51b8ef0af2b78087b4ac894ee728bfbabd1f (diff) | |
download | gitlab-ce-9c096ddf28d63a89ff2844514bde9ab93a8756ae.tar.gz |
Add view replaced file link for image diffsadd-view-replaced-file-link
Diffstat (limited to 'app/views/projects/diffs/_file.html.haml')
-rw-r--r-- | app/views/projects/diffs/_file.html.haml | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/views/projects/diffs/_file.html.haml b/app/views/projects/diffs/_file.html.haml index b5aea217384..adc4dcbed33 100644 --- a/app/views/projects/diffs/_file.html.haml +++ b/app/views/projects/diffs/_file.html.haml @@ -1,5 +1,8 @@ - environment = local_assigns.fetch(:environment, 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 .file-header-content @@ -17,6 +20,9 @@ = edit_blob_link(@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 |