Commit 4b204f07 authored by Felipe Artur's avatar Felipe Artur

Small frontend code fixes and restore 8a2d88f commit

parent e5aa9028
...@@ -12,16 +12,20 @@ ...@@ -12,16 +12,20 @@
= form_for notification_setting, html: { class: "custom-notifications-form" } do |f| = form_for notification_setting, html: { class: "custom-notifications-form" } do |f|
= hidden_setting_source_input(notification_setting) = hidden_setting_source_input(notification_setting)
.row .row
.col-lg-3 .col-lg-4
%h4.prepend-top-0 %h4.prepend-top-0
Notification events Notification events
.col-lg-9 %p
Custom notification levels are the same as participating levels. With custom notification levels you will also receive notifications for select events. To find out more, check out
= succeed "." do
%a{ href: "http://docs.gitlab.com/ce/workflow/notifications.html", target: "_blank"} notification emails
.col-lg-8
- NotificationSetting::EMAIL_EVENTS.each_with_index do |event, index| - NotificationSetting::EMAIL_EVENTS.each_with_index do |event, index|
- field_id = "#{notifications_menu_identifier("modal", notification_setting)}_notification_setting[#{event}]"
.form-group .form-group
.checkbox{ class: ("prepend-top-0" if index == 0) } .checkbox{ class: ("prepend-top-0" if index == 0) }
%label{ for: "notification_setting[#{event}]" } %label{ for: field_id }
= check_box("", event, { name: "notification_setting[#{event}]", id: "notification_setting[#{event}]", class: "js-custom-notification-event", checked: notification_setting.events[event] }) = check_box("notification_setting", event, id: field_id, class: "js-custom-notification-event", checked: notification_setting.events[event])
%strong %strong
= event.to_s.humanize = event.to_s.humanize
= icon("spinner spin", class: "custom-notification-event-loading") = icon("spinner spin", class: "custom-notification-event-loading")
- left_align = local_assigns[:left_align] - left_align = local_assigns[:left_align]
%ul.dropdown-menu.dropdown-menu-no-wrap.dropdown-menu-selectable.dropdown-menu-large{ role: "menu", class: [notifications_menu_identifier("dropdown", notification_setting), ("dropdown-menu-align-right" if left_align.nil?)] } %ul.dropdown-menu.dropdown-menu-no-wrap.dropdown-menu-selectable.dropdown-menu-large{ role: "menu", class: [notifications_menu_identifier("dropdown", notification_setting), ("dropdown-menu-align-right" unless left_align)] }
- NotificationSetting.levels.each_key do |level| - NotificationSetting.levels.each_key do |level|
- next if level == "custom" - next if level == "custom"
- next if level == "global" && notification_setting.source.nil? - next if level == "global" && notification_setting.source.nil?
...@@ -8,6 +8,6 @@ ...@@ -8,6 +8,6 @@
%li.divider %li.divider
%li %li
%a.update-notification{ href: "#", role: "button", class: ("is-active" if notification_setting.level == "custom"), data: { toggle: "modal", target: "#" + notifications_menu_identifier("modal", notification_setting), notification_level: "custom", notification_title: "Custom" } } %a.update-notification{ href: "#", role: "button", class: ("is-active" if notification_setting.custom?), data: { toggle: "modal", target: "#" + notifications_menu_identifier("modal", notification_setting), notification_level: "custom", notification_title: "Custom" } }
%strong.dropdown-menu-inner-title Custom %strong.dropdown-menu-inner-title Custom
%span.dropdown-menu-inner-content= notification_description("custom") %span.dropdown-menu-inner-content= notification_description("custom")
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment