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

63 lines
2.9 KiB
Plaintext
Raw Normal View History

2014-12-09 14:07:04 -08:00
.container.j2-page
= render 'notification_tabs'
.col-md-9.col-xs-12.col-sm-9
%ul.list-group
2014-12-14 05:34:51 -08:00
- Notification.for(current_user).each do |notification|
%li.list-group-item
.media
2014-12-14 05:58:29 -08:00
- case notification.target_type
- when "Answer"
.pull-left
%img.notification--img{src: gravatar_url(notification.target.user)}
.media-body
%h6.media-heading.notification--user
= user_screen_name notification.target.user
2014-12-14 05:34:51 -08:00
%p.notification--text
answered
%a{href: show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.id)}
your question
= time_ago_in_words notification.target.created_at
ago
.notification--icon
%i.fa.fa-exclamation
2014-12-14 05:58:29 -08:00
- when "Relationship"
.pull-left
%img.notification--img{src: gravatar_url(notification.target.source)}
.media-body
%h6.media-heading.notification--user
= user_screen_name notification.target.source
%p.notification--text
2014-12-14 06:06:10 -08:00
followed you
= time_ago_in_words notification.target.created_at
ago
2014-12-14 05:58:29 -08:00
.notification--icon
%i.fa.fa-users
2014-12-14 06:06:10 -08:00
- when "Smile"
.pull-left
%img.notification--img{src: gravatar_url(notification.target.user)}
.media-body
%h6.media-heading.notification--user
= user_screen_name notification.target.user
%p.notification--text
smiled at
%a{href: show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.answer.id)}
your answer
= time_ago_in_words notification.target.created_at
ago
.notification--icon
%i.fa.fa-smile-o
2014-12-14 06:10:23 -08:00
- when "Comment"
.pull-left
%img.notification--img{src: gravatar_url(notification.target.user)}
.media-body
%h6.media-heading.notification--user
= user_screen_name notification.target.user
%p.notification--text
commented on
%a{href: show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.answer.id)}
%a your answer
= time_ago_in_words notification.target.created_at
ago
.notification--icon
2014-12-14 06:15:15 -08:00
%i.fa.fa-comments
- Notification.for(current_user).update_all(new: false)