2020-04-26 14:29:23 +02:00
|
|
|
= nav_entry t('views.navigation.notifications'), notifications_path, badge: notification_count, class: 'd-block d-sm-none'
|
2015-09-16 22:18:40 +02:00
|
|
|
- notifications = Notification.for(current_user).where(new: true).limit(4)
|
2020-04-26 14:29:23 +02:00
|
|
|
%li.nav-item.dropdown.d-none.d-sm-block
|
2020-05-10 11:35:10 +02:00
|
|
|
%a.nav-link.dropdown-toggle{ href: '#', data: { toggle: :dropdown } }
|
2015-02-09 16:48:31 +01:00
|
|
|
- if notification_count.nil?
|
|
|
|
%i.fa.fa-bell-o
|
|
|
|
- else
|
|
|
|
%i.fa.fa-bell
|
|
|
|
%span.sr-only Notifications
|
2015-01-26 17:16:32 +01:00
|
|
|
%span.badge= notification_count
|
2020-05-11 14:09:25 +02:00
|
|
|
.dropdown-menu.dropdown-menu-right.notification-dropdown
|
2020-05-10 11:35:10 +02:00
|
|
|
- if notifications.count.zero?
|
2020-05-01 21:57:14 +02:00
|
|
|
.dropdown-item.text-center.p-2
|
|
|
|
%i.fa.fa-bell-o.notification__bell-icon
|
2020-04-19 23:13:39 +02:00
|
|
|
%p No new notifications.
|
2020-05-10 11:35:10 +02:00
|
|
|
%a.dropdown-item.text-center{ href: notifications_path('all') }
|
2020-04-19 23:13:39 +02:00
|
|
|
%i.fa.fa-fw.fa-chevron-right
|
|
|
|
Show all notifications
|
2015-01-26 17:50:45 +01:00
|
|
|
- else
|
|
|
|
- notifications.each do |notification|
|
2020-05-01 21:57:14 +02:00
|
|
|
.dropdown-item
|
2022-02-27 15:43:19 +01:00
|
|
|
= render "notifications/type/#{notification.target_type.downcase.split('::').last}", notification: notification
|
2020-04-26 15:26:55 +02:00
|
|
|
|
2020-05-10 11:35:10 +02:00
|
|
|
%a.dropdown-item.text-center{ href: notifications_path }
|
2020-04-19 23:13:39 +02:00
|
|
|
%i.fa.fa-fw.fa-chevron-right
|
|
|
|
Show all new notifications
|