27 lines
1.1 KiB
Plaintext
27 lines
1.1 KiB
Plaintext
= 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 } }
|
|
- if notification_count.nil?
|
|
%i.fa.fa-bell-o
|
|
- else
|
|
%i.fa.fa-bell
|
|
%span.sr-only= t('views.navigation.notifications')
|
|
%span.badge= notification_count
|
|
.dropdown-menu.dropdown-menu-right.notification-dropdown
|
|
- if notifications.count.zero?
|
|
.dropdown-item.text-center.p-2
|
|
%i.fa.fa-bell-o.notification__bell-icon
|
|
%p= t(".none")
|
|
%a.dropdown-item.text-center{ href: notifications_path('all') }
|
|
%i.fa.fa-fw.fa-chevron-right
|
|
= t(".all")
|
|
- else
|
|
- notifications.each do |notification|
|
|
.dropdown-item
|
|
= render "notifications/type/#{notification.target.class.name.downcase.split('::').last}", notification: notification
|
|
|
|
%a.dropdown-item.text-center{ href: notifications_path }
|
|
%i.fa.fa-fw.fa-chevron-right
|
|
= t(".new")
|