diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-23 18:09:28 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-23 18:09:28 +0300 |
commit | c46b011d3f578d2455443dfabf24226c738c8903 (patch) | |
tree | 89107fa4ccf5340dc14a7d0d2f74a0372e56985f /app/helpers | |
parent | b38fc20ae0e90d5b1c538a139aa0a7da1b7b5726 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/application_helper.rb | 1 | ||||
-rw-r--r-- | app/helpers/commits_helper.rb | 22 |
2 files changed, 13 insertions, 10 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 9af45daaca4..1115bee0843 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -281,6 +281,7 @@ module ApplicationHelper def page_class class_names = [] class_names << 'issue-boards-page gl-overflow-auto' if current_controller?(:boards) + class_names << 'epic-boards-page' if current_controller?(:epic_boards) class_names << 'environment-logs-page' if current_controller?(:logs) class_names << 'with-performance-bar' if performance_bar_enabled? class_names << system_message_class diff --git a/app/helpers/commits_helper.rb b/app/helpers/commits_helper.rb index 42e4844cc8d..652ba9950bc 100644 --- a/app/helpers/commits_helper.rb +++ b/app/helpers/commits_helper.rb @@ -110,16 +110,18 @@ module CommitsHelper end end - def revert_commit_link - return unless current_user - - tag(:div, data: { display_text: 'Revert' }, class: "js-revert-commit-trigger") - end - - def cherry_pick_commit_link - return unless current_user - - tag(:div, data: { display_text: 'Cherry-pick' }, class: "js-cherry-pick-commit-trigger") + def commit_options_dropdown_data(project, commit) + can_collaborate = current_user && can_collaborate_with_project?(project) + + { + new_project_tag_path: new_project_tag_path(project, ref: commit), + email_patches_path: project_commit_path(project, commit, format: :patch), + plain_diff_path: project_commit_path(project, commit, format: :diff), + can_revert: "#{can_collaborate && !commit.has_been_reverted?(current_user)}", + can_cherry_pick: can_collaborate.to_s, + can_tag: can?(current_user, :push_code, project).to_s, + can_email_patches: (commit.parents.length < 2).to_s + } end def commit_signature_badge_classes(additional_classes) |