Changes moderation/comments to allow for different commentable_types
This commit is contained in:
@@ -30,6 +30,10 @@ class Comment < ActiveRecord::Base
|
||||
commentable if commentable.class == Debate
|
||||
end
|
||||
|
||||
def author_id
|
||||
user_id
|
||||
end
|
||||
|
||||
def author
|
||||
user
|
||||
end
|
||||
|
||||
@@ -5,16 +5,18 @@
|
||||
<table>
|
||||
<tr>
|
||||
<th><%= t('moderation.comments.index.flags') %></th>
|
||||
<th><%= t('moderation.comments.index.debate') %></th>
|
||||
<th><%= t('moderation.comments.index.comment') %></th>
|
||||
<th><%= t('moderation.comments.index.updated_at') %></th>
|
||||
<th><%= t('moderation.comments.index.commentable_type') %></th>
|
||||
<th><%= t('moderation.comments.index.commentable') %></th>
|
||||
<th><%= t('moderation.comments.index.comment') %></th>
|
||||
</tr>
|
||||
<% @comments.each do |comment| %>
|
||||
<tr id="comment_<%= comment.id %>">
|
||||
<td><%= comment.inappropiate_flags_count %></td>
|
||||
<td><%= link_to(comment.debate.title, comment.debate) %></td>
|
||||
<td><%= comment.body %></td>
|
||||
<td><%= l comment.updated_at.to_date %></td>
|
||||
<td><%= comment.commentable_type.constantize.model_name.human %></td>
|
||||
<td><%= link_to comment.commentable.title, comment.commentable %></td>
|
||||
<td><%= comment.body %></td>
|
||||
<td>
|
||||
<%= link_to t('moderation.comments.index.hide'), hide_in_moderation_screen_moderation_comment_path(comment), method: :put %>
|
||||
</td>
|
||||
|
||||
@@ -6,7 +6,8 @@ en:
|
||||
comments:
|
||||
index:
|
||||
title: Comments flagged as inappropiate
|
||||
debate: Debate
|
||||
commentable_type: Type
|
||||
commentable: Root
|
||||
comment: Comment
|
||||
updated_at: Date
|
||||
flags: Flags
|
||||
|
||||
@@ -6,7 +6,8 @@ es:
|
||||
comments:
|
||||
index:
|
||||
title: Comentarios Denunciados como Inapropiados
|
||||
debate: Debate
|
||||
commentable_type: Tipo
|
||||
commentable: Raíz
|
||||
comment: Comentario
|
||||
updated_at: Fecha
|
||||
flags: Denuncias
|
||||
|
||||
Reference in New Issue
Block a user