Files
grecia/app/views/moderation/comments/index.html.erb

57 lines
2.1 KiB
Plaintext

<h2><%= t("moderation.comments.index.title") %></h2>
<dl class="sub-nav">
<dt><%= t("moderation.comments.index.filter") %>:</dt>
<% @valid_filters.each do |filter| %>
<% if @current_filter == filter %>
<dd class="active"><%= t("moderation.comments.index.filters.#{filter}") %></dd>
<% else %>
<dd><%= link_to t("moderation.comments.index.filters.#{filter}"),
current_path_with_query_params(filter: filter) %></dd>
<% end %>
<% end %>
</dl>
<h3><%= page_entries_info @comments %></h3>
<table>
<tr>
<th>
<%= t("moderation.comments.index.headers.commentable") %>&nbsp;|&nbsp;
<%= t("moderation.comments.index.headers.commentable_type") %>&nbsp;|&nbsp;
<%= t("moderation.comments.index.headers.updated_at") %>
</th>
<th><%= t("moderation.comments.index.headers.comment") %></th>
<th class="text-center"><%= t("moderation.comments.index.headers.flags") %></th>
<th class="text-center" colspan="2"><%= t("moderation.debates.index.headers.actions") %></th>
</tr>
<% @comments.each do |comment| %>
<tr id="comment_<%= comment.id %>">
<td>
<%= link_to comment.commentable.title, comment.commentable %>
<br>
<%= comment.commentable_type.constantize.model_name.human %>
<span class="date"><%= l comment.updated_at.to_date %></span>
</td>
<td><%= comment.body %></td>
<td class="text-center"><%= comment.flags_count %></td>
<td>
<%= link_to t("moderation.comments.index.hide"), hide_in_moderation_screen_moderation_comment_path(comment, request.query_parameters), method: :put, class: "delete" %>
</td>
<% if can? :ignore_flag, comment %>
<td>
<%= link_to t("moderation.comments.index.ignore_flag"), ignore_flag_moderation_comment_path(comment, request.query_parameters), method: :put, class: "button radius tiny warning" %>
</td>
<% end %>
<% if comment.ignored_flag? %>
<td class="ignored">
<%= t("moderation.comments.index.ignored_flag") %>
</td>
<% end %>
</tr>
<% end %>
</table>
<%= paginate @comments %>