summaryrefslogtreecommitdiff
path: root/app/views/shared/notifications/_button.html.haml
blob: ff1cf966a9b4caf200f9d09ebcc7db975a8fd8d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
- left_align = local_assigns[:left_align]
- if notification_setting
  .dropdown.notification-dropdown.pull-right
    = form_for notification_setting, remote: true, html: { class: "inline notification-form" } do |f|
      = hidden_setting_source_input(notification_setting)
      = f.hidden_field :level, class: "notification_setting_level"
      .js-notification-toggle-btns
        %div{ class: ("btn-group" if notification_setting.custom?) }
          - if notification_setting.custom?
            %button.dropdown-new.btn.btn-default.notifications-btn#notifications-button{ type: "button", data: { toggle: "modal", target: "#" + notifications_menu_identifier("modal", notification_setting) } }
              = icon("bell", class: "js-notification-loading")
              = notification_title(notification_setting.level)
            %button.btn.dropdown-toggle{ data: { toggle: "dropdown", target: notifications_menu_identifier("dropdown", notification_setting) } }
              %span.caret
              .sr-only Toggle dropdown
          - else
            %button.dropdown-new.btn.btn-default.notifications-btn#notifications-button{ type: "button", data: { toggle: "dropdown", target: notifications_menu_identifier("dropdown", notification_setting) } }
              = icon("bell", class: "js-notification-loading")
              = notification_title(notification_setting.level)
              = icon("caret-down")

          = render "shared/notifications/notification_dropdown", notification_setting: notification_setting, left_align: left_align

          = content_for :scripts_body do
            = render "shared/notifications/custom_notifications", notification_setting: notification_setting