summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2016-06-17 14:28:40 +0100
committerPhil Hughes <me@iamphill.com>2016-06-17 14:28:40 +0100
commit531d27e740158bb7b8993e1f4e6e58655f610f27 (patch)
treebded6f4f74a875277d9af6b77ffa08ee8ea0f3d0
parent33c61bd461d21dbb79db18e0c2424f53120e83c0 (diff)
downloadgitlab-ce-531d27e740158bb7b8993e1f4e6e58655f610f27.tar.gz
Fixed alignment of notification dropdown menu
-rw-r--r--app/views/notifications/buttons/_notifications.html.haml5
-rw-r--r--app/views/profiles/notifications/show.html.haml2
-rw-r--r--app/views/shared/notifications/_notification_dropdown.html.haml3
3 files changed, 6 insertions, 4 deletions
diff --git a/app/views/notifications/buttons/_notifications.html.haml b/app/views/notifications/buttons/_notifications.html.haml
index 03740f2587b..f97cde0ae0c 100644
--- a/app/views/notifications/buttons/_notifications.html.haml
+++ b/app/views/notifications/buttons/_notifications.html.haml
@@ -1,10 +1,11 @@
+- left_align = local_assigns[:left_align]
- if notification_setting
.dropdown.notification-dropdown.pull-right
= form_for notification_setting, remote: true, html: { class: "inline", id: "notification-form" } do |f|
= hidden_setting_source_input(notification_setting)
= f.hidden_field :level, class: "notification_setting_level"
.js-notification-toggle-btns
- .btn-group
+ %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")
@@ -18,7 +19,7 @@
= notification_title(notification_setting.level)
= icon("caret-down")
- = render "shared/notifications/notification_dropdown", notification_setting: notification_setting
+ = 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
diff --git a/app/views/profiles/notifications/show.html.haml b/app/views/profiles/notifications/show.html.haml
index 646dd244596..cfbb4d79da2 100644
--- a/app/views/profiles/notifications/show.html.haml
+++ b/app/views/profiles/notifications/show.html.haml
@@ -29,7 +29,7 @@
%br
.clearfix
.form-group.pull-left
- = render 'notifications/buttons/notifications', notification_setting: @global_notification_setting
+ = render 'notifications/buttons/notifications', notification_setting: @global_notification_setting, left_align: true
.clearfix
diff --git a/app/views/shared/notifications/_notification_dropdown.html.haml b/app/views/shared/notifications/_notification_dropdown.html.haml
index e6e04b98c82..5b2945275ff 100644
--- a/app/views/shared/notifications/_notification_dropdown.html.haml
+++ b/app/views/shared/notifications/_notification_dropdown.html.haml
@@ -1,4 +1,5 @@
-%ul.dropdown-menu.dropdown-menu-no-wrap.dropdown-menu-align-right.dropdown-menu-selectable.dropdown-menu-large{ role: "menu", class: notifications_menu_identifier("dropdown", notification_setting) }
+- left_align = local_assigns[:left_align]
+%ul.dropdown-menu.dropdown-menu-no-wrap.dropdown-menu-selectable.dropdown-menu-large{ role: "menu", class: [notifications_menu_identifier("dropdown", notification_setting), ("dropdown-menu-align-right" if left_align.nil?)] }
- NotificationSetting.levels.each_key do |level|
- next if level == "custom"
- next if level == "global" && notification_setting.source.nil?