<% cache [locale_and_user_status(comment), comment, commentable_cache_key(comment.commentable), comment.author, (@comment_flags[comment.id] if @comment_flags)] do %>
<% if comment.hidden? || comment.user.hidden? %> <% if comment.children.size > 0 %>

<%= t("comments.comment.deleted") %>

<% end %> <% else %> <% if comment.as_administrator? %> <%= image_tag("avatar_admin.png", size: 32, class: "admin-avatar float-left") %> <% elsif comment.as_moderator? %> <%= image_tag("avatar_moderator.png", size: 32, class: "moderator-avatar float-left") %> <% else %> <% if comment.user.hidden? || comment.user.erased? %> <% elsif comment.user.organization? %> <%= image_tag("avatar_collective.png", size: 32, class: "avatar float-left") %> <% else %> <%= avatar_image(comment.user, seed: comment.user_id, size: 32, class: "float-left") %> <% end %> <% end %>
<% if comment.as_administrator? %> <%= t("comments.comment.admin") %> #<%= comment.administrator_id%> <% elsif comment.as_moderator? %> <%= t("comments.comment.moderator") %> #<%= comment.moderator_id%> <% else %> <% if comment.user.hidden? || comment.user.erased? %> <%= t("comments.comment.user_deleted") %> <% else %> <%= link_to comment.user.name, user_path(comment.user) %> <% if comment.user.display_official_position_badge? %>  •  <%= comment.user.official_position %> <% end %> <% end %> <% if comment.user.verified_organization? %>  •  <%= t("shared.collective") %> <% end %> <% if comment.user_id == comment.commentable.author_id %>  •  <%= t("comments.comment.author") %> <% end %> <% end %>  • 
<%= simple_format text_with_links(comment.body), {}, sanitize: false %>
<%= render 'comments/votes', comment: comment %> <% if comment.children.size > 0 %> <%= link_to "", class: "js-toggle-children relative", data: {'id': "#{dom_id(comment)}"} do %> <%= t("shared.hide") %> <%= t("comments.comment.responses", count: comment.children.size) %> <% end %> <% else %> <%= t("comments.comment.responses", count: 0) %> <% end %> <% if user_signed_in? %>  |  <%= link_to(comment_link_text(comment), "", class: "js-add-comment-link", data: {'id': dom_id(comment)}) %> <%= render 'comments/actions', comment: comment %> <%= render 'comments/form', {commentable: comment.commentable, parent_id: comment.id, toggeable: true} %> <% end %>
<% end %>
<% child_comments_of(comment).each do |child| %> <%= render 'comments/comment', comment: child %> <% end %>
<% end %>