From cddc3e6f937f5426c580a47c647f75be2f40a2aa Mon Sep 17 00:00:00 2001 From: James Mason Date: Fri, 8 Jun 2018 18:18:04 -0700 Subject: [PATCH] Move notifications into user menu --- app/views/layouts/_navigation.html.haml | 15 --------------- app/views/layouts/_user_menu.html.haml | 12 ++++++++++++ 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/app/views/layouts/_navigation.html.haml b/app/views/layouts/_navigation.html.haml index f7d5fa30..4a59e69a 100644 --- a/app/views/layouts/_navigation.html.haml +++ b/app/views/layouts/_navigation.html.haml @@ -32,21 +32,6 @@ %b.caret %ul.dropdown-menu = render 'layouts/user_menu' - - if can? :index, Comment - %ul.nav.navbar-nav.navbar-right - %li.dropdown - %a.dropdown-toggle{"data-toggle" => "dropdown", :href => "#"} - Notifications (#{unread_notifications(current_user).length}) - %span.fa.fa-comment - %b.caret - %ul.dropdown-menu - - if unread_notifications(current_user).length > 0 - %li.dropdown-header Last 5 Comments for: - - unread_notifications(current_user).limit(5).group_by{ |comment| comment.commentable}.each do |event, comments| - %li= link_to("#{event.title}(#{comments.count})", admin_conference_program_event_path(event.program.conference.short_title, event.id)) - %li.divider - %li= link_to "See all unread Comments (#{unread_notifications(current_user).length})", admin_comments_path - %li= link_to 'See all Comments', admin_comments_path(anchor: 'all_comments') - else %ul.nav.navbar-nav.navbar-right - if ENV['OSEM_ICHAIN_ENABLED'] == 'true' diff --git a/app/views/layouts/_user_menu.html.haml b/app/views/layouts/_user_menu.html.haml index dc645a11..4f3fe416 100644 --- a/app/views/layouts/_user_menu.html.haml +++ b/app/views/layouts/_user_menu.html.haml @@ -1,3 +1,15 @@ +- if can? :index, Comment + %li.dropdown-header + %span.fa.fa-comment + Notifications (#{unread_notifications(current_user).length}) + - if unread_notifications(current_user).length > 0 + %li.dropdown-header Last 5 Comments for: + - unread_notifications(current_user).limit(5).group_by{ |comment| comment.commentable}.each do |event, comments| + %li= link_to("#{event.title}(#{comments.count})", admin_conference_program_event_path(event.program.conference.short_title, event.id)) + %li.divider + %li= link_to "See all unread Comments (#{unread_notifications(current_user).length})", admin_comments_path + %li= link_to 'See all Comments', admin_comments_path(anchor: 'all_comments') + %li.divider - unless ENV['OSEM_ICHAIN_ENABLED'] == 'true' %li = link_to(edit_user_registration_path) do