diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2017-06-23 15:30:13 -0300 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2017-06-26 17:55:52 -0300 |
commit | 46e4c966168f212eb647aa0d2622a025bcd2bd75 (patch) | |
tree | 899ae4d69a0ad5b8da1115cd33c5050dbe4406a7 /app/helpers/labels_helper.rb | |
parent | fe37ca87599865081a8e94fd778b89134fc0c088 (diff) | |
download | gitlab-ce-46e4c966168f212eb647aa0d2622a025bcd2bd75.tar.gz |
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.rb | 4 |
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) |