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:
authorPhil Hughes <me@iamphill.com>2016-05-27 17:56:43 +0300
committerPhil Hughes <me@iamphill.com>2016-06-07 17:02:00 +0300
commite141a1c6f14df7b83cbb24190f9786b6fc36cd49 (patch)
tree1f042c33fb651c89c945ba2ad647fb572e3c4442 /app/helpers/notifications_helper.rb
parent3fd0b364ea54832a861482d609bd25d485d5ac9c (diff)
Notifications dropdown on project page now has descriptions
This is part of #12758
Diffstat (limited to 'app/helpers/notifications_helper.rb')
-rw-r--r--app/helpers/notifications_helper.rb22
1 files changed, 19 insertions, 3 deletions
diff --git a/app/helpers/notifications_helper.rb b/app/helpers/notifications_helper.rb
index 54ab9179efc..b8e64b3890a 100644
--- a/app/helpers/notifications_helper.rb
+++ b/app/helpers/notifications_helper.rb
@@ -31,6 +31,21 @@ module NotificationsHelper
end
end
+ def notification_description(level)
+ case level.to_sym
+ when :participating
+ 'You will only receive notifications from related resources'
+ when :mention
+ 'You will receive notifications only for comments in which you were @mentioned'
+ when :watch
+ 'You will receive notifications for any activity'
+ when :disabled
+ 'You will not get any notifications via email'
+ when :global
+ 'Use your global notification setting'
+ end
+ end
+
def notification_list_item(level, setting)
title = notification_title(level)
@@ -39,9 +54,10 @@ module NotificationsHelper
notification_title: title
}
- content_tag(:li, class: ('active' if setting.level == level)) do
- link_to '#', class: 'update-notification', data: data do
- notification_icon(level, title)
+ content_tag(:li, role: "menuitem") do
+ link_to '#', class: "update-notification #{('is-active' if setting.level == level)}", data: data do
+ link_output = content_tag(:strong, title, class: 'dropdown-menu-inner-title')
+ link_output << content_tag(:span, notification_description(level), class: 'dropdown-menu-inner-content')
end
end
end