2015-06-08 12:51:46 -07:00
|
|
|
= nav_entry t('views.navigation.notifications'), notifications_path, badge: notification_count, class: 'visible-xs'
|
2015-09-16 13:18:40 -07:00
|
|
|
- notifications = Notification.for(current_user).where(new: true).limit(4)
|
2015-01-26 08:16:32 -08:00
|
|
|
%li.dropdown.hidden-xs
|
|
|
|
%a.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
|
2015-09-16 13:18:40 -07:00
|
|
|
%ul.dropdown-menu.notification-center
|
2015-01-26 08:50:45 -08:00
|
|
|
- if notifications.count == 0
|
2015-09-16 13:18:40 -07:00
|
|
|
%li.text-center
|
|
|
|
.notifications--none
|
|
|
|
%i.fa.fa-bell-o.no-notifications
|
|
|
|
%p No new notifications.
|
|
|
|
%li.text-center
|
|
|
|
%a{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|
|
2015-09-16 13:18:40 -07:00
|
|
|
%li
|
2015-01-26 08:50:45 -08:00
|
|
|
.media.notification--dropdown-media
|
|
|
|
- case notification.target_type
|
|
|
|
- when "Answer"
|
|
|
|
.pull-left
|
2015-09-16 13:18:40 -07:00
|
|
|
%i.fa.fa-2x.fa-fw.fa-exclamation
|
2015-01-26 08:50:45 -08:00
|
|
|
.media-body
|
2015-09-16 13:18:40 -07:00
|
|
|
.notification--heading
|
|
|
|
%img.notification--img-sm{src: notification.target.user.profile_picture.url(:small)}
|
2015-01-26 08:50:45 -08:00
|
|
|
= user_screen_name notification.target.user
|
2015-09-16 13:18:40 -07:00
|
|
|
answered
|
|
|
|
= link_to "your question", show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.id)
|
|
|
|
= time_tooltip(notification.target)
|
|
|
|
ago
|
|
|
|
.list-group.notification--list
|
|
|
|
.list-group-item
|
|
|
|
.media.question-media
|
|
|
|
.media-body
|
|
|
|
%h6.notification--list-heading question
|
2015-09-16 13:46:33 -07:00
|
|
|
.notification--list-content= markdown notification.target.question.content
|
2015-09-16 13:18:40 -07:00
|
|
|
.list-group-item
|
|
|
|
.media.question-media
|
|
|
|
.media-body
|
|
|
|
%h6.notification--list-heading answer
|
2015-09-16 13:46:33 -07:00
|
|
|
.notification--list-content= markdown notification.target.content
|
2015-01-26 08:50:45 -08:00
|
|
|
- when "Relationship"
|
|
|
|
.pull-left
|
2015-09-16 13:18:40 -07:00
|
|
|
%img.img-rounded.notification--dropdown-img{src: notification.target.source.profile_picture.url(:small)}
|
2015-01-26 08:50:45 -08:00
|
|
|
.media-body
|
|
|
|
%h6.media-heading.notification--dropdown-user
|
|
|
|
= user_screen_name notification.target.source
|
|
|
|
.notification--dropdown-text
|
2015-06-06 16:28:10 -07:00
|
|
|
= raw t('views.notifications.relationship.body', time: time_ago_in_words(notification.target.created_at))
|
2015-01-26 08:50:45 -08:00
|
|
|
- when "Smile"
|
|
|
|
.pull-left
|
2015-09-16 13:18:40 -07:00
|
|
|
%i.fa.fa-2x.fa-fw.fa-smile-o
|
2015-01-26 08:50:45 -08:00
|
|
|
.media-body
|
2015-09-16 13:18:40 -07:00
|
|
|
.notification--heading
|
|
|
|
%img.notification--img-sm{src: notification.target.user.profile_picture.url(:small)}
|
2015-01-26 08:50:45 -08:00
|
|
|
= user_screen_name notification.target.user
|
2015-09-16 13:18:40 -07:00
|
|
|
smiled
|
|
|
|
= link_to "your answer", show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.answer.id)
|
|
|
|
= time_tooltip(notification.target)
|
|
|
|
ago
|
|
|
|
.list-group.notification--list
|
|
|
|
.list-group-item
|
|
|
|
.media.question-media
|
|
|
|
.media-body
|
|
|
|
%h6.notification--list-heading answer
|
2015-09-16 13:46:33 -07:00
|
|
|
.notification--list-content= markdown notification.target.answer.content
|
2015-05-03 18:39:41 -07:00
|
|
|
- when "CommentSmile"
|
|
|
|
.pull-left
|
2015-09-16 13:18:40 -07:00
|
|
|
%i.fa.fa-2x.fa-fw.fa-smile-o
|
2015-05-03 18:39:41 -07:00
|
|
|
.media-body
|
2015-09-16 13:18:40 -07:00
|
|
|
.notification--heading
|
|
|
|
%img.notification--img-sm{src: notification.target.user.profile_picture.url(:small)}
|
2015-05-03 18:39:41 -07:00
|
|
|
= user_screen_name notification.target.user
|
2015-09-16 13:18:40 -07:00
|
|
|
smiled
|
|
|
|
= link_to "your comment", show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.comment.answer.id)
|
|
|
|
= time_tooltip(notification.target)
|
|
|
|
ago
|
|
|
|
.list-group.notification--list
|
|
|
|
.list-group-item
|
|
|
|
.media.question-media
|
|
|
|
.media-body
|
|
|
|
%h6.notification--list-heading comment
|
2015-09-16 13:46:33 -07:00
|
|
|
.notification--list-content= markdown notification.target.comment.content
|
2015-01-26 08:50:45 -08:00
|
|
|
- when "Comment"
|
|
|
|
.pull-left
|
2015-09-16 13:18:40 -07:00
|
|
|
%i.fa.fa-2x.fa-fw.fa-comments
|
2015-01-26 08:50:45 -08:00
|
|
|
.media-body
|
2015-09-16 13:18:40 -07:00
|
|
|
.notification--heading
|
|
|
|
%img.notification--img-sm{src: notification.target.user.profile_picture.url(:small)}
|
2015-01-26 08:50:45 -08:00
|
|
|
= user_screen_name notification.target.user
|
2015-09-16 13:18:40 -07:00
|
|
|
commented on
|
2015-06-06 17:43:18 -07:00
|
|
|
- if notification.target.answer.user == current_user
|
2015-09-16 13:18:40 -07:00
|
|
|
= link_to "your answer", show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.answer.id)
|
2015-06-06 17:43:18 -07:00
|
|
|
- elsif notification.target.user == notification.target.answer.user
|
2015-09-16 13:18:40 -07:00
|
|
|
= link_to "their answer", show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.answer.id)
|
2015-06-06 17:43:18 -07:00
|
|
|
- else
|
2015-09-16 13:46:33 -07:00
|
|
|
= link_to "#{notification.target.answer.user.screen_name}'s answer", show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.answer.id)
|
2015-09-16 13:18:40 -07:00
|
|
|
= time_tooltip(notification.target)
|
|
|
|
ago
|
|
|
|
.list-group.notification--list
|
|
|
|
.list-group-item
|
|
|
|
.media.question-media
|
|
|
|
.media-body
|
|
|
|
%h6.notification--list-heading answer
|
2015-09-16 13:46:33 -07:00
|
|
|
.notification--list-content= markdown notification.target.answer.content
|
2015-09-16 13:18:40 -07:00
|
|
|
.list-group-item
|
|
|
|
.media.question-media
|
|
|
|
.media-body
|
|
|
|
%h6.notification--list-heading comment
|
2015-09-16 13:46:33 -07:00
|
|
|
.notification--list-content= markdown notification.target.content
|
2015-09-16 13:18:40 -07:00
|
|
|
%li.text-center
|
|
|
|
%a{href: notifications_path}
|
|
|
|
%i.fa.fa-fw.fa-chevron-right
|
|
|
|
Show all new notifications
|