summaryrefslogtreecommitdiff
path: root/app/views/shared/notifications/_new_button.html.haml
blob: 052e6da5bae1d16e8e55059d57767bcb68fce45a (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
26
27
- btn_class = local_assigns.fetch(:btn_class, nil)

- if notification_setting
  .js-notification-dropdown.notification-dropdown.home-panel-action-button.prepend-top-default.append-right-8.dropdown.inline
    = form_for notification_setting, remote: true, html: { class: "inline notification-form no-label" } do |f|
      = hidden_setting_source_input(notification_setting)
      = hidden_field_tag "hide_label", true
      = 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.has-tooltip.notifications-btn#notifications-button{ type: "button", title: _("Notification setting - %{notification_title}") % { notification_title: notification_title(notification_setting.level) }, class: "#{btn_class}", "aria-label" => _("Notification setting - %{notification_title}") % { notification_title: notification_title(notification_setting.level) }, data: { container: "body", placement: 'top', toggle: "modal", target: "#" + notifications_menu_identifier("modal", notification_setting), display: 'static' } }
              = notification_setting_icon(notification_setting)
              %span.js-notification-loading.fa.hidden
            %button.btn.dropdown-toggle{ data: { toggle: "dropdown", target: notifications_menu_identifier("dropdown", notification_setting), flip: "false" }, class: "#{btn_class}" }
              = sprite_icon("arrow-down", css_class: "icon mr-0")
              .sr-only Toggle dropdown
          - else
            %button.dropdown-new.btn.btn-default.has-tooltip.notifications-btn#notifications-button{ type: "button", title: _("Notification setting - %{notification_title}") % { notification_title: notification_title(notification_setting.level) }, class: "#{btn_class}", "aria-label" => _("Notification setting - %{notification_title}") % { notification_title: notification_title(notification_setting.level) }, data: { container: "body", placement: 'top', toggle: "dropdown", target: notifications_menu_identifier("dropdown", notification_setting), flip: "false" } }
              = notification_setting_icon(notification_setting)
              %span.js-notification-loading.fa.hidden
              = sprite_icon("arrow-down", css_class: "icon")

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

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