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

101 lines
4.9 KiB
Plaintext
Raw Normal View History

%li.list-group-item
2015-01-08 09:22:27 -08:00
.media
- case notification.target_type
- when "Answer"
.pull-left
%i.fa.fa-2x.fa-fw.fa-exclamation
2015-01-08 09:22:27 -08:00
.media-body
.notification--heading
%img.notification--img-sm{src: notification.target.user.profile_picture.url(:small)}
2015-01-08 09:22:27 -08:00
= user_screen_name notification.target.user
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
.notification--list-content
= markdown notification.target.question.content
.list-group-item
.media.question-media
.media-body
%h6.notification--list-heading answer
.notification--list-content
= markdown notification.target.content[0..255] + "#{notification.target.content.length > 255 ? '[...]' : ''}"
2015-01-08 09:22:27 -08:00
- when "Relationship"
.pull-left
%img.img-rounded.notification--dropdown-img{src: notification.target.source.profile_picture.url(:small)}
2015-01-08 09:22:27 -08:00
.media-body
%h6.media-heading.notification--dropdown-user
2015-01-08 09:22:27 -08:00
= user_screen_name notification.target.source
.notification--dropdown-text
= raw t('views.notifications.relationship.body', time: time_ago_in_words(notification.target.created_at))
2015-01-08 09:22:27 -08:00
- when "Smile"
.pull-left
%i.fa.fa-2x.fa-fw.fa-smile-o
2015-01-08 09:22:27 -08:00
.media-body
.notification--heading
%img.notification--img-sm{src: notification.target.user.profile_picture.url(:small)}
2015-01-08 09:22:27 -08:00
= user_screen_name notification.target.user
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
.notification--list-content
= markdown notification.target.answer.content[0..255] + "#{notification.target.answer.content.length > 255 ? '[...]' : ''}"
- when "CommentSmile"
.pull-left
%i.fa.fa-2x.fa-fw.fa-smile-o
.media-body
.notification--heading
%img.notification--img-sm{src: notification.target.user.profile_picture.url(:small)}
= user_screen_name notification.target.user
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
.notification--list-content
= markdown notification.target.comment.content
2015-01-08 09:22:27 -08:00
- when "Comment"
.pull-left
%i.fa.fa-2x.fa-fw.fa-comments
2015-01-08 09:22:27 -08:00
.media-body
.notification--heading
%img.notification--img-sm{src: notification.target.user.profile_picture.url(:small)}
2015-01-08 09:22:27 -08:00
= user_screen_name notification.target.user
commented on
- if notification.target.answer.user == current_user
= link_to "your answer", show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.answer.id)
- elsif notification.target.user == notification.target.answer.user
= link_to "their answer", show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.answer.id)
- else
= 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)
= time_tooltip(notification.target)
ago
.list-group.notification--list
.list-group-item
.media.question-media
.media-body
%h6.notification--list-heading answer
.notification--list-content
= markdown notification.target.answer.content[0..255] + "#{notification.target.answer.content.length > 255 ? '[...]' : ''}"
.list-group-item
.media.question-media
.media-body
%h6.notification--list-heading comment
.notification--list-content
= markdown notification.target.content