diff --git a/app/assets/stylesheets/application.scss.erb b/app/assets/stylesheets/application.scss.erb index a0a915b7..2b51fae2 100644 --- a/app/assets/stylesheets/application.scss.erb +++ b/app/assets/stylesheets/application.scss.erb @@ -837,6 +837,9 @@ label { .accountApps .accountIcon { background-position: 0 -32px; } +.accountNotifications .accountIcon { + background-position: 0 0; /* TODO get a real icon */ +} .accountInvite .accountIcon { background-position: 0 -64px; } @@ -851,6 +854,10 @@ label { .accountListItem:hover a { color: #424242; } +.accountNotifications.unread a { + color: #424242; + font-weight: 900; +} .accountListItem:hover .accountIcon { background-position-x: -32px; } diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 37e0007a..14f8aae9 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -45,4 +45,11 @@ module ApplicationHelper end false end + + def user_unread_notification_count + return 0 if current_user.nil? + current_user.mailboxer_notification_receipts.reduce(0) do |total, receipt| + receipt.is_read ? total : total + 1 + end + end end