diff options
author | Felipe Artur <felipefac@gmail.com> | 2016-06-17 12:26:32 -0300 |
---|---|---|
committer | Felipe Artur <felipefac@gmail.com> | 2016-06-17 12:33:11 -0300 |
commit | ab236c76247d83c190b148acbffa48f244414553 (patch) | |
tree | 69b17bdec6f52d96d1e4d7a807f3432263ef3cd4 /app/views/shared/notifications | |
parent | a4b078bfb8b99a9852eb55abd498d65a374375e3 (diff) | |
download | gitlab-ce-ab236c76247d83c190b148acbffa48f244414553.tar.gz |
Allow users to set custom notifications in projects they don't own and several fixes to code
Diffstat (limited to 'app/views/shared/notifications')
-rw-r--r-- | app/views/shared/notifications/buttons/_button.html.haml | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/app/views/shared/notifications/buttons/_button.html.haml b/app/views/shared/notifications/buttons/_button.html.haml new file mode 100644 index 00000000000..ff1cf966a9b --- /dev/null +++ b/app/views/shared/notifications/buttons/_button.html.haml @@ -0,0 +1,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 |