diff options
Diffstat (limited to 'app/helpers/issues_helper.rb')
-rw-r--r-- | app/helpers/issues_helper.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index 957ab06b0ca..dfadcfc33b2 100644 --- a/app/helpers/issues_helper.rb +++ b/app/helpers/issues_helper.rb @@ -5,6 +5,7 @@ module IssuesHelper classes = ["issue"] classes << "closed" if issue.closed? classes << "today" if issue.today? + classes << "user-can-drag" if @sort == 'relative_position' classes.join(' ') end @@ -135,6 +136,20 @@ module IssuesHelper can?(current_user, :create_issue, project) end + def create_confidential_merge_request_enabled? + Feature.enabled?(:create_confidential_merge_request, @project) + end + + def show_new_branch_button? + can_create_confidential_merge_request? || !@issue.confidential? + end + + def can_create_confidential_merge_request? + @issue.confidential? && !@project.private? && + create_confidential_merge_request_enabled? && + can?(current_user, :create_merge_request_in, @project) + end + # Required for Banzai::Filter::IssueReferenceFilter module_function :url_for_issue module_function :url_for_internal_issue |