diff options
author | Felipe Artur <felipefac@gmail.com> | 2016-06-14 15:36:36 -0300 |
---|---|---|
committer | Felipe Artur <felipefac@gmail.com> | 2016-06-16 23:34:21 -0300 |
commit | f82ab42d0534950c1ceb458e0152f329df80ae9d (patch) | |
tree | fbb3d51a8d2c899eb5037176ff3c247b09b68793 /app/helpers/notifications_helper.rb | |
parent | 5c45d5933faa0cc27e1b465322067bd2861b3e47 (diff) | |
download | gitlab-ce-f82ab42d0534950c1ceb458e0152f329df80ae9d.tar.gz |
Re-use notifications dropdown on user profile
Diffstat (limited to 'app/helpers/notifications_helper.rb')
-rw-r--r-- | app/helpers/notifications_helper.rb | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/app/helpers/notifications_helper.rb b/app/helpers/notifications_helper.rb index 50c21fc0d49..8790a66ba14 100644 --- a/app/helpers/notifications_helper.rb +++ b/app/helpers/notifications_helper.rb @@ -62,22 +62,14 @@ module NotificationsHelper end end - def notification_level_radio_buttons - html = "" - - NotificationSetting.levels.each_key do |level| - level = level.to_sym - next if level == :global - - html << content_tag(:div, class: "radio") do - content_tag(:label, { value: level }) do - radio_button_tag(:"global_notification_setting[level]", level, @global_notification_setting.level.to_sym == level) + - content_tag(:div, level.to_s.capitalize, class: "level-title") + - content_tag(:p, notification_description(level)) - end - end - end + # Identifier to trigger individually dropdowns and custom settings modals in the same view + def notifications_menu_identifier(type, notification_setting) + "#{type}-#{notification_setting.user_id}-#{notification_setting.source_id}-#{notification_setting.source_type}" + end - html.html_safe + # Create hidden field to send notification setting source to controller + def hidden_setting_source_input(notification_setting) + return unless notification_setting.source_type + hidden_field_tag "#{notification_setting.source_type.downcase}[id]", notification_setting.source_id end end |