debian-mirror-gitlab/app/views/shared/notifications/_button.html.haml

38 lines
2.4 KiB
Text
Raw Normal View History

2019-10-12 21:52:04 +05:30
- btn_class = local_assigns.fetch(:btn_class, '')
- emails_disabled = local_assigns.fetch(:emails_disabled, false)
2019-02-15 15:39:39 +05:30
2016-06-22 15:30:34 +05:30
- if notification_setting
2019-10-12 21:52:04 +05:30
- if emails_disabled
- button_title = notification_description(:owner_disabled)
- aria_label = button_title
- btn_class << " disabled"
- else
- button_title = _("Notification setting")
- aria_label = _("Notification setting - %{notification_title}") % { notification_title: notification_title(notification_setting.level) }
2019-09-04 21:01:54 +05:30
.js-notification-dropdown.notification-dropdown.mr-md-2.home-panel-action-button.dropdown.inline
2016-06-22 15:30:34 +05:30
= 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?
2019-10-12 21:52:04 +05:30
%button.dropdown-new.btn.btn-default.has-tooltip.notifications-btn.text-left#notifications-button{ type: "button", title: button_title, class: "#{btn_class}", "aria-label" => aria_label, data: { container: "body", toggle: "modal", target: "#" + notifications_menu_identifier("modal", notification_setting), display: 'static' } }
2016-06-22 15:30:34 +05:30
= icon("bell", class: "js-notification-loading")
= notification_title(notification_setting.level)
2018-12-13 13:39:08 +05:30
%button.btn.dropdown-toggle{ data: { toggle: "dropdown", target: notifications_menu_identifier("dropdown", notification_setting), flip: "false" } }
2016-11-03 12:29:30 +05:30
= icon('caret-down')
2016-06-22 15:30:34 +05:30
.sr-only Toggle dropdown
- else
2019-10-12 21:52:04 +05:30
%button.dropdown-new.btn.btn-default.has-tooltip.notifications-btn#notifications-button{ type: "button", title: button_title, class: "#{btn_class}", "aria-label" => aria_label, data: { container: "body", toggle: "dropdown", target: notifications_menu_identifier("dropdown", notification_setting), flip: "false" } }
2019-09-04 21:01:54 +05:30
.float-left
= icon("bell", class: "js-notification-loading")
= notification_title(notification_setting.level)
.float-right
= icon("caret-down")
2016-06-22 15:30:34 +05:30
2017-08-17 22:00:37 +05:30
= render "shared/notifications/notification_dropdown", notification_setting: notification_setting
2016-06-22 15:30:34 +05:30
= content_for :scripts_body do
= render "shared/notifications/custom_notifications", notification_setting: notification_setting