_custom_notifications.html.haml 2.21 KB
Newer Older
1 2
- hide_label = local_assigns.fetch(:hide_label, false)

3
.modal.fade{ tabindex: "-1", role: "dialog", id: notifications_menu_identifier("modal", notification_setting), "aria-labelledby": "custom-notifications-title" }
4 5 6 7
  .modal-dialog
    .modal-content
      .modal-header
        %h4#custom-notifications-title.modal-title
8
          #{ _('Custom notification events') }
9 10
        %button.close{ type: "button", "data-dismiss": "modal", "aria-label" => _('Close') }
          %span{ "aria-hidden": true } ×
11

12 13
      .modal-body
        .container-fluid
14 15
          = form_for notification_setting, html: { class: "custom-notifications-form" } do |f|
            = hidden_setting_source_input(notification_setting)
16
            = hidden_field_tag("hide_label", true) if hide_label
17
            .row
18
              .col-lg-4
19
                %h4.gl-mt-0= _('Notification events')
20
                %p
21
                  - notification_link = link_to _('notification emails'), help_page_path('user/profile/notifications'), target: '_blank'
22 23
                  - paragraph = _('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 %{notification_link}.') % { notification_link: notification_link.html_safe }
                  #{ paragraph.html_safe }
24
              .col-lg-8
25
                - notification_setting.email_events.each_with_index do |event, index|
26
                  - field_id = "#{notifications_menu_identifier("modal", notification_setting)}_notification_setting[#{event}]"
27
                  .form-group
28
                    .form-check{ class: ("gl-mt-0" if index == 0) }
29 30
                      = check_box("notification_setting", event, id: field_id, class: "js-custom-notification-event form-check-input", checked: notification_setting.public_send(event))
                      %label.form-check-label{ for: field_id }
31
                        %strong
32
                          = notification_event_name(event)
33 34
                          %span.spinner.is-loading.gl-vertical-align-middle.gl-display-none
                          = sprite_icon('check', css_class: 'is-done gl-display-none gl-vertical-align-middle gl-text-green-600')