diff options
author | Rémy Coutable <remy@rymai.me> | 2017-09-22 09:28:53 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-09-22 09:28:53 +0300 |
commit | d103e95513704314a38ab8ae441851524031c4a1 (patch) | |
tree | 0a3d6c7d7b824226351571232fac96ce3ef52ae3 /app/helpers | |
parent | f357fc7d2c1f3898b1ce0df7f97665aa8230d05e (diff) | |
parent | 9c096ddf28d63a89ff2844514bde9ab93a8756ae (diff) |
Merge branch 'add-view-replaced-file-link' into 'master'
Add view replaced file link for image diffs
See merge request gitlab-org/gitlab-ce!14394
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/commits_helper.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/helpers/commits_helper.rb b/app/helpers/commits_helper.rb index 08fb9db6c0f..ef22cafc2e2 100644 --- a/app/helpers/commits_helper.rb +++ b/app/helpers/commits_helper.rb @@ -176,13 +176,15 @@ module CommitsHelper end end - def view_file_button(commit_sha, diff_new_path, project) + def view_file_button(commit_sha, diff_new_path, project, replaced: false) + title = replaced ? _('View replaced file @ ') : _('View file @ ') + link_to( project_blob_path(project, tree_join(commit_sha, diff_new_path)), class: 'btn view-file js-view-file' ) do - raw('View file @ ') + content_tag(:span, Commit.truncate_sha(commit_sha), + raw(title) + content_tag(:span, Commit.truncate_sha(commit_sha), class: 'commit-sha') end end |