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:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2017-06-23 21:30:13 +0300
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2017-06-26 23:55:52 +0300
commit46e4c966168f212eb647aa0d2622a025bcd2bd75 (patch)
tree899ae4d69a0ad5b8da1115cd33c5050dbe4406a7 /app/helpers/labels_helper.rb
parentfe37ca87599865081a8e94fd778b89134fc0c088 (diff)
Add can_subscribe_to_label_in_different_levels helper method
Diffstat (limited to 'app/helpers/labels_helper.rb')
-rw-r--r--app/helpers/labels_helper.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/helpers/labels_helper.rb b/app/helpers/labels_helper.rb
index 6c99d993a5f..8a2987dca42 100644
--- a/app/helpers/labels_helper.rb
+++ b/app/helpers/labels_helper.rb
@@ -133,6 +133,10 @@ module LabelsHelper
end
end
+ def can_subscribe_to_label_in_different_levels?(label)
+ defined?(@project) || label.is_a?(GroupLabel)
+ end
+
def label_subscription_status(label, project)
return 'group-level' if label.subscribed?(current_user)
return 'project-level' if label.subscribed?(current_user, project)