diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-01-08 18:10:43 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-01-08 18:10:43 +0000 |
commit | 9bcb655610575956a858ae6fdb1d00deef5f6ad8 (patch) | |
tree | 8c2e013c86cf94d2596655bceab865feef53bd38 /app/helpers/commits_helper.rb | |
parent | 6e734c809b18a0470d81c78e1ecd9b3f8278de89 (diff) | |
download | gitlab-ce-9bcb655610575956a858ae6fdb1d00deef5f6ad8.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/helpers/commits_helper.rb')
-rw-r--r-- | app/helpers/commits_helper.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/app/helpers/commits_helper.rb b/app/helpers/commits_helper.rb index 02d48386e31..e6e2b5b128b 100644 --- a/app/helpers/commits_helper.rb +++ b/app/helpers/commits_helper.rb @@ -110,8 +110,16 @@ module CommitsHelper end end - def revert_commit_link(commit, continue_to_path, btn_class: nil, has_tooltip: true) - commit_action_link('revert', commit, continue_to_path, btn_class: btn_class, has_tooltip: has_tooltip) + def revert_commit_link(commit, continue_to_path, btn_class: nil, pajamas: false) + return unless current_user + + action = 'revert' + + if pajamas && can_collaborate_with_project?(@project) + tag(:div, data: { display_text: action.capitalize }, class: "js-revert-commit-trigger") + else + commit_action_link(action, commit, continue_to_path, btn_class: btn_class, has_tooltip: false) + end end def cherry_pick_commit_link(commit, continue_to_path, btn_class: nil, has_tooltip: true) |