summaryrefslogtreecommitdiff
path: root/app/helpers
diff options
context:
space:
mode:
authorJacob Schatz <jschatz@gitlab.com>2016-06-07 18:06:37 +0000
committerJacob Schatz <jschatz@gitlab.com>2016-06-07 18:06:37 +0000
commitbabf20c8ab2c2186590758b193de953c5efdefb4 (patch)
tree7cd94f55bb8f189f0ab2c5047e0d8715c0cfa15b /app/helpers
parent40b17bdebd429c3d9693644404be8f56ff3ac441 (diff)
parentf62df363b5daa83b5ba81d75c63816976648446d (diff)
downloadgitlab-ce-babf20c8ab2c2186590758b193de953c5efdefb4.tar.gz
Merge branch 'notification-dropdown-labels' into 'master'
Notifications dropdown on project page now has descriptions ## What does this MR do? Adds descriptions to the notification settings dropdown on project pages. Also changed the order of them to make more sense. ## What are the relevant issue numbers? Part of #12758 ## Screenshots (if relevant) ![Screen_Shot_2016-05-31_at_09.35.24](/uploads/b30d82701a13ec15f672139e1225acf5/Screen_Shot_2016-05-31_at_09.35.24.png) See merge request !4374
Diffstat (limited to 'app/helpers')
-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