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

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

<% end %> <% else %> <% if comment.as_administrator? %> <%= image_tag("admin_avatar.png", size: 32, class: "admin-avatar left") %> <% elsif comment.as_moderator? %> <%= image_tag("moderator_avatar.png", size: 32, class: "moderator-avatar left") %> <% else %> <% if comment.user.organization? %> <%= image_tag("collective_avatar.png", size: 32, class: "avatar left") %> <% else %> <%= avatar_image(comment.user, seed: comment.user_id, size: 32, class: "left") %> <% end %> <% if comment.user.hidden? %> <% 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? %> <%= t("comments.comment.user_deleted") %> <% else %> <%= comment.user.name %> <% if comment.user.official? %>  •  <%= comment.user.official_position %> <% end %> <% end %> <% if comment.user.verified_organization? %>  •  <%= t("shared.collective") %> <% end %> <% if comment.user_id == @commentable.author_id %>  •  <%= t("comments.comment.author") %> <% end %> <% end %>  • 
<% if comment.as_administrator? %>

<%= text_with_links comment.body %>

<% elsif comment.as_moderator? %>

<%= text_with_links comment.body %>

<% elsif comment.user.official? && comment.user_id == @commentable.author_id %>

<%= text_with_links comment.body %>

<% elsif comment.user.official? %>

<%= text_with_links comment.body %>

<% elsif comment.user_id == @commentable.author_id %>

<%= text_with_links comment.body %>

<% else %>

<%= text_with_links comment.body %>

<% end %> <%= render 'comments/votes', comment: comment %>
<%= t("comments.comment.responses", count: select_children(@comments, comment).size) %> <% 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: @commentable, parent_id: comment.id, toggeable: true} %> <% end %>
<% end %>
<% select_children(@comments, comment).each do |child| %> <%= render 'comments/comment', comment: child %> <% end %>
<% end %>