2019-10-31 12:06:26 +00:00
- hide_label = local_assigns.fetch(:hide_label, false)
2017-05-10 17:36:15 +00:00
.modal.fade{ tabindex: "-1", role: "dialog", id: notifications_menu_identifier("modal", notification_setting), "aria-labelledby": "custom-notifications-title" }
2016-06-13 19:51:35 +00:00
.modal-dialog
.modal-content
.modal-header
%h4#custom-notifications-title.modal-title
2017-06-07 20:13:44 +00:00
#{ _('Custom notification events') }
2018-06-01 14:01:37 +00:00
%button.close{ type: "button", "data-dismiss": "modal", "aria-label" => _('Close') }
%span{ "aria-hidden": true } ×
2016-06-14 18:36:36 +00:00
2016-06-13 19:51:35 +00:00
.modal-body
.container-fluid
2016-06-14 18:36:36 +00:00
= form_for notification_setting, html: { class: "custom-notifications-form" } do |f|
= hidden_setting_source_input(notification_setting)
2019-10-31 12:06:26 +00:00
= hidden_field_tag("hide_label", true) if hide_label
2016-06-13 19:51:35 +00:00
.row
2016-06-17 22:57:59 +00:00
.col-lg-4
2020-05-21 18:08:27 +00:00
%h4.gl-mt-0= _('Notification events')
2016-06-17 22:57:59 +00:00
%p
2019-11-29 09:06:31 +00:00
- notification_link = link_to _('notification emails'), help_page_path('user/profile/notifications'), target: '_blank'
2017-06-07 20:13:44 +00:00
- 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 }
2016-06-17 22:57:59 +00:00
.col-lg-8
2018-07-23 02:42:19 +00:00
- notification_setting.email_events.each_with_index do |event, index|
2016-06-17 22:57:59 +00:00
- field_id = "#{notifications_menu_identifier("modal", notification_setting)}_notification_setting[#{event}]"
2016-06-13 19:51:35 +00:00
.form-group
2020-05-21 18:08:27 +00:00
.form-check{ class: ("gl-mt-0" if index == 0) }
2018-05-31 19:20:46 +00:00
= 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 }
2016-06-13 19:51:35 +00:00
%strong
2016-09-29 17:15:03 +00:00
= notification_event_name(event)
2020-02-14 12:09:03 +00:00
.fa.custom-notification-event-loading.spinner