Files
grecia/app/views/admin/hidden_comments/index.html.erb
2019-09-10 20:02:15 +02:00

49 lines
1.7 KiB
Plaintext

<h2><%= t("admin.hidden_comments.index.title") %></h2>
<p><%= t("admin.shared.moderated_content") %></p>
<%= render "shared/filter_subnav", i18n_namespace: "admin.hidden_comments.index" %>
<% if @comments.any? %>
<h3 class="margin"><%= page_entries_info @comments %></h3>
<table>
<thead>
<th scope="col" class="small-8"><%= t("admin.shared.description") %></th>
<th scope="col"><%= t("admin.shared.actions") %></th>
</thead>
<tbody>
<% @comments.each do |comment| %>
<tr id="<%= dom_id(comment) %>">
<td>
<%= text_with_links comment.body %><br>
<% if comment.commentable.hidden? %>
(<%= t("admin.hidden_comments.index.hidden_#{comment.commentable_type.downcase}") %>: <%= comment.commentable.title %>)
<% else %>
<%= link_to comment.commentable.title, commentable_path(comment) %>
<% end %>
</td>
<td>
<%= link_to t("admin.actions.restore"),
restore_admin_hidden_comment_path(comment, request.query_parameters),
method: :put,
data: { confirm: t("admin.actions.confirm") },
class: "button hollow warning" %>
<% unless comment.confirmed_hide? %>
<%= link_to t("admin.actions.confirm_hide"),
confirm_hide_admin_hidden_comment_path(comment, request.query_parameters),
method: :put,
class: "button" %>
<% end %>
</td>
</tr>
<% end %>
</tbody>
</table>
<%= paginate @comments %>
<% else %>
<div class="callout primary margin">
<%= t("admin.hidden_comments.index.no_hidden_comments") %>
</div>
<% end %>