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/views/profiles | |
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/views/profiles')
-rw-r--r-- | app/views/profiles/notifications/_group_settings.html.haml | 9 | ||||
-rw-r--r-- | app/views/profiles/notifications/_project_settings.html.haml | 9 |
2 files changed, 8 insertions, 10 deletions
diff --git a/app/views/profiles/notifications/_group_settings.html.haml b/app/views/profiles/notifications/_group_settings.html.haml index cf17ee44145..1776d260e19 100644 --- a/app/views/profiles/notifications/_group_settings.html.haml +++ b/app/views/profiles/notifications/_group_settings.html.haml @@ -1,16 +1,15 @@ +- emails_disabled = group.emails_disabled? + .gl-responsive-table-row.notification-list-item .table-section.section-40 %span.notification.fa.fa-holder.append-right-5 - - if setting.global? - = notification_icon(current_user.global_notification_setting.level) - - else - = notification_icon(setting.level) + = notification_icon(notification_icon_level(setting, emails_disabled)) %span.str-truncated = link_to group.name, group_path(group) .table-section.section-30.text-right - = render 'shared/notifications/button', notification_setting: setting + = render 'shared/notifications/button', notification_setting: setting, emails_disabled: emails_disabled .table-section.section-30 = form_for @user.notification_settings.find { |ns| ns.source == group }, url: profile_notifications_group_path(group), method: :put, html: { class: 'update-notifications' } do |f| diff --git a/app/views/profiles/notifications/_project_settings.html.haml b/app/views/profiles/notifications/_project_settings.html.haml index 823fec3fab4..63a77b335b6 100644 --- a/app/views/profiles/notifications/_project_settings.html.haml +++ b/app/views/profiles/notifications/_project_settings.html.haml @@ -1,12 +1,11 @@ +- emails_disabled = project.emails_disabled? + %li.notification-list-item %span.notification.fa.fa-holder.append-right-5 - - if setting.global? - = notification_icon(current_user.global_notification_setting.level) - - else - = notification_icon(setting.level) + = notification_icon(notification_icon_level(setting, emails_disabled)) %span.str-truncated = link_to_project(project) .float-right - = render 'shared/notifications/button', notification_setting: setting + = render 'shared/notifications/button', notification_setting: setting, emails_disabled: emails_disabled |