Files
growstuff/app/views/comments/_single.html.haml
2019-06-12 14:39:37 +12:00

35 lines
1.3 KiB
Plaintext

.card.comment
.card-body
.row
.col-md-1= render "members/tiny", member: comment.author
.col-md-11.border-left
- if can?(:edit, comment) || can?(:destroy, comment)
.dropdown.float-right
%button#comment-edit-button.btn.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-toggle" => "dropdown", type: "button"} Actions
.dropdown-menu.dropdown-menu-xs{"aria-labelledby" => "comment-edit-button"}
- if can? :edit, comment
= link_to edit_comment_path(comment), class: 'dropdown-item' do
= edit_icon
Edit
- if can? :destroy, comment
= link_to comment, method: :delete,
data: { confirm: 'Are you sure?' }, class: 'dropdown-item text-danger' do
= delete_icon
Delete
.comment-meta.text-muted
Posted by
- if comment.author.deleted?
Member Deleted
- else
= link_to comment.author.login_name, member_path(comment.author)
on
= comment.created_at
- if comment.updated_at > comment.created_at
and edited at
= comment.updated_at
.comment-body
:growstuff_markdown
#{ strip_tags comment.body }