docbrown/app/views/comments/_comment_proper.html.erb
Anna Buianova 7d5650c3f1
Admin access to spam comments by url (#20775)
* Admin access to spam comments by url

* Fixed spec

* Fixed view spec
2024-03-22 08:40:36 -04:00

55 lines
1.9 KiB
Text

<% decorated_comment = comment.decorate %>
<div class="comment__inner">
<%= render partial: "comments/comment_avatar", locals: { comment: comment } %>
<div class="inner-comment comment__details">
<div class="comment__content crayons-card">
<% if comment.deleted || (decorated_comment.super_low_quality && !is_admin) %>
<div class="p-6 align-center opacity-50 fs-s">
<span class="js-comment-username">
<%= t("views.comments.delete.comment_deleted") %>
</span>
</div>
<% else %>
<%= render partial: "comments/comment_quality_marker", locals: {
comment: comment,
decorated_comment: decorated_comment
} %>
<%= render partial: "comments/comment_header", locals: {
comment: comment,
commentable: commentable,
decorated_comment: decorated_comment
} %>
<div
class="
comment__body
text-styles
text-styles--secondary
body
<%= "color-base-60" if comment.decorate.low_quality %>
<%= should_be_hidden?(comment, @root_comment) ? "element-hidden-by-commentable-user" : "" %>
">
<%= comment.safe_processed_html %>
</div>
<% if should_be_hidden?(comment, @root_comment) %>
<div class="p-6 align-center opacity-50 fs-s hidden comment-hidden-by-author-text">
<%= t("views.comments.hidden.comment_hidden") %>
</div>
<% end %>
<% end %>
</div>
<%= unless comment.deleted || commentable.nil? || should_be_hidden?(comment, @root_comment)
(render partial: "comments/comment_footer", locals: {
comment: comment,
commentable: commentable,
is_childless: is_childless
})
end %>
</div>
</div>
<%= subtree_html %>