retrospring/app/views/notifications/index.html.haml

63 lines
3.3 KiB
Text
Raw Normal View History

2014-12-09 23:07:04 +01:00
.container.j2-page
= render 'notification_tabs'
.col-md-9.col-xs-12.col-sm-9
%ul.list-group
2014-12-14 15:24:59 +01:00
- @notifications.each do |notification|
2014-12-14 15:48:19 +01:00
%li.list-group-item{class: (notification.new? ? 'list-group-item-warning' : '')}
2014-12-14 14:34:51 +01:00
.media
2014-12-14 14:58:29 +01:00
- case notification.target_type
- when "Answer"
.pull-left
2014-12-14 15:44:17 +01:00
%img.img-rounded.notification--img{src: gravatar_url(notification.target.user)}
2014-12-14 14:58:29 +01:00
.media-body
%h6.media-heading.notification--user
= user_screen_name notification.target.user
2014-12-14 14:34:51 +01:00
%p.notification--text
answered
2014-12-27 01:55:09 +01:00
%a{href: show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.id), title: "#{notification.target.content[0..40]}...", data: { toggle: :tooltip, placement: :top }}
2014-12-14 14:34:51 +01:00
your question
= time_ago_in_words notification.target.created_at
ago
.notification--icon
%i.fa.fa-exclamation
2014-12-14 14:58:29 +01:00
- when "Relationship"
.pull-left
2014-12-14 15:44:17 +01:00
%img.img-rounded.notification--img{src: gravatar_url(notification.target.source)}
2014-12-14 14:58:29 +01:00
.media-body
%h6.media-heading.notification--user
= user_screen_name notification.target.source
%p.notification--text
2014-12-14 15:06:10 +01:00
followed you
= time_ago_in_words notification.target.created_at
ago
2014-12-14 14:58:29 +01:00
.notification--icon
%i.fa.fa-users
2014-12-14 15:06:10 +01:00
- when "Smile"
.pull-left
2014-12-14 15:44:17 +01:00
%img.img-rounded.notification--img{src: gravatar_url(notification.target.user)}
2014-12-14 15:06:10 +01:00
.media-body
%h6.media-heading.notification--user
= user_screen_name notification.target.user
%p.notification--text
smiled at
2014-12-27 01:55:09 +01:00
%a{href: show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.answer.id), title: "#{notification.target.answer.content[0..40]}...", data: { toggle: :tooltip, placement: :top }}
2014-12-14 15:06:10 +01:00
your answer
= time_ago_in_words notification.target.created_at
ago
.notification--icon
%i.fa.fa-smile-o
2014-12-14 15:10:23 +01:00
- when "Comment"
.pull-left
2014-12-14 15:44:17 +01:00
%img.img-rounded.notification--img{src: gravatar_url(notification.target.user)}
2014-12-14 15:10:23 +01:00
.media-body
%h6.media-heading.notification--user
= user_screen_name notification.target.user
%p.notification--text
commented on
2014-12-27 01:55:09 +01:00
%a{href: show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.answer.id), title: "#{notification.target.answer.content[0..40]}...", data: { toggle: :tooltip, placement: :top }}
2014-12-14 15:49:44 +01:00
your answer
2014-12-14 15:10:23 +01:00
= time_ago_in_words notification.target.created_at
ago
.notification--icon
2014-12-14 15:15:15 +01:00
%i.fa.fa-comments
- Notification.for(current_user).update_all(new: false)