docbrown/app/views/comments/_comment.html.erb
Ben Halpern b900c8de92
Remove legacy "deleted commentable" view (#15052)
* Remove unneeded extra page

* Update app/views/comments/index.html.erb

Co-authored-by: Michael Kohl <citizen428@forem.com>

* Update app/views/comments/index.html.erb

Co-authored-by: Michael Kohl <citizen428@forem.com>
2021-10-13 10:23:25 -04:00

35 lines
1.7 KiB
Text

<% if comment && comment.user && !should_be_hidden?(comment, @root_comment) %>
<% 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) %>" open>
<summary>
<span class="<% if comment.depth > 0 %>mx-0<% else %>m:mx-1<% end %> inline-block align-middle">
<%= inline_svg_tag("collapse.svg", aria: true, class: "crayons-icon expanded", title: "Collapse") %>
<%= inline_svg_tag("expand.svg", aria: true, class: "crayons-icon collapsed", title: "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 %>