diff options
author | Brett Walker <bwalker@gitlab.com> | 2019-08-17 08:56:48 +0300 |
---|---|---|
committer | Paul Slaughter <pslaughter@gitlab.com> | 2019-08-17 08:56:48 +0300 |
commit | 9be16e1f495655e68bc980fced9a8075223ccccf (patch) | |
tree | c3ac8db7b555e7b4aef5d1d9f12eb08ad17dd5dd /app/helpers/notifications_helper.rb | |
parent | 9eabc0d6fc268023db13e8dad315f99f4fe1a6da (diff) |
UI for disabling group/project email notification
- Adds UI to configure in group and project settings
- Removes notification configuration for users when
disabled at group or project level
Diffstat (limited to 'app/helpers/notifications_helper.rb')
-rw-r--r-- | app/helpers/notifications_helper.rb | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/app/helpers/notifications_helper.rb b/app/helpers/notifications_helper.rb index 11b9cf22142..5678304ffcf 100644 --- a/app/helpers/notifications_helper.rb +++ b/app/helpers/notifications_helper.rb @@ -5,7 +5,7 @@ module NotificationsHelper def notification_icon_class(level) case level.to_sym - when :disabled + when :disabled, :owner_disabled 'microphone-slash' when :participating 'volume-up' @@ -18,6 +18,16 @@ module NotificationsHelper end end + def notification_icon_level(notification_setting, emails_disabled = false) + if emails_disabled + 'owner_disabled' + elsif notification_setting.global? + current_user.global_notification_setting.level + else + notification_setting.level + end + end + def notification_icon(level, text = nil) icon("#{notification_icon_class(level)} fw", text: text) end @@ -53,6 +63,8 @@ module NotificationsHelper _('Use your global notification setting') when :custom _('You will only receive notifications for the events you choose') + when :owner_disabled + _('Notifications have been disabled by the project or group owner') end end |