106 lines
4.4 KiB
Plaintext
106 lines
4.4 KiB
Plaintext
<div class="row">
|
|
<div id="<%= dom_id(comment) %>" class="comment small-12 column">
|
|
|
|
<% if comment.not_visible? %>
|
|
<%= t("debates.comment.deleted") %>
|
|
<% else %>
|
|
|
|
<% if comment.user.organization? %>
|
|
<%= image_tag("collective_avatar.png", size: 32, class: "avatar left") %>
|
|
<% else %>
|
|
<%= avatar_image(comment.user, size: 32, class: "left") %>
|
|
<% end %>
|
|
<% if comment.user.hidden? %>
|
|
<i class="icon-deleted user-deleted"></i>
|
|
<% end %>
|
|
<!--
|
|
<% if comment.user.moderator? %> <!-- AND has activated CHECKBOX comment as moderator ->
|
|
<%= image_tag("moderator_avatar.png", size: 32, class: "moderator-avatar left") %>
|
|
<% elsif comment.user.administrator? %> <!-- AND has activated CHECKBOX comment as admin ->
|
|
<%= image_tag("admin_avatar.png", size: 32, class: "admin-avatar left") %>
|
|
<% end %>
|
|
-->
|
|
<div class="comment-body">
|
|
<div class="comment-info">
|
|
|
|
<% if comment.user.hidden? %>
|
|
<span class="user-name"><%= t("debates.comment.user_deleted") %></span>
|
|
<% else %>
|
|
|
|
<% if comment.user.moderator? %> <!-- AND activate moderator CHECKBOX -->
|
|
<span class="user-name"><%= t("debates.comment.moderator") %> #ID</span> <!-- Add ID to Moderator name -->
|
|
<% elsif comment.user.administrator? %> <!-- AND activate administrator CHECKBOX -->
|
|
<span class="user-name"><%= t("debates.comment.admin") %> #ID</span> <!-- Add ID to Admin name -->
|
|
<% else %>
|
|
<span class="user-name"><%= comment.user.name %></span>
|
|
<% end %>
|
|
|
|
<% if comment.user.official? %>
|
|
•
|
|
<span class="label round level-<%= comment.user.official_level %>">
|
|
<%= comment.user.official_position %>
|
|
</span>
|
|
<% end %>
|
|
<% end %>
|
|
<% if comment.user.verified_organization? %>
|
|
•
|
|
<span class="label round is-association">
|
|
<%= t("shared.collective") %>
|
|
</span>
|
|
<% end %>
|
|
<% if comment.user_id == @debate.author_id %>
|
|
•
|
|
<span class="label round is-author">
|
|
<%= t("debates.comment.author") %>
|
|
</span>
|
|
<% end %>
|
|
• <%= time_ago_in_words(comment.created_at) %>
|
|
|
|
<span class="right js-flag-as-inappropiate-actions">
|
|
<%= render 'comments/flag_as_inappropiate_actions', comment: comment %>
|
|
</span>
|
|
|
|
</div>
|
|
|
|
<% if comment.user.official? && comment.user_id == @debate.author_id %>
|
|
<p class="comment-user level-<%= comment.user.official_level %> is-author"><%= comment.body %></p>
|
|
<% elsif comment.user.official? %>
|
|
<p class="comment-user level-<%= comment.user.official_level %>"><%= comment.body %></p>
|
|
<% elsif comment.user.moderator? %> <!-- AND has activated CHECKBOX comment as moderator (all badges are hidden: 100% anonymous) -->
|
|
<p class="comment-user is-moderator"><%= comment.body %></p>
|
|
<% elsif comment.user.administrator? %> <!-- AND has activated CHECKBOX comment as admin (all badges are hidden: 100% anonymous) -->
|
|
<p class="comment-user is-admin"><%= comment.body %></p>
|
|
<% elsif comment.user_id == @debate.author_id %>
|
|
<p class="comment-user is-author"><%= comment.body %></p>
|
|
<% else %>
|
|
<p class="comment-user"><%= comment.body %></p>
|
|
<% end %>
|
|
<span id="<%= dom_id(comment) %>_votes" class="comment-votes right">
|
|
<%= render 'comments/votes', comment: comment %>
|
|
</span>
|
|
|
|
<p class="reply">
|
|
<%= t("debates.comment.responses", count: comment.children_count) %>
|
|
|
|
<% if user_signed_in? %>
|
|
|
|
|
<%= link_to(comment_link_text(comment), "",
|
|
class: "js-add-comment-link", data: {'id': dom_id(comment)}) %>
|
|
|
|
<% if moderator? %>
|
|
<%= render 'comments/actions', comment: comment %>
|
|
<% end %>
|
|
|
|
<%= render 'comments/form', {parent: comment, toggeable: true} %>
|
|
<% end %>
|
|
</p>
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
<div class="comment-children">
|
|
<%= render comment.children.with_hidden.reorder('id DESC, lft') %>
|
|
</div>
|
|
</div>
|
|
</div>
|