Retrospring/app/views/navigation/main/_notifications.haml

27 lines
1.1 KiB
Plaintext
Raw Normal View History

= nav_entry t('views.navigation.notifications'), notifications_path, badge: notification_count, class: 'd-block d-sm-none'
- notifications = Notification.for(current_user).where(new: true).limit(4)
%li.nav-item.dropdown.d-none.d-sm-block
%a.nav-link.dropdown-toggle{href: "#", "data-toggle" => "dropdown"}
2015-02-09 07:48:31 -08:00
- if notification_count.nil?
%i.fa.fa-bell-o
- else
%i.fa.fa-bell
%span.sr-only Notifications
2015-01-26 08:16:32 -08:00
%span.badge= notification_count
.dropdown-menu.notification-dropdown
2015-01-26 08:50:45 -08:00
- if notifications.count == 0
.dropdown-item.text-center.p-2
%i.fa.fa-bell-o.notification__bell-icon
2020-04-19 14:13:39 -07:00
%p No new notifications.
%a.dropdown-item.text-center{href: notifications_path('all')}
%i.fa.fa-fw.fa-chevron-right
Show all notifications
2015-01-26 08:50:45 -08:00
- else
- notifications.each do |notification|
.dropdown-item
= render "notifications/type/#{notification.target_type.downcase}", notification: notification
2020-04-19 14:13:39 -07:00
%a.dropdown-item.text-center{href: notifications_path}
%i.fa.fa-fw.fa-chevron-right
Show all new notifications