changes comment moderation to be similar to proposals moderation

This commit is contained in:
kikito
2015-09-22 14:20:37 +02:00
parent 69e74c4207
commit 343025872b
10 changed files with 249 additions and 199 deletions

View File

@@ -2,44 +2,76 @@
<%= render 'shared/filter_subnav', i18n_namespace: "moderation.comments.index" %>
<h3><%= page_entries_info @comments %></h3>
<div class="row">
<h3 class="small-8 large-8 columns"><%= page_entries_info @comments %></h3>
<div class="small-4 large-4 columns">
<div class="right">
<%= t("moderation.comments.index.order") %>
<%= render 'shared/order_selector', i18n_namespace: "moderation.comments.index" %>
</div>
</div>
</div>
<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">&nbsp;</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><%= text_with_links 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 %>
<%= form_tag moderate_moderation_comments_path(request.query_parameters), method: :put do %>
<p class="right js-check">
<%= t('shared.check') %>:
<%= link_to t('shared.check_all'), '#', data: {check_all: "comment_ids[]"} %>
|
<%= link_to t('shared.check_none'), '#', data: {check_none: "comment_ids[]"} %>
</p>
<table>
<tr>
<th>
<%= t("moderation.comments.index.headers.comment") %>
</th>
<th>
<%= t("moderation.comments.index.headers.moderate") %>
</th>
</tr>
<% end %>
</table>
<%= paginate @comments %>
<% @comments.each do |comment| %>
<tr id="comment_<%= comment.id %>">
<td>
<%= comment.commentable_type.constantize.model_name.human %> -
<%= link_to comment.commentable.title, comment.commentable %>
<br>
<span class="date"><%= l comment.updated_at.to_date %></span>
<span class="bullet">&nbsp;&bull;&nbsp;</span>
<%= comment.flags_count %><i class="icon-flag flag-disable"></i>
<span class="bullet">&nbsp;&bull;&nbsp;</span>
<%= comment.author.username %>
<br>
<p>
<%= comment.body %>
</p>
</td>
<td class="text-center">
<%= check_box_tag "comment_ids[]", comment.id, nil, id: "#{dom_id(comment)}_check" %>
</td>
</tr>
<% end %>
</table>
<%= submit_tag t('moderation.comments.index.block_authors'),
name: "block_authors",
class: "button radius alert",
data: {confirm: t('moderation.comments.index.confirm')}
%>
<div class="right">
<%= submit_tag t('moderation.comments.index.hide_comments'),
name: "hide_comments",
class: "button radius alert",
data: {confirm: t('moderation.comments.index.confirm')}
%>
<%= submit_tag t('moderation.comments.index.ignore_flags'),
name: "ignore_flags",
class: "button radius success",
data: {confirm: t('moderation.comments.index.confirm')}
%>
</div>
<%= paginate @comments %>
<% end %>