improves layout and unifies design of admin moderated content

This commit is contained in:
decabeza
2017-10-13 20:57:19 +02:00
parent ae74e1ba07
commit d91388b2b3
6 changed files with 182 additions and 116 deletions

View File

@@ -2,9 +2,15 @@
<%= render 'shared/filter_subnav', i18n_namespace: "admin.comments.index" %> <%= render 'shared/filter_subnav', i18n_namespace: "admin.comments.index" %>
<h3><%= page_entries_info @comments %></h3> <% if @comments.any? %>
<h3 class="margin"><%= page_entries_info @comments %></h3>
<table> <table>
<thead>
<th scope="col" class="small-9"><%= t("admin.shared.description") %></th>
<th scope="col"><%= t("admin.shared.actions") %></th>
</thead>
<tbody>
<% @comments.each do |comment| %> <% @comments.each do |comment| %>
<tr id="<%= dom_id(comment) %>"> <tr id="<%= dom_id(comment) %>">
<td> <td>
@@ -15,21 +21,27 @@
<%= link_to comment.commentable.title, comment.commentable %> <%= link_to comment.commentable.title, comment.commentable %>
<% end %> <% end %>
</td> </td>
<td class="text-right"> <td>
<%= link_to t("admin.actions.restore"), <%= link_to t("admin.actions.restore"),
restore_admin_comment_path(comment, request.query_parameters), restore_admin_comment_path(comment, request.query_parameters),
method: :put, method: :put,
data: { confirm: t("admin.actions.confirm") }, data: { confirm: t("admin.actions.confirm") },
class: "button hollow on-hover-block" %> class: "button hollow warning" %>
<% unless comment.confirmed_hide? %> <% unless comment.confirmed_hide? %>
<%= link_to t("admin.actions.confirm_hide"), <%= link_to t("admin.actions.confirm_hide"),
confirm_hide_admin_comment_path(comment, request.query_parameters), confirm_hide_admin_comment_path(comment, request.query_parameters),
method: :put, method: :put,
class: "button hollow warning on-hover-block" %> class: "button" %>
<% end %> <% end %>
</td> </td>
</tr> </tr>
<% end %> <% end %>
</tbody>
</table> </table>
<%= paginate @comments %> <%= paginate @comments %>
<% else %>
<div class="callout primary margin">
<%= t("admin.comments.index.no_hidden_comments") %>
</div>
<% end %>

View File

@@ -2,33 +2,47 @@
<%= render 'shared/filter_subnav', i18n_namespace: "admin.debates.index" %> <%= render 'shared/filter_subnav', i18n_namespace: "admin.debates.index" %>
<h3><%= page_entries_info @debates %></h3> <% if @debates.any? %>
<h3 class="margin"><%= page_entries_info @debates %></h3>
<table> <table>
<thead>
<th scope="col"><%= t("admin.shared.title") %></th>
<th scope="col" class="small-6"><%= t("admin.shared.description") %></th>
<th scope="col" class="small-3"><%= t("admin.shared.actions") %></th>
</thead>
<tbody>
<% @debates.each do |debate| %> <% @debates.each do |debate| %>
<tr id="<%= dom_id(debate) %>"> <tr id="<%= dom_id(debate) %>">
<td> <td class="align-top">
<strong><%= debate.title %></strong> <strong><%= debate.title %></strong>
<br> </td>
<td>
<div class="moderation-description"> <div class="moderation-description">
<%= debate.description %> <%= debate.description %>
</div> </div>
</td> </td>
<td class="text-right"> <td class="align-top">
<%= link_to t("admin.actions.restore"), <%= link_to t("admin.actions.restore"),
restore_admin_debate_path(debate, request.query_parameters), restore_admin_debate_path(debate, request.query_parameters),
method: :put, method: :put,
data: { confirm: t("admin.actions.confirm") }, data: { confirm: t("admin.actions.confirm") },
class: "button hollow on-hover" %> class: "button hollow warning" %>
<% unless debate.confirmed_hide? %> <% unless debate.confirmed_hide? %>
<%= link_to t("admin.actions.confirm_hide"), <%= link_to t("admin.actions.confirm_hide"),
confirm_hide_admin_debate_path(debate, request.query_parameters), confirm_hide_admin_debate_path(debate, request.query_parameters),
method: :put, method: :put,
class: "button hollow warning on-hover" %> class: "button" %>
<% end %> <% end %>
</td> </td>
</tr> </tr>
<% end %> <% end %>
</tbody>
</table> </table>
<%= paginate @debates %> <%= paginate @debates %>
<% else %>
<div class="callout primary margin">
<%= t("admin.debates.index.no_hidden_debates") %>
</div>
<% end %>

