Adds styles to moderation admin

This commit is contained in:
Alberto Garcia Cabeza
2015-08-25 15:19:34 +02:00
parent 9202a4f8e4
commit 8037a82fef
11 changed files with 99 additions and 75 deletions

View File

@@ -151,11 +151,16 @@ body.admin {
.verified {
color: $check;
a {
border-bottom: 1px dotted $check;
color: $check;
font-size: rem-calc(12);
}
}
.verified a {
border-bottom: 1px dotted $check;
color: $check;
.archived {
color: $text-medium;
font-size: rem-calc(12);
}
@@ -163,6 +168,12 @@ body.admin {
color: $delete;
}
.date {
color: $text-medium;
font-size: rem-calc(12);
font-style: italic;
}
.level {
font-size: rem-calc(12);
}

View File

@@ -135,6 +135,7 @@ h1, h2, h3, h4, h5, h6 {
}
.sub-nav dt, .sub-nav dd, .sub-nav li {
padding: rem-calc(3) 0;
&.active {
background: #008CBA;
@@ -142,7 +143,7 @@ h1, h2, h3, h4, h5, h6 {
color: white;
cursor: default;
font-weight: normal;
padding: 0.16667rem 0.88889rem;
padding: rem-calc(3) rem-calc(14);
a:hover {
color: #737373;

View File

@@ -31,7 +31,7 @@ class Moderation::CommentsController < Moderation::BaseController
end
def set_valid_filters
@valid_filters = %w{all pending_review reviewed}
@valid_filters = %w{all pending_review archived}
end
def parse_filter

View File

@@ -31,7 +31,7 @@ class Moderation::DebatesController < Moderation::BaseController
end
def set_valid_filters
@valid_filters = %w{all pending_review reviewed}
@valid_filters = %w{all pending_review archived}
end
def parse_filter

View File

@@ -19,7 +19,7 @@ class Comment < ActiveRecord::Base
scope :sorted_for_moderation, -> { order(inappropiate_flags_count: :desc, updated_at: :desc) }
scope :pending_review, -> { where(reviewed_at: nil, hidden_at: nil) }
scope :reviewed, -> { where("reviewed_at IS NOT NULL AND hidden_at IS NULL") }
scope :archived, -> { where("reviewed_at IS NOT NULL AND hidden_at IS NULL") }
scope :flagged_as_inappropiate, -> { where("inappropiate_flags_count > 0") }
def self.build(commentable, user, body)

View File

@@ -25,7 +25,7 @@ class Debate < ActiveRecord::Base
scope :sorted_for_moderation, -> { order(inappropiate_flags_count: :desc, updated_at: :desc) }
scope :pending_review, -> { where(reviewed_at: nil, hidden_at: nil) }
scope :reviewed, -> { where("reviewed_at IS NOT NULL AND hidden_at IS NULL") }
scope :archived, -> { where("reviewed_at IS NOT NULL AND hidden_at IS NULL") }
scope :flagged_as_inappropiate, -> { where("inappropiate_flags_count > 0") }
# Ahoy setup

View File

@@ -4,17 +4,17 @@
<%= t("moderation.dashboard.index.title") %>
</li>
<li <%= 'class=active' if controller_name == 'debates' %>>
<li <%= "class=active" if controller_name == "debates" %>>
<%= link_to moderation_debates_path do %>
<i class="icon-eye"></i>
<%= t('moderation.menu.flagged_debates') %>
<i class="icon-debates"></i>
<%= t("moderation.menu.flagged_debates") %>
<% end %>
</li>
<li <%= 'class=active' if controller_name == 'comments' %>>
<li <%= "class=active" if controller_name == "comments" %>>
<%= link_to moderation_comments_path do %>
<i class="icon-comment-quotes"></i>
<%= t('moderation.menu.flagged_comments') %>
<i class="icon-comments"></i>
<%= t("moderation.menu.flagged_comments") %>
<% end %>
</li>
</ul>

View File

@@ -1,45 +1,52 @@
<h2><%= t('moderation.comments.index.title') %></h2>
<h2><%= t("moderation.comments.index.title") %></h2>
<dl class="sub-nav">
<dt><%= t("moderation.comments.index.filter") %>:</dt>
<p>
<%= t('moderation.comments.index.filter') %>:
<% @valid_filters.each do |filter| %>
<% if @filter == filter %>
<%= t("moderation.comments.index.filters.#{filter}") %>
<dd class="active"><%= t("moderation.comments.index.filters.#{filter}") %></dd>
<% else %>
<%= link_to t("moderation.comments.index.filters.#{filter}"),
moderation_comments_path(filter: filter) %>
<dd><%= link_to t("moderation.comments.index.filters.#{filter}"),
moderation_comments_path(filter: filter) %></dd>
<% end %>
<% end %>
</p>
</dl>
<h3><%= page_entries_info @comments %></h3>
<table>
<tr>
<th><%= t('moderation.comments.index.headers.flags') %></th>
<th><%= t('moderation.comments.index.headers.updated_at') %></th>
<th><%= t('moderation.comments.index.headers.commentable_type') %></th>
<th><%= t('moderation.comments.index.headers.commentable') %></th>
<th><%= t('moderation.comments.index.headers.comment') %></th>
<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><%= comment.inappropiate_flags_count %></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, request.query_parameters), method: :put %>
<%= 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.inappropiate_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? :mark_as_reviewed, comment %>
<td>
<%= link_to t('moderation.comments.index.mark_as_reviewed'), mark_as_reviewed_moderation_comment_path(comment, request.query_parameters), method: :put %>
<%= link_to t("moderation.comments.index.archive"), mark_as_reviewed_moderation_comment_path(comment, request.query_parameters), method: :put, class: "button radius tiny warning" %>
</td>
<% end %>
<% if comment.reviewed? %>
<td>
<%= t('moderation.comments.index.reviewed') %>
<td class="archived">
<%= t("moderation.comments.index.archived") %>
</td>
<% end %>
</tr>
@@ -47,4 +54,3 @@
</table>
<%= paginate @comments %>

View File

@@ -1,43 +1,51 @@
<h2><%= t('moderation.debates.index.title') %></h2>
<h2><%= t("moderation.debates.index.title") %></h2>
<dl class="sub-nav">
<dt><%= t("moderation.debates.index.filter") %>:</dt>
<p>
<%= t('moderation.debates.index.filter') %>:
<% @valid_filters.each do |filter| %>
<% if @filter == filter %>
<%= t("moderation.debates.index.filters.#{filter}") %>
<dd class="active"><%= t("moderation.debates.index.filters.#{filter}") %></dd>
<% else %>
<%= link_to t("moderation.debates.index.filters.#{filter}"),
moderation_debates_path(filter: filter) %>
<dd><%= link_to t("moderation.debates.index.filters.#{filter}"),
moderation_debates_path(filter: filter) %></dd>
<% end %>
<% end %>
</p>
</dl>
<h3><%= page_entries_info @debates %></h3>
<table>
<tr>
<th><%= t('moderation.debates.index.headers.flags') %></th>
<th><%= t('moderation.debates.index.headers.updated_at') %></th>
<th><%= t('moderation.debates.index.headers.title') %></th>
<th><%= t('moderation.debates.index.headers.description') %></th>
<th>
<%= t("moderation.debates.index.headers.title") %>&nbsp;|&nbsp;
<%= t("moderation.debates.index.headers.updated_at") %>&nbsp;|&nbsp;
<%= t("moderation.debates.index.headers.description") %>
</th>
<th class="text-center"><%= t("moderation.debates.index.headers.flags") %></th>
<th class="text-center" colspan="2"><%= t("moderation.debates.index.headers.actions") %></th>
</tr>
<% @debates.each do |debate| %>
<tr id="debate_<%= debate.id %>">
<td><%= debate.inappropiate_flags_count %></td>
<td><%= l debate.updated_at.to_date %></td>
<td><%= link_to debate.title, debate %></td>
<td><%= debate.description %></td>
<td>
<%= link_to t('moderation.debates.index.hide'), hide_in_moderation_screen_moderation_debate_path(debate, request.query_parameters), method: :put %>
<%= link_to debate.title, debate, target: "_blank" %>
<br>
<span class="date"><%= l debate.updated_at.to_date %></span>
<br>
<%= debate.description %>
</td>
<td class="text-center"><%= debate.inappropiate_flags_count %></td>
<td>
<%= link_to t("moderation.debates.index.hide"), hide_in_moderation_screen_moderation_debate_path(debate, request.query_parameters), method: :put, class: "delete" %>
</td>
<% if can? :mark_as_reviewed, debate %>
<td>
<%= link_to t('moderation.debates.index.mark_as_reviewed'), mark_as_reviewed_moderation_debate_path(debate, request.query_parameters), method: :put %>
<%= link_to t("moderation.debates.index.archive"), mark_as_reviewed_moderation_debate_path(debate, request.query_parameters), method: :put, class: "button radius tiny warning" %>
</td>
<% end %>
<% if debate.reviewed? %>
<td>
<%= t('moderation.debates.index.reviewed') %>
<td class="archived">
<%= t("moderation.debates.index.archived") %>
</td>
<% end %>
</tr>
@@ -45,4 +53,3 @@
</table>
<%= paginate @debates %>

View File

@@ -8,7 +8,7 @@ en:
title: Moderation
comments:
index:
title: Comments flagged as inappropiate
title: Comments flagged as inappropriate
headers:
flags: Flags
updated_at: Date
@@ -16,27 +16,27 @@ en:
commentable: Root
comment: Comment
hide: Hide
mark_as_reviewed: Mark as reviewed
reviewed: Reviewed
archive: Archive
archived: Archived
filter: Filter
filters:
all: All
pending_review: Pending
reviewed: Reviewed
archived: Archived
debates:
index:
title: Debates flagged as inappropiate
title: Debates flagged as inappropriate
headers:
flags: Flags
updated_at: Date
title: Title
description: Description
actions: Actions
hide: Hide
mark_as_reviewed: Mark as reviewed
reviewed: Reviewed
archive: Archive
archived: Archived
filter: Filter
filters:
all: All
pending_review: Pending
reviewed: Reviewed
archived: Archived

View File

@@ -8,7 +8,7 @@ es:
title: Moderación
comments:
index:
title: Comentarios Denunciados como Inapropiados
title: Comentarios denunciados como inapropiados
headers:
flags: Denuncias
updated_at: Fecha
@@ -16,28 +16,27 @@ es:
commentable: Raíz
comment: Comentario
hide: Ocultar
mark_as_reviewed: Marcar como revisado
reviewed: Revisado
archive: Archivar
archived: Archivado
filter: Filtrar
filters:
all: Todos
pending_review: Pendientes
reviewed: Revisados
archived: Archivados
debates:
index:
title: Debates Denunciados como Inapropiados
title: Debates denunciados como inapropiados
headers:
flags: Denuncias
updated_at: Fecha
title: Título
description: Descripción
actions: Acciones
hide: Ocultar
mark_as_reviewed: Marcar como revisado
reviewed: Revisado
archive: Archivar
archived: Archivado
filter: Filtrar
filters:
all: Todos
pending_review: Pendientes
reviewed: Revisados
archived: Archivados