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:
authorLuke Bennett <lukeeeebennettplus@gmail.com>2018-05-29 12:35:26 +0300
committerLuke Bennett <lukeeeebennettplus@gmail.com>2018-05-29 12:35:26 +0300
commit4a1d19a61d1c3d8908487dfc4a30b6962206a21b (patch)
treef61ad40847b0ab54139aae3f7e36691beb1aa497 /app/helpers/labels_helper.rb
parent5e5828a41a95e06e7aa66368efbd296846aa1e8b (diff)
Tidy tooltip_title and fix dropdown open left
Diffstat (limited to 'app/helpers/labels_helper.rb')
-rw-r--r--app/helpers/labels_helper.rb12
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