View File

@@ -2,32 +2,42 @@
<%= render 'shared/filter_subnav', i18n_namespace: "admin.hidden_users.index" %> <%= render 'shared/filter_subnav', i18n_namespace: "admin.hidden_users.index" %>
<h3><%= page_entries_info @users %></h3> <% if @users.any? %>
<h3 class="margin"><%= page_entries_info @users %></h3>
<table> <table>
<thead>
<th scope="col" class="small-9"><%= t("admin.hidden_users.index.user") %></th>
<th scope="col"><%= t("admin.shared.actions") %></th>
</thead>
<tbody>
<% @users.each do |user| %> <% @users.each do |user| %>
<tr id="<%= dom_id(user) %>"> <tr id="<%= dom_id(user) %>">
<td> <td>
<p><%= link_to user.name, admin_hidden_user_path(user) %></p> <p><%= link_to user.name, admin_hidden_user_path(user) %></p>
</td> </td>
<td class="text-right"> <td>
<%= link_to t("admin.actions.restore"), <%= link_to t("admin.actions.restore"),
restore_admin_hidden_user_path(user, request.query_parameters), restore_admin_hidden_user_path(user, request.query_parameters),
method: :put, method: :put,
data: { confirm: t("admin.actions.confirm") }, data: { confirm: t("admin.actions.confirm") },
class: "button hollow on-hover" %> class: "button hollow warning" %>
<% unless user.confirmed_hide? %> <% unless user.confirmed_hide? %>
<%= link_to t("admin.actions.confirm_hide"), <%= link_to t("admin.actions.confirm_hide"),
confirm_hide_admin_hidden_user_path(user, request.query_parameters), confirm_hide_admin_hidden_user_path(user, request.query_parameters),
method: :put, method: :put,
class: "button hollow warning on-hover" %> class: "button" %>
<% end %> <% end %>
</td> </td>
</tr> </tr>
<% end %> <% end %>
</tbody>
</table> </table>
<%= paginate @users %> <%= paginate @users %>
<% else %>
<div class="callout primary margin">
<%= t("admin.hidden_users.index.no_hidden_users") %>
</div>
<% end %>

View File

@@ -2,16 +2,24 @@
<%= render 'shared/filter_subnav', i18n_namespace: "admin.proposals.index" %> <%= render 'shared/filter_subnav', i18n_namespace: "admin.proposals.index" %>
<h3><%= page_entries_info @proposals %></h3> <% if @proposals.any? %>
<h3 class="margin"><%= page_entries_info @proposals %></h3>
<table> <table>
<thead>
<th scope="col"><%= t("admin.shared.title") %></th>
<th scope="col" class="small-6"><%= t("admin.shared.description") %></th>
<th scope="col" class="small-3"><%= t("admin.shared.actions") %></th>
</thead>
<tbody>
<% @proposals.each do |proposal| %> <% @proposals.each do |proposal| %>
<tr id="<%= dom_id(proposal) %>"> <tr id="<%= dom_id(proposal) %>">
<td> <td class="align-top">
<strong><%= proposal.title %></strong> <strong><%= proposal.title %></strong>
<br> </td>
<td>
<div class="moderation-description"> <div class="moderation-description">
<p><%= proposal.summary %></p> <p><small><%= proposal.summary %></small></p>
<%= proposal.description %> <%= proposal.description %>
<% if proposal.external_url.present? %> <% if proposal.external_url.present? %>
<p><%= text_with_links proposal.external_url %></p> <p><%= text_with_links proposal.external_url %></p>
@@ -22,21 +30,27 @@
<p><%= proposal.question %></p> <p><%= proposal.question %></p>
</div> </div>
</td> </td>
<td class="text-right"> <td class="align-top">
<%= link_to t("admin.actions.restore"), <%= link_to t("admin.actions.restore"),
restore_admin_proposal_path(proposal, request.query_parameters), restore_admin_proposal_path(proposal, request.query_parameters),
method: :put, method: :put,
data: { confirm: t("admin.actions.confirm") }, data: { confirm: t("admin.actions.confirm") },
class: "button hollow on-hover-block" %> class: "button hollow warning" %>
<% unless proposal.confirmed_hide? %> <% unless proposal.confirmed_hide? %>
<%= link_to t("admin.actions.confirm_hide"), <%= link_to t("admin.actions.confirm_hide"),
confirm_hide_admin_proposal_path(proposal, request.query_parameters), confirm_hide_admin_proposal_path(proposal, request.query_parameters),
method: :put, method: :put,
class: "button hollow warning on-hover-block" %> class: "button" %>
<% end %> <% end %>
</td> </td>
</tr> </tr>
<% end %> <% end %>
</tbody>
</table> </table>
<%= paginate @proposals %> <%= paginate @proposals %>
<% else %>
<div class="callout primary margin">
<%= t("admin.proposals.index.no_hidden_proposals") %>
</div>
<% end %>

