Files
growstuff/app/views/comments/_single.html.haml
Daniel O'Connor 49284eb169 Fix haml preview (#3610)
* HAML

* rewrite

* Fix specs - but likely still wrong

* Return temple

* Trailing line

* Fix specs

* This was rearranged, apparently.

* Fix tests

* Retain escaping

* Fix specs

* Rubocop

* Attempt to fix rendering

* Fix output

* Move away from filter

* Move away from filter

* Fix spec

* Fix specs

* Fix structure to avoid nested paragraph tags
2024-02-04 15:08:18 +10:30

37 lines
1.3 KiB
Plaintext

.card.comment
.card-body
.row
.col
= render "members/tiny", member: comment.author
- if can?(:edit, comment) || can?(:destroy, comment)
%hr/
.dropdown
%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
.col-md-9.border-left
.comment-meta.text-muted
Posted by
- if comment.author.discarded?
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
:markdown
#{ strip_tags markdownify(comment.body) }