Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2017-09-22 09:28:53 +0300
committerRémy Coutable <remy@rymai.me>2017-09-22 09:28:53 +0300
commitd103e95513704314a38ab8ae441851524031c4a1 (patch)
tree0a3d6c7d7b824226351571232fac96ce3ef52ae3 /app/helpers
parentf357fc7d2c1f3898b1ce0df7f97665aa8230d05e (diff)
parent9c096ddf28d63a89ff2844514bde9ab93a8756ae (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.rb6
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