View File

@@ -213,6 +213,7 @@ en:
hidden_debate: Hidden debate hidden_debate: Hidden debate
hidden_proposal: Hidden proposal hidden_proposal: Hidden proposal
title: Hidden comments title: Hidden comments
no_hidden_comments: There is no hidden comments.
dashboard: dashboard:
index: index:
back: Go back to %{org} back: Go back to %{org}
@@ -226,6 +227,7 @@ en:
with_confirmed_hide: Confirmed with_confirmed_hide: Confirmed
without_confirmed_hide: Pending without_confirmed_hide: Pending
title: Hidden debates title: Hidden debates
no_hidden_debates: There is no hidden debates.
hidden_users: hidden_users:
index: index:
filter: Filter filter: Filter
@@ -234,6 +236,8 @@ en:
with_confirmed_hide: Confirmed with_confirmed_hide: Confirmed
without_confirmed_hide: Pending without_confirmed_hide: Pending
title: Hidden users title: Hidden users
user: User
no_hidden_users: There is no hidden users.
show: show:
email: 'Email:' email: 'Email:'
hidden_at: 'Hidden at:' hidden_at: 'Hidden at:'
@@ -715,6 +719,7 @@ en:
with_confirmed_hide: Confirmed with_confirmed_hide: Confirmed
without_confirmed_hide: Pending without_confirmed_hide: Pending
title: Hidden proposals title: Hidden proposals
no_hidden_proposals: There is no hidden proposals.
settings: settings:
flash: flash:
updated: Value updated updated: Value updated
@@ -757,6 +762,9 @@ en:
placeholder: Search user by name or email placeholder: Search user by name or email
search_results: "Search results" search_results: "Search results"
no_search_results: "No results found." no_search_results: "No results found."
actions: Actions
title: Title
description: Description
spending_proposals: spending_proposals:
index: index:
geozone_filter_all: All zones geozone_filter_all: All zones

View File

@@ -213,6 +213,7 @@ es:
hidden_debate: Debate oculto hidden_debate: Debate oculto
hidden_proposal: Propuesta oculta hidden_proposal: Propuesta oculta
title: Comentarios ocultos title: Comentarios ocultos
no_hidden_comments: No hay comentarios ocultos.
dashboard: dashboard:
index: index:
back: Volver a %{org} back: Volver a %{org}
@@ -226,6 +227,7 @@ es:
with_confirmed_hide: Confirmados with_confirmed_hide: Confirmados
without_confirmed_hide: Pendientes without_confirmed_hide: Pendientes
title: Debates ocultos title: Debates ocultos
no_hidden_debates: No hay debates ocultos.
hidden_users: hidden_users:
index: index:
filter: Filtro filter: Filtro
@@ -234,6 +236,8 @@ es:
with_confirmed_hide: Confirmados with_confirmed_hide: Confirmados
without_confirmed_hide: Pendientes without_confirmed_hide: Pendientes
title: Usuarios bloqueados title: Usuarios bloqueados
user: Usuario
no_hidden_users: No hay uusarios bloqueados.
show: show:
email: 'Email:' email: 'Email:'
hidden_at: 'Bloqueado:' hidden_at: 'Bloqueado:'
@@ -717,6 +721,7 @@ es:
with_confirmed_hide: Confirmadas with_confirmed_hide: Confirmadas
without_confirmed_hide: Pendientes without_confirmed_hide: Pendientes
title: Propuestas ocultas title: Propuestas ocultas
no_hidden_proposals: No hay propuestas ocultas.
settings: settings:
flash: flash:
updated: Valor actualizado updated: Valor actualizado
@@ -759,6 +764,9 @@ es:
placeholder: Buscar usuario por nombre o email placeholder: Buscar usuario por nombre o email
search_results: "Resultados de la búsqueda" search_results: "Resultados de la búsqueda"
no_search_results: "No se han encontrado resultados." no_search_results: "No se han encontrado resultados."
actions: Acciones
title: "Título"
description: "Descripción"
spending_proposals: spending_proposals:
index: index:
geozone_filter_all: Todos los ámbitos de actuación geozone_filter_all: Todos los ámbitos de actuación