2020-04-26 05:29:23 -07:00
|
|
|
= nav_entry t('views.navigation.notifications'), notifications_path, badge: notification_count, class: 'd-block d-sm-none'
|
2015-09-16 13:18:40 -07:00
|
|
|
- notifications = Notification.for(current_user).where(new: true).limit(4)
|
2020-04-26 05:29:23 -07:00
|
|
|
%li.nav-item.dropdown.d-none.d-sm-block
|
2020-05-10 02:35:10 -07:00
|
|
|
%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
|
2022-07-06 16:15:43 -07:00
|
|
|
%span.sr-only= t('views.navigation.notifications')
|
2015-01-26 08:16:32 -08:00
|
|
|
%span.badge= notification_count
|
2020-05-11 05:09:25 -07:00
|
|
|
.dropdown-menu.dropdown-menu-right.notification-dropdown
|
2020-05-10 02:35:10 -07:00
|
|
|
- if notifications.count.zero?
|
2020-05-01 12:57:14 -07:00
|
|
|
.dropdown-item.text-center.p-2
|
|
|
|
%i.fa.fa-bell-o.notification__bell-icon
|
2022-07-06 16:15:43 -07:00
|
|
|
%p= t(".none")
|
2020-05-10 02:35:10 -07:00
|
|
|
%a.dropdown-item.text-center{ href: notifications_path('all') }
|
2020-04-19 14:13:39 -07:00
|
|
|
%i.fa.fa-fw.fa-chevron-right
|
2022-07-06 16:15:43 -07:00
|
|
|
= t(".all")
|
2015-01-26 08:50:45 -08:00
|
|
|
- else
|
|
|
|
- notifications.each do |notification|
|
2020-05-01 12:57:14 -07:00
|
|
|
.dropdown-item
|
2022-07-08 15:07:57 -07:00
|
|
|
= render "notifications/type/#{notification.target.class.name.downcase.split('::').last}", notification: notification
|
2020-04-26 06:26:55 -07:00
|
|
|
|
2020-05-10 02:35:10 -07:00
|
|
|
%a.dropdown-item.text-center{ href: notifications_path }
|
2020-04-19 14:13:39 -07:00
|
|
|
%i.fa.fa-fw.fa-chevron-right
|
2022-07-06 16:15:43 -07:00
|
|
|
= t(".new")
|