summaryrefslogtreecommitdiff
path: root/app/views/shared
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/shared')
-rw-r--r--app/views/shared/projects/_custom_notifications.html.haml27
-rw-r--r--app/views/shared/projects/_notification_dropdown.html.haml9
2 files changed, 36 insertions, 0 deletions
diff --git a/app/views/shared/projects/_custom_notifications.html.haml b/app/views/shared/projects/_custom_notifications.html.haml
new file mode 100644
index 00000000000..8569c523ef4
--- /dev/null
+++ b/app/views/shared/projects/_custom_notifications.html.haml
@@ -0,0 +1,27 @@
+#custom-notifications-modal.modal.fade{ tabindex: "-1", role: "dialog", aria: { labelledby: "custom-notifications-title" } }
+ .modal-dialog
+ .modal-content
+ .modal-header
+ %button.close{ type: "button", data: { dismiss: "modal" }, aria: { label: "close" } }
+ %span{ aria: { hidden: "true" } } ×
+ %h4#custom-notifications-title.modal-title
+ Custom notification events
+ .modal-body
+ .container-fluid
+ = form_for @notification_setting, url: namespace_project_notification_setting_path(@project.namespace.becomes(Namespace), @project), method: :patch, html: { class: "custom-notifications-form" } do |f|
+ = hidden_field_tag "custom_events", "true"
+ = f.hidden_field :level
+ .row
+ .col-lg-3
+ %h4.prepend-top-0
+ Notification events
+ .col-lg-9
+ - NotificationSetting::EMAIL_EVENTS.each do |event, index|
+ = index
+ .form-group
+ .checkbox{ class: ("prepend-top-0" if index == 0) }
+ %label{ for: "events_#{event}" }
+ = check_box_tag "events[#{event}]", true, @notification_setting.events[event], id: "events_#{event}", class: "js-custom-notification-event"
+ %strong
+ = event.to_s.humanize
+ = icon("spinner spin", class: "custom-notification-event-loading")
diff --git a/app/views/shared/projects/_notification_dropdown.html.haml b/app/views/shared/projects/_notification_dropdown.html.haml
new file mode 100644
index 00000000000..6388f907eb3
--- /dev/null
+++ b/app/views/shared/projects/_notification_dropdown.html.haml
@@ -0,0 +1,9 @@
+%ul.dropdown-menu.dropdown-menu-no-wrap.dropdown-menu-align-right.dropdown-menu-selectable.dropdown-menu-large{ role: "menu" }
+ - NotificationSetting.levels.each do |level|
+ - if level.first != "custom"
+ = notification_list_item(level.first, @notification_setting)
+ - if @notification_setting.level != "custom"
+ %li.divider
+ %li
+ %a.update-notification{ href: "#", role: "button", data: { toggle: "modal", target: "#custom-notifications-modal", notification_level: "custom", notification_title: "Custom" } }
+ Custom