Files
growstuff/app/views/comments/_single.html.haml
2015-07-02 18:53:18 +08:00

25 lines
940 B
Plaintext

.well
.comment
.row
.col-md-1
= render :partial => "members/avatar", :locals => { :member => comment.author }
.col-md-11
.comment-meta
= (comment.created_at == comment.updated_at) ? 'Posted by' : 'Edited by'
= link_to comment.author.login_name, member_path(comment.author)
on
= (comment.created_at == comment.updated_at) ? comment.created_at : comment.updated_at
.comment-body
:growstuff_markdown
#{ strip_tags comment.body }
- if can? :edit, comment or can? :destroy, comment
.comment-actions
- if can? :edit, comment
= link_to 'Edit', edit_comment_path(comment), :class => 'btn btn-default btn-xs'
- if can? :destroy, comment
= link_to 'Delete', comment, method: :delete, |
data: { confirm: 'Are you sure?' }, :class => 'btn btn-default btn-xs'