diff options
author | Luke Bennett <lukeeeebennettplus@gmail.com> | 2018-05-29 10:35:26 +0100 |
---|---|---|
committer | Luke Bennett <lukeeeebennettplus@gmail.com> | 2018-05-29 10:35:26 +0100 |
commit | 4a1d19a61d1c3d8908487dfc4a30b6962206a21b (patch) | |
tree | f61ad40847b0ab54139aae3f7e36691beb1aa497 /app/helpers/labels_helper.rb | |
parent | 5e5828a41a95e06e7aa66368efbd296846aa1e8b (diff) | |
download | gitlab-ce-4a1d19a61d1c3d8908487dfc4a30b6962206a21b.tar.gz |
Tidy tooltip_title and fix dropdown open left
Diffstat (limited to 'app/helpers/labels_helper.rb')
-rw-r--r-- | app/helpers/labels_helper.rb | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/app/helpers/labels_helper.rb b/app/helpers/labels_helper.rb index 7fddf74c654..c7df25cecef 100644 --- a/app/helpers/labels_helper.rb +++ b/app/helpers/labels_helper.rb @@ -211,14 +211,12 @@ module LabelsHelper end end - def label_status_tooltip(status) - return '' unless status + def label_status_tooltip(label, status) + type = label.is_a?(ProjectLabel) ? 'project' : 'group' + level = status.unsubscribed? ? type : status.sub('-level', '') + action = status.unsubscribed? ? 'Subscribe' : 'Unsubscribe' - if status.unsubscribed? - "Subscribe at #{label.is_a?(ProjectLabel) ? 'project' : 'group'} level" - else - "Unsubscribe at #{status.sub('-', ' ')}" - end + "#{action} at #{level} level" end # Required for Banzai::Filter::LabelReferenceFilter |