docbrown/app/views/comments/_comment.html.erb
Michael Kohl 19d6a26f7b
Update remaining Crayons icons (#16100)
Co-authored-by: Nick Taylor <nick@forem.com>
2022-01-18 13:41:04 +07:00

37 lines
1.7 KiB
Text

<% if comment && comment.user %>
<% if comment.depth < 3 %>
<details class="comment-wrapper js-comment-wrapper comment-wrapper--deep-<%= comment.depth %>
<%= comment_class(comment, is_view_root: is_view_root) %>
<%= should_be_hidden?(comment, @root_comment) ? "details-comment-hidden-by-commentable-user" : "" %>" open>
<summary>
<span class="<% if comment.depth > 0 %>mx-0<% else %>m:mx-1<% end %> inline-block align-middle">
<%= crayons_icon_tag(:collapse, class: "expanded", title: t("views.comments.collapse")) %>
<%= crayons_icon_tag(:expand, class: "collapsed", title: t("views.comments.expand")) %>
</span>
<span class="js-collapse-comment-content inline-block align-middle"></span>
</summary>
<% end %>
<div
id="comment-node-<%= comment.id %>"
class="
comment single-comment-node
<%= "low-quality-comment" if comment.decorate.low_quality %>
<%= comment_class(comment, is_view_root: is_view_root) %>
comment--deep-<%= comment.depth %>
<%= "comment--too-deep" if comment.depth > 3 %>
"
data-comment-id="<%= comment.id %>"
data-path="<%= commentable&.path %>/comments/<%= comment.id_code_generated %>"
data-comment-author-id="<%= comment_user_id_unless_deleted comment %>"
data-content-user-id="<%= comment_user_id_unless_deleted comment %>">
<%= render("comments/comment_proper",
comment: comment,
commentable: commentable,
is_view_root: is_view_root,
is_childless: is_childless,
subtree_html: subtree_html) %>
</div>
<% if comment.depth < 3 %>
</details>
<% end %>
<% end %>