78 lines
2.6 KiB
Plaintext
78 lines
2.6 KiB
Plaintext
<div class="row">
|
|
<div id="<%= dom_id(comment) %>" class="comment small-12 column">
|
|
|
|
<% if comment.hidden? %>
|
|
<%= t("debates.comment.deleted") %>
|
|
<% else %>
|
|
|
|
<%= avatar_image(comment.user, size: 32, class: 'left') %>
|
|
<!-- if user deleted -->
|
|
<i class="icon-deleted user-deleted"></i>
|
|
<!-- end -->
|
|
|
|
<div class="comment-body">
|
|
<div class="comment-info">
|
|
|
|
<!-- if user deleted -->
|
|
<span class="user-name"><%= t("debates.comment.user_deleted") %></span>
|
|
<!-- else -->
|
|
<span class="user-name"><%= comment.user.name %></span>
|
|
<!-- end -->
|
|
• <%= time_ago_in_words(comment.created_at) %>
|
|
<% if comment.user.official? %>
|
|
•
|
|
<span class="label round level-<%= comment.user.official_level %>">
|
|
<%= comment.user.official_position %>
|
|
</span>
|
|
<% end %>
|
|
<% if comment.user.verified_organization? %>
|
|
•
|
|
<span class="label round is-association">
|
|
<%= t("shared.organization") %>
|
|
</span>
|
|
<% end %>
|
|
<% if comment.user == @debate.author %>
|
|
•
|
|
<span class="label round is-author">
|
|
<%= t("debates.comment.author") %>
|
|
</span>
|
|
<% end %>
|
|
</div>
|
|
|
|
<% if comment.user.official? %>
|
|
<p class="comment-user level-<%= comment.user.official_level %>"><%= comment.body %></p>
|
|
<% elsif comment.user == @debate.author %>
|
|
<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_deleted.reorder('id DESC, lft') %>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|