Improves all pages for admin section

This commit is contained in:
Alberto Garcia Cabeza
2016-06-01 13:23:57 +02:00
parent 00fd9da0f9
commit fb6dbdf2f9
31 changed files with 529 additions and 387 deletions

View File

@@ -8,7 +8,7 @@
<tr>
<th><%= t("admin.activity.show.type") %></th>
<th><%= t("admin.activity.show.action") %></th>
<th> </th>
<th class="text-left"><%= t("admin.activity.show.content") %></th>
<th><%= t("admin.activity.show.by") %></th>
</tr>
<% @activity.each do |activity| %>

View File

@@ -3,38 +3,18 @@
<%= render 'errors' %>
<div class="row">
<div class="small-3 column">
<div class="small-12 medium-6 large-3 column">
<%= f.label :style, t("admin.banners.banner.style") %>
<%= f.select :style, options_for_select(@banner_styles, @banner.style),:include_blank => '-',
label: false,placeholder: t("admin.banners.banner.style") %>
</div>
<div class="small-3 column">
<div class="small-12 medium-6 large-3 column">
<%= f.label :image, t("admin.banners.banner.image") %>
<%= f.select :image, options_for_select(@banner_imgs, @banner.image),:include_blank => '-',
label: false, placeholder: t("admin.banners.banner.image") %>
</div>
<div class="small-12 column">
<%= f.label :title, t("admin.banners.banner.title") %>
<%= f.text_field :title, placeholder: t("admin.banners.banner.title"), label: false,
data: {js_banner_title: "js_banner_title"} %>
</div>
<div class="small-12 column">
<%= f.label :description, t("admin.banners.banner.description") %>
<%= f.text_field :description,
label: false,
data: {js_banner_description: "js_banner_description"},
placeholder: t("admin.banners.banner.description") %>
</div>
<div class="small-12 column">
<%= f.label :target_url, t("admin.banners.banner.target_url") %>
<%= f.text_field :target_url,
label: false,
placeholder: t("admin.banners.banner.target_url") %>
</div>
<% date_started_at = @banner.post_started_at.present? ? I18n.localize(@banner.post_started_at) : "" %>
<div class="small-3 column">
<div class="small-12 medium-6 large-3 column">
<%= f.label :post_started_at, t("admin.banners.banner.post_started_at") %>
<%= f.text_field :post_started_at,
label: false,
@@ -44,7 +24,7 @@
id: "post_started_at" %>
</div>
<% date_ended_at = @banner.post_ended_at.present? ? I18n.localize(@banner.post_ended_at) : ""%>
<div class="small-3 column">
<div class="small-12 medium-6 large-3 column">
<%= f.label :post_ended_at, t("admin.banners.banner.post_ended_at") %>
<%= f.text_field :post_ended_at,
label: false,
@@ -53,9 +33,36 @@
class: "js-calendar-full",
id: "post_ended_at" %>
</div>
</div>
<div class="actions small-12 column">
<%= f.submit(class: "button", value: t("admin.banners.edit.form.submit_button")) %>
<div class="row">
<div class="small-12 medium-6 column">
<%= f.label :title, t("admin.banners.banner.title") %>
<%= f.text_field :title, placeholder: t("admin.banners.banner.title"), label: false,
data: {js_banner_title: "js_banner_title"} %>
</div>
<div class="small-12 medium-6 column">
<%= f.label :target_url, t("admin.banners.banner.target_url") %>
<%= f.text_field :target_url,
label: false,
placeholder: t("admin.banners.banner.target_url") %>
</div>
</div>
<div class="row">
<div class="small-12 column">
<%= f.label :description, t("admin.banners.banner.description") %>
<%= f.text_field :description,
label: false,
data: {js_banner_description: "js_banner_description"},
placeholder: t("admin.banners.banner.description") %>
</div>
</div>
<div class="row">
<div class="actions small-12 medium-3 column">
<%= f.submit(class: "button expanded", value: t("admin.banners.edit.form.submit_button")) %>
</div>
</div>
<div id="js-banner-style" class="<%= @banner.style %>">

View File

@@ -1,5 +1,5 @@
<%= link_to t("admin.banners.index.create"),
new_admin_banner_path, class: "button large success float-right" %>
new_admin_banner_path, class: "button success float-right" %>
<h2 class="inline-block"><%= t("admin.banners.index.title") %></h2>
@@ -11,6 +11,12 @@
<% @banners.each do |banner| %>
<tr id="<%= dom_id(banner) %>">
<td class="small-12 medium-9">
<small>
<%= t("admin.banners.banner.post_started_at")%> <strong><%= banner.post_started_at %></strong>
&nbsp;|&nbsp;
<%= t("admin.banners.banner.post_ended_at")%> <strong><%= banner.post_ended_at%></strong>
</small>
<div class="<%= banner.style %>">
<div class="<%= banner.image %>">
<%= link_to banner.target_url do %>
@@ -19,24 +25,15 @@
<% end %>
</div>
</div>
<%= t("admin.banners.banner.post_started_at")%> <strong><%= banner.post_started_at %></strong>
&nbsp;|&nbsp;
<%= t("admin.banners.banner.post_ended_at")%> <strong><%= banner.post_ended_at%></strong>
</td>
<td class="text-center">
<%= link_to edit_admin_banner_path(banner),
class: 'edit-banner button' do %>
<span class="icon-edit"></span>
<%= t("admin.banners.index.edit") %>
<% end %>
</td>
<td>
<%= link_to admin_banner_path(banner), method: :delete,
class: 'delete' do %>
<span class="icon-delete"></span>
<%= t("admin.banners.index.delete") %>
<% end %>
<td class="text-right">
<%= link_to t("admin.banners.index.edit"), edit_admin_banner_path(banner),
class: 'edit-banner button hollow' %>
<%= link_to t("admin.banners.index.delete"), admin_banner_path(banner),
method: :delete,
class: 'button hollow alert' %>
</td>
</tr>
<% end %>

View File

@@ -4,34 +4,32 @@
<h3><%= page_entries_info @comments %></h3>
<ul class="admin-list">
<table>
<% @comments.each do |comment| %>
<li id="<%= dom_id(comment) %>">
<div class="row">
<div class="small-12 medium-8 column">
<%= text_with_links comment.body %><br>
<% if comment.commentable.hidden? %>
(<%= t("admin.comments.index.hidden_#{comment.commentable_type.downcase}") %>: <%= comment.commentable.title %>)
<% else %>
<%= link_to comment.commentable.title, comment.commentable %>
<% end %>
</div>
<div class="small-6 medium-4 column text-right">
<%= link_to t("admin.actions.restore"),
restore_admin_comment_path(comment, request.query_parameters),
<tr id="<%= dom_id(comment) %>">
<td>
<%= text_with_links comment.body %><br>
<% if comment.commentable.hidden? %>
(<%= t("admin.comments.index.hidden_#{comment.commentable_type.downcase}") %>: <%= comment.commentable.title %>)
<% else %>
<%= link_to comment.commentable.title, comment.commentable %>
<% end %>
</td>
<td class="text-right">
<%= link_to t("admin.actions.restore"),
restore_admin_comment_path(comment, request.query_parameters),
method: :put,
data: { confirm: t("admin.actions.confirm") },
class: "button hollow on-hover" %>
<% unless comment.confirmed_hide? %>
<%= link_to t("admin.actions.confirm_hide"),
confirm_hide_admin_comment_path(comment, request.query_parameters),
method: :put,
data: { confirm: t("admin.actions.confirm") },
class: "button small success float-right" %>
<% unless comment.confirmed_hide? %>
<%= link_to t("admin.actions.confirm_hide"),
confirm_hide_admin_comment_path(comment, request.query_parameters),
method: :put,
class: "button small warning float-right" %>
<% end %>
</div>
</div>
</li>
class: "button hollow warning on-hover" %>
<% end %>
</td>
</tr>
<% end %>
</ul>
</table>
<%= paginate @comments %>

View File

@@ -14,19 +14,17 @@
<%= debate.description %>
</div>
</td>
<td>
<td class="text-right">
<%= link_to t("admin.actions.restore"),
restore_admin_debate_path(debate, request.query_parameters),
method: :put,
data: { confirm: t("admin.actions.confirm") },
class: "button small success no-margin" %>
</td>
<td>
class: "button hollow on-hover" %>
<% unless debate.confirmed_hide? %>
<%= link_to t("admin.actions.confirm_hide"),
confirm_hide_admin_debate_path(debate, request.query_parameters),
method: :put,
class: "button small warning float-right" %>
class: "button hollow warning on-hover" %>
<% end %>
</td>
</tr>

View File

@@ -1,13 +1,24 @@
<span><%= manager.name %></span>
<span class="bullet">&nbsp;&bull;&nbsp;</span>
<span><%= manager.email %></span>
<% if manager.persisted? %>
<%= link_to t('admin.managers.manager.delete'),
admin_manager_path(manager),
method: :delete,
class: "button small alert float-right"
%>
<% else %>
<%= link_to t('admin.managers.manager.add'),{ controller: "admin/managers", action: :create, user_id: manager.user_id },
method: :post, class: "button small success float-right" %>
<% end %>
<div class="small-12 column">
<table>
<tr>
<td>
<%= manager.name %>
</td>
<td>
<%= manager.email %>
</td>
<td class="text-right">
<% if manager.persisted? %>
<%= link_to t('admin.managers.manager.delete'),
admin_manager_path(manager),
method: :delete,
class: "button hollow alert"
%>
<% else %>
<%= link_to t('admin.managers.manager.add'),{ controller: "admin/managers", action: :create, user_id: manager.user_id },
method: :post, class: "button success" %>
<% end %>
</td>
</tr>
</table>
</div>

View File

@@ -1,24 +1,43 @@
<h2><%= t("admin.managers.index.title") %></h2>
<div class="row">
<div class="column">
<%= form_tag search_admin_managers_path, method: :get, remote: true do %>
<div class="small-12 medium-6 column">
<%= text_field_tag :email, '', placeholder: t('admin.managers.search.email_placeholder') %>
</div>
<div class="small-12 medium-6 column">
<%= submit_tag t('admin.managers.search.search'), class: 'button' %>
</div>
<% end %>
</div>
</div>
<div id="search-result" class="row small"></div>
<h3><%= page_entries_info @managers %></h3>
<ul id="managers" class="admin-list">
<% @managers.each do |manager| %>
<li>
<%= render 'manager', manager: manager %>
</li>
<%= form_tag search_admin_managers_path, method: :get, remote: true do %>
<div class="small-12 medium-6 column">
<%= text_field_tag :email, '', placeholder: t('admin.managers.search.email_placeholder') %>
</div>
<div class="small-12 medium-6 column">
<%= submit_tag t('admin.managers.search.search'), class: 'button' %>
</div>
<% end %>
</ul>
</div>
<div id="search-result" class="row"></div>
<h3><%= page_entries_info @managers %></h3>
<table id="managers">
<% @managers.each do |manager| %>
<tr>
<td>
<%= manager.name %>
</td>
<td>
<%= manager.email %>
</td>
<td class="text-right">
<% if manager.persisted? %>
<%= link_to t('admin.managers.manager.delete'),
admin_manager_path(manager),
method: :delete,
class: "button hollow alert"
%>
<% else %>
<%= link_to t('admin.managers.manager.add'),{ controller: "admin/managers", action: :create, user_id: manager.user_id },
method: :post, class: "button success" %>
<% end %>
</td>
</tr>
<% end %>
</table>
<%= paginate @managers %>

View File

@@ -1 +1 @@
$("#search-result").html("<div class=\"panel column\"><%= j render 'manager', manager: @manager %></div>");
$("#search-result").html("<%= j render 'manager', manager: @manager %>");

View File

@@ -1 +1 @@
$("#search-result").html("<div class=\"panel column\"><%= j t('admin.managers.search.user_not_found') %></div>");
$("#search-result").html("<div class=\"small-12 column\"><div class=\"callout alert\"><%= j t('admin.managers.search.user_not_found') %></div></div>");

View File

@@ -1,13 +1,26 @@
<span><%= moderator.name %></span>
<span class="bullet">&nbsp;&bull;&nbsp;</span>
<span><%= moderator.email %></span>
<% if moderator.persisted? %>
<%= link_to t('admin.moderators.moderator.delete'),
admin_moderator_path(moderator),
method: :delete,
class: "button small alert float-right"
%>
<% else %>
<%= link_to t('admin.moderators.moderator.add'),{ controller: "admin/moderators", action: :create, user_id: moderator.user_id },
method: :post, class: "button small success float-right" %>
<% end %>
<div class="small-12 column">
<table>
<tbody>
<tr>
<td>
<%= moderator.name %>
</td>
<td>
<%= moderator.email %>
</td>
<td class="text-right">
<% if moderator.persisted? %>
<%= link_to t('admin.moderators.moderator.delete'),
admin_moderator_path(moderator),
method: :delete,
class: "button hollow alert" %>
<% else %>
<%= link_to t('admin.moderators.moderator.add'),{ controller: "admin/moderators", action: :create, user_id: moderator.user_id },
method: :post,
class: "button success" %>
<% end %>
</td>
</tr>
</tbody>
</table>
</div>

View File

@@ -1,24 +1,46 @@
<h2><%= t("admin.moderators.index.title") %></h2>
<div class="row">
<div class="column">
<%= form_tag search_admin_moderators_path, method: :get, remote: true do %>
<div class="small-12 medium-6 column">
<%= text_field_tag :email, '', placeholder: t('admin.moderators.search.email_placeholder') %>
</div>
<div class="small-12 medium-6 column">
<%= submit_tag t('admin.moderators.search.search'), class: 'button' %>
</div>
<% end %>
</div>
</div>
<div id="search-result" class="row small"></div>
<h3><%= page_entries_info @moderators %></h3>
<ul id="moderators" class="admin-list">
<% @moderators.each do |moderator| %>
<li>
<%= render 'moderator', moderator: moderator %>
</li>
<%= form_tag search_admin_moderators_path, method: :get, remote: true do %>
<div class="small-12 medium-6 column">
<%= text_field_tag :email, '', placeholder: t('admin.moderators.search.email_placeholder') %>
</div>
<div class="small-12 medium-6 column">
<%= submit_tag t('admin.moderators.search.search'), class: 'button' %>
</div>
<% end %>
</ul>
</div>
<div id="search-result" class="row"></div>
<h3><%= page_entries_info @moderators %></h3>
<table id="moderators">
<% @moderators.each do |moderator| %>
<tr>
<td>
<%= moderator.name %>
</td>
<td>
<%= moderator.email %>
</td>
<td class="text-right">
<% if moderator.persisted? %>
<%= link_to t('admin.moderators.moderator.delete'),
admin_moderator_path(moderator),
method: :delete,
class: "button hollow alert"
%>
<% else %>
<%= link_to t('admin.moderators.moderator.add'),
{ controller: "admin/moderators", action: :create,
user_id: moderator.user_id },
method: :post,
class: "button success" %>
<% end %>
</td>
</tr>
<% end %>
</table>
<%= paginate @moderators %>

View File

@@ -1 +1 @@
$("#search-result").html("<div class=\"panel column\"><%= j render 'moderator', moderator: @moderator %></div>");
$("#search-result").html("<%= j render 'moderator', moderator: @moderator %>");

View File

@@ -1 +1 @@
$("#search-result").html("<div class=\"panel column\"><%= j t('admin.moderators.search.user_not_found') %></div>");
$("#search-result").html("<div class=\"small-12 column\"><div class=\"callout alert\"><%= j t('admin.moderators.search.user_not_found') %></div></div>");

View File

@@ -1,15 +1,20 @@
<h2>
<%= t("admin.officials.edit.title") %>
<span class="official float-right"><strong><%= @user.name %></strong> (<%= @user.email %>)</span>
</h2>
<%= render 'shared/back_link' %>
<%= form_for @user, url: admin_official_path(@user) do |f| %>
<%= f.text_field :official_position %>
<%= f.select :official_level, official_level_options %>
<%= link_to t("admin.officials.edit.back"), admin_officials_path, class: "button small secondary" %>
<%= f.submit %>
<div class="clear"></div>
<% if @user.official? %>
<%= link_to t("admin.officials.edit.destroy"), admin_official_path(@user), method: :delete, class: 'delete' %>
<div class="official float-right"><strong><%= @user.name %></strong> (<%= @user.email %>)</div>
<h2 class="inline-block"><%= t("admin.officials.edit.title") %></h2>
<div class="row">
<div class="small-12 medium-6 column end">
<%= form_for @user, url: admin_official_path(@user) do |f| %>
<%= f.text_field :official_position %>
<%= f.select :official_level, official_level_options %>
<% if @user.official? %>
<%= link_to t("admin.officials.edit.destroy"), admin_official_path(@user), method: :delete, class: 'button hollow alert' %>
<% end %>
<%= f.submit class: "button hollow" %>
<% end %>
<% end %>
</div>
</div>

View File

@@ -4,20 +4,24 @@
<h3><%= page_entries_info @officials %></h3>
<ul class="admin-list">
<% @officials.each do |official| %>
<li>
<%= link_to official.name, edit_admin_official_path(official) %>
<span class="bullet">&nbsp;&bull;&nbsp;</span>
<span class="level"><%= t("admin.officials.level_#{official.official_level}") %></span>
<span class="bullet">&nbsp;&bull;&nbsp;</span>
<span class="label round level-<%= official.official_level %>">
<%= official.official_position %>
</span>
<%= link_to official.official? ? t("admin.officials.search.edit_official") : t("admin.officials.search.make_official"), edit_admin_official_path(official), class: "button small float-right" %>
</li>
<% end %>
</ul>
<table>
<% @officials.each do |official| %>
<tr>
<td>
<%= link_to official.name, edit_admin_official_path(official) %>
</td>
<td>
<span class="label round level-<%= official.official_level %>">
<%= official.official_position %>
</span>
(<%= t("admin.officials.level_#{official.official_level}") %>)
</td>
<td class="text-right">
<%= link_to official.official? ? t("admin.officials.search.edit_official") : t("admin.officials.search.make_official"),
edit_admin_official_path(official), class: "button hollow" %>
</td>
</tr>
<% end %>
</table>
<%= paginate @officials %>

View File

@@ -4,18 +4,22 @@
<h3><%= page_entries_info @users %></h3>
<ul class="admin-list">
<table>
<% @users.each do |user| %>
<li>
<%= link_to user.name, edit_admin_official_path(user) %>
<span class="bullet">&nbsp;&bull;&nbsp;</span>
<span class="label round level-<%= user.official_level %>">
<%= user.official_position %>
</span>
<span class="bullet">&nbsp;&bull;&nbsp;</span>
<span class="level"><%= t("admin.officials.level_#{user.official_level}") %></span>
<%= link_to user.official? ? t("admin.officials.search.edit_official") : t("admin.officials.search.make_official"), edit_admin_official_path(user), class: "button small float-right" %>
</li>
<tr>
<td>
<%= link_to user.name, edit_admin_official_path(user) %>
</td>
<td>
<span class="label round level-<%= user.official_level %>">
<%= user.official_position %>
</span>
(<%= t("admin.officials.level_#{user.official_level}") %>)
</td>
<td class="text-right">
<%= link_to user.official? ? t("admin.officials.search.edit_official") : t("admin.officials.search.make_official"),
edit_admin_official_path(user), class: "button hollow" %>
</td>
</tr>
<% end %>
</ul>
</table>

View File

@@ -22,12 +22,12 @@
<% @organizations.each do |organization| %>
<% hidden += 1 and next if organization.user.nil? || organization.user.hidden? %>
<tr id="<%= dom_id(organization) %>">
<td><%= organization.name %></td>
<td><%= organization.email %></td>
<td><%= organization.phone_number %></td>
<td><%= organization.responsible_name %></td>
<td><p><%= organization.name %></p></td>
<td><p><%= organization.email %></p></td>
<td><p><%= organization.phone_number %></p></td>
<td><p><%= organization.responsible_name %></p></td>
<% if organization.verified? %>
<td class="verified">
<td class="verified text-center">
<span class="icon-check"></span>
<%= t("admin.organizations.index.verified") %>
</td>
@@ -36,27 +36,32 @@
<td>
<%= link_to t("admin.organizations.index.verify"),
verify_admin_organization_path(organization, request.query_parameters),
method: :put, class: "button small success"
method: :put, class: "button success expanded"
%>
</td>
<% end %>
<% if organization.rejected? %>
<td class="rejected">
<td class="rejected text-center">
<span class="icon-x"></span>
<%= t("admin.organizations.index.rejected") %>
</td>
<% end %>
<% if can? :reject, organization %>
<td><%= link_to t("admin.organizations.index.reject"),
<td>
<%= link_to t("admin.organizations.index.reject"),
reject_admin_organization_path(organization, request.query_parameters),
method: :put, class: "button small alert"
%>
method: :put, class: "button hollow alert expanded"
%>
</td>
<% end %>
</tr>
<% end %>
</table>
<%= t("admin.organizations.index.hidden_count", count: hidden) if hidden > 0 %>
<% if hidden > 0 %>
<div class="callout primary">
<%= t("admin.organizations.index.hidden_count_html", count: hidden) %>
</div>
<% end %>
<%= paginate @organizations %>

View File

@@ -18,12 +18,12 @@
<table id="search-results">
<% @organizations.each do |organization| %>
<tr>
<td><%= organization.name %></td>
<td><%= organization.email %></td>
<td><%= organization.phone_number %></td>
<td><%= organization.responsible_name %></td>
<td><p><%= organization.name %></p></td>
<td><p><%= organization.email %></p></td>
<td><p><%= organization.phone_number %></p></td>
<td><p><%= organization.responsible_name %></p></td>
<% if organization.verified? %>
<td class="verified">
<td class="verified text-center">
<span class="icon-check"></span>
<%= t("admin.organizations.index.verified") %>
</td>
@@ -32,12 +32,12 @@
<td>
<%= link_to t("admin.organizations.index.verify"),
verify_admin_organization_path(organization, request.query_parameters),
method: :put, class: "button small success"
method: :put, class: "button success expanded"
%>
</td>
<% end %>
<% if organization.rejected? %>
<td class="rejected">
<td class="rejected text-center">
<span class="icon-x"></span>
<%= t("admin.organizations.index.rejected") %>
</td>
@@ -45,7 +45,7 @@
<% if can? :reject, organization %>
<td><%= link_to t("admin.organizations.index.reject"),
reject_admin_organization_path(organization, request.query_parameters),
method: :put, class: "button small alert"
method: :put, class: "button hollow alert expanded"
%>
</td>
<% end %>

View File

@@ -22,19 +22,17 @@
<p><%= proposal.question %></p>
</div>
</td>
<td>
<td class="text-right">
<%= link_to t("admin.actions.restore"),
restore_admin_proposal_path(proposal, request.query_parameters),
method: :put,
data: { confirm: t("admin.actions.confirm") },
class: "button small success no-margin" %>
</td>
<td>
class: "button hollow on-hover" %>
<% unless proposal.confirmed_hide? %>
<%= link_to t("admin.actions.confirm_hide"),
confirm_hide_admin_proposal_path(proposal, request.query_parameters),
method: :put,
class: "button small warning float-right" %>
class: "button hollow warning on-hover" %>
<% end %>
</td>
</tr>

View File

@@ -1,68 +1,97 @@
<h2><%= t("admin.settings.index.title") %></h2>
<ul class="admin-list">
<% @settings.each do |setting| %>
<li>
<strong><%= t("settings.#{setting.key}") %></strong>
<%= form_for(setting, url: admin_setting_path(setting), html: { id: "edit_#{dom_id(setting)}"}) do |f| %>
<%= f.text_area :value, label: false, id: dom_id(setting), lines: 1 %>
<%= f.submit(t('admin.settings.index.update_setting'), class: "button small success") %>
<% end %>
</li>
<% end %>
</ul>
<table>
<tbody>
<% @settings.each do |setting| %>
<tr>
<td class="small-12 medium-4">
<strong><%= t("settings.#{setting.key}") %></strong>
</td>
<td class="small-12 medium-8">
<%= form_for(setting, url: admin_setting_path(setting), html: { id: "edit_#{dom_id(setting)}"}) do |f| %>
<div class="small-12 medium-6 large-9 column">
<%= f.text_area :value, label: false, id: dom_id(setting), lines: 1 %>
</div>
<div class="small-12 medium-6 large-3 column">
<%= f.submit(t('admin.settings.index.update_setting'), class: "button hollow expanded") %>
</div>
<% end %>
</td>
</tr>
<% end %>
</tbody>
</table>
<h2><%= t("admin.settings.index.feature_flags") %></h2>
<ul class="admin-list">
<% @feature_flags.each do |feature_flag| %>
<li>
<strong><%= t("settings.#{feature_flag.key}") %></strong>
<table>
<tbody>
<% @feature_flags.each do |feature_flag| %>
<tr>
<td>
<strong><%= t("settings.#{feature_flag.key}") %></strong>
</td>
<div>
<%= feature_flag.enabled? ? t("admin.settings.index.features.enabled") : t("admin.settings.index.features.disabled") %>
<div>
<td>
<%= feature_flag.enabled? ? t("admin.settings.index.features.enabled") : t("admin.settings.index.features.disabled") %>
</td>
<%= form_for(feature_flag, url: admin_setting_path(feature_flag), html: { id: "edit_#{dom_id(feature_flag)}"}) do |f| %>
<td class="text-right">
<%= form_for(feature_flag, url: admin_setting_path(feature_flag), html: { id: "edit_#{dom_id(feature_flag)}"}) do |f| %>
<%= f.hidden_field :value, id: dom_id(feature_flag), value: (feature_flag.enabled? ? "" : "active") %>
<%= f.submit(t("admin.settings.index.features.#{feature_flag.enabled? ? 'disable' : 'enable'}"), class: "button small #{feature_flag.enabled? ? 'warning' : 'success'}", data: {confirm: t("admin.actions.confirm")}) %>
<% end %>
</li>
<% end %>
</ul>
<%= f.hidden_field :value, id: dom_id(feature_flag), value: (feature_flag.enabled? ? "" : "active") %>
<%= f.submit(t("admin.settings.index.features.#{feature_flag.enabled? ? 'disable' : 'enable'}"),
class: "button expanded #{feature_flag.enabled? ? 'hollow alert' : 'success'}",
data: {confirm: t("admin.actions.confirm")}) %>
<% end %>
</td>
</tr>
<% end %>
</tbody>
</table>
<% if @banner_styles.present? %>
<h2><%= t("admin.settings.index.banners") %></h2>
<ul class="admin-list">
<table>
<tbody>
<% @banner_styles.each do |setting| %>
<li>
<strong><%= t("settings.#{setting.key}") %></strong>
<tr>
<td>
<strong><%= t("settings.#{setting.key}") %></strong>
</td>
<%= form_for(setting, url: admin_setting_path(setting), html: { id: "edit_#{dom_id(setting)}"}) do |f| %>
<%= f.text_area :value, label: false, id: dom_id(setting), lines: 1 %>
<%= f.submit(t('admin.settings.index.update_setting'), class: "button small success") %>
<% end %>
</li>
<td>
<%= form_for(setting, url: admin_setting_path(setting), html: { id: "edit_#{dom_id(setting)}"}) do |f| %>
<%= f.text_area :value, label: false, id: dom_id(setting), lines: 1 %>
<%= f.submit(t('admin.settings.index.update_setting'), class: "button hollow") %>
<% end %>
</td>
</tr>
<% end %>
</ul>
</tbody>
</table>
<% end %>
<% if @banner_imgs.present?%>
<h2><%= t("admin.settings.index.banner_imgs") %></h2>
<ul class="admin-list">
<% @banner_imgs.each do |setting| %>
<li>
<strong><%= t("settings.#{setting.key}") %></strong>
<table>
<tbody>
<% @banner_imgs.each do |setting| %>
<tr>
<td>
<strong><%= t("settings.#{setting.key}") %></strong>
</td>
<%= form_for(setting, url: admin_setting_path(setting), html: { id: "edit_#{dom_id(setting)}"}) do |f| %>
<%= f.text_area :value, label: false, id: dom_id(setting), lines: 1 %>
<%= f.submit(t('admin.settings.index.update_setting'), class: "button small success") %>
<% end %>
</li>
<td>
<%= form_for(setting, url: admin_setting_path(setting), html: { id: "edit_#{dom_id(setting)}"}) do |f| %>
<%= f.text_area :value, label: false, id: dom_id(setting), lines: 1 %>
<%= f.submit(t('admin.settings.index.update_setting'), class: "button small success") %>
<% end %>
</td>
</tr>
<% end %>
</ul>
</tbody>
</table>
<% end %>

View File

@@ -22,29 +22,29 @@
<h3><%= t("admin.tags.index.title") %>: <%= page_entries_info @tags %></h3>
<ul class="admin-list">
<table>
<% @tags.each do |tag| %>
<li>
<span class="tag"><%= tag.name %></span>
<tr>
<td>
<%= form_for(tag,
url: admin_tag_path(tag),
as: :tag,
html: { id: "edit_tag_#{tag.id}", class: "text-right"}) do |f| %>
<%= form_for(tag,
url: admin_tag_path(tag),
as: :tag,
html: { id: "edit_tag_#{tag.id}", class: "text-right"}) do |f| %>
<span class="float-left text-left">
<strong><%= tag.name %></strong>
<%= f.label "featured_#{tag.id}" do %>
<%= f.check_box :featured, title: t('admin.tags.mark_as_featured'), label: false, id: "tag_featured_#{tag.id}", class: "inline-block" %>
<span class="checkbox inline-block"><%= t("admin.tags.mark_as_featured") %></span>
<% end %>
</span>
<span class="float-left">
<%= f.label "featured_#{tag.id}" do %>
<%= f.check_box :featured, title: t('admin.tags.mark_as_featured'), label: false, id: "tag_featured_#{tag.id}", class: "inline-block" %>
<span class="checkbox inline-block"><%= t("admin.tags.mark_as_featured") %></span>
<% end %>
</span>
<%= f.submit(t("admin.tags.update"), class: "button small success") %>
<%= link_to t("admin.tags.destroy"), admin_tag_path(tag), method: :delete, class: "delete" %>
<% end %>
</li>
<%= f.submit(t("admin.tags.update"), class: "button hollow on-hover") %>
<%= link_to t("admin.tags.destroy"), admin_tag_path(tag), method: :delete, class: "button hollow alert on-hover" %>
<% end %>
</td>
</tr>
<% end %>
</ul>
</table>
<%= paginate @tags %>

View File

@@ -4,25 +4,29 @@
<h3><%= page_entries_info @users %></h3>
<ul class="admin-list">
<table>
<% @users.each do |user| %>
<li id="<%= dom_id(user) %>">
<%= link_to user.name, admin_user_path(user) %>
<tr id="<%= dom_id(user) %>">
<td>
<p><%= link_to user.name, admin_user_path(user) %></p>
</td>
<%= link_to t("admin.actions.restore"),
restore_admin_user_path(user, request.query_parameters),
method: :put,
data: { confirm: t("admin.actions.confirm") },
class: "button small success float-right" %>
<% unless user.confirmed_hide? %>
<%= link_to t("admin.actions.confirm_hide"),
confirm_hide_admin_user_path(user, request.query_parameters),
method: :put,
class: "button small warning float-right" %>
<% end %>
</li>
<td class="text-right">
<%= link_to t("admin.actions.restore"),
restore_admin_user_path(user, request.query_parameters),
method: :put,
data: { confirm: t("admin.actions.confirm") },
class: "button hollow on-hover" %>
<% unless user.confirmed_hide? %>
<%= link_to t("admin.actions.confirm_hide"),
confirm_hide_admin_user_path(user, request.query_parameters),
method: :put,
class: "button hollow warning on-hover" %>
<% end %>
</td>
</tr>
<% end %>
</ul>
</table>
<%= paginate @users %>

View File

@@ -1,3 +1,5 @@
<%= render 'shared/back_link' %>
<h2><%= t("admin.users.show.title", user: @user.name) %></h2>
<p>
@@ -5,37 +7,33 @@
<strong><%= t("admin.users.show.registered_at") %></strong> <%= @user.confirmed_at %> |
<strong><%= t("admin.users.show.hidden_at") %></strong> <%= @user.hidden_at %>
</p>
<p>
<%= link_to t("admin.users.show.back"), admin_users_path,
class: "button small secondary" %>
</p>
<% if @debates.present? %>
<h3><%= page_entries_info @debates %></h3>
<% end %>
<ul class="admin-list">
<% @debates.each do |debate| %>
<li>
<%= link_to debate.title, debate_path(debate) %>
</li>
<% end %>
</ul>
<table>
<% @debates.each do |debate| %>
<tr>
<td>
<%= link_to debate.title, debate_path(debate) %>
</td>
</tr>
<% end %>
</table>
<% if @comments.present? %>
<h3><%= page_entries_info @comments %></h3>
<% end %>
<ul class="admin-list">
<% @comments.each do |comment| %>
<li id="<%= dom_id(comment) %>">
<div class="row">
<div class="small-12 medium-10 column">
<%= text_with_links comment.body %>
</div>
</div>
</li>
<% end %>
</ul>
<table>
<% @comments.each do |comment| %>
<tr id="<%= dom_id(comment) %>">
<td>
<%= text_with_links comment.body %>
</td>
</tr>
<% end %>
</table>
<%= paginate [@debates, @comments].sort_by {|x| x.size}.last %>

View File

@@ -1,12 +1,16 @@
<h3><%= t('admin.valuators.valuator.user_found') %>:</h3>
<div class="row">
<div class="small-12 medium-12 column">
<h4>
<%= valuator.name %>
<span class="bullet">&nbsp;&bull;&nbsp;</span>
<%= valuator.email %>
</h4>
</div>
<div class="small-12 column">
<h3><%= t('admin.valuators.valuator.user_found') %></h3>
<table>
<tr>
<td>
<%= valuator.name %>
</td>
<td>
<%= valuator.email %>
</td>
</tr>
</table>
<% unless @valuator.persisted? %>
<%= form_for @valuator, url: admin_valuators_path do |f| %>

View File

@@ -1,30 +1,36 @@
<h2><%= t("admin.valuators.index.title") %></h2>
<div class="row">
<div class="column">
<%= form_tag search_admin_valuators_path, method: :get, remote: true do %>
<div class="small-12 medium-6 column">
<%= text_field_tag :email, '', placeholder: t('admin.valuators.search.email_placeholder') %>
</div>
<div class="small-12 medium-6 column">
<%= submit_tag t('admin.valuators.search.search'), class: 'button radius' %>
</div>
<% end %>
</div>
</div>
<div id="search-result" class="row small"></div>
<h3><%= page_entries_info @valuators %></h3>
<ul id="valuators" class="admin-list">
<% @valuators.each do |valuator| %>
<li>
<span><%= valuator.name %></span>
<span class="bullet">&nbsp;&bull;&nbsp;</span>
<span><%= valuator.email %></span>
<% if valuator.description.present? %>
<span class="bullet">&nbsp;&bull;&nbsp;</span>
<span><%= valuator.description %></span>
<% end %>
</li>
<%= form_tag search_admin_valuators_path, method: :get, remote: true do %>
<div class="small-12 medium-6 column">
<%= text_field_tag :email, '', placeholder: t('admin.valuators.search.email_placeholder') %>
</div>
<div class="small-12 medium-6 column">
<%= submit_tag t('admin.valuators.search.search'), class: 'button radius' %>
</div>
<% end %>
</ul>
</div>
<div id="search-result" class="row"></div>
<h3><%= page_entries_info @valuators %></h3>
<table id="valuators">
<% @valuators.each do |valuator| %>
<tr>
<td>
<%= valuator.name %>
</td>
<td>
<%= valuator.email %>
</td>
<td>
<% if valuator.description.present? %>
<%= valuator.description %>
<% end %>
</td>
</tr>
<% end %>
</table>
<%= paginate @valuators %>

View File

@@ -1,7 +1,4 @@
<%= link_to admin_spending_proposals_path, class: "back" do %>
<span class="icon-angle-left"></span>
<%= t("shared.back") %>
<% end %>
<%= render 'shared/back_link' %>
<h2><%= t("admin.valuators.summary.title") %></h2>

View File

@@ -1 +1 @@
$("#search-result").html("<h4><%= j t('admin.valuators.search.user_not_found') %></h4>");
$("#search-result").html("<div class=\"small-12 column\"><div class=\"callout alert\"><%= j t('admin.valuators.search.user_not_found') %></div></div>");

View File

@@ -4,13 +4,17 @@
<h3><%= page_entries_info @users %></h3>
<ul class="admin-list">
<% @users.each do |user| %>
<li id="<%= dom_id(user) %>">
<%= link_to user.name, admin_user_path(user) %>
<%= render "pending_step", user: user %>
</li>
<% end %>
</ul>
<table>
<% @users.each do |user| %>
<tr id="<%= dom_id(user) %>">
<td>
<%= link_to user.name, admin_user_path(user) %>
</td>
<td>
<%= render "pending_step", user: user %>
</td>
</tr>
<% end %>
</table>
<%= paginate @users %>

View File

@@ -14,20 +14,39 @@
</head>
<body class="admin">
<%= render 'layouts/admin_header' %>
<div class="off-canvas-wrapper">
<div class="off-canvas-wrapper-inner" data-off-canvas-wrapper>
<div class="off-canvas position-left" id="offCanvas" data-off-canvas>
<main class="no-margin-top row no-max-width collapse">
<div class="small-12 medium-3 large-2 column">
<%= side_menu %>
<button class="close-button" aria-label="Close menu" type="button" data-close>
<span aria-hidden="true">&times;</span>
</button>
<%= side_menu %>
</div>
<div class="off-canvas-content" data-off-canvas-content>
<%= render 'layouts/admin_header' %>
<main class="no-margin-top row no-max-width collapse">
<div class="small-12 medium-3 large-2 column">
<div class="show-for-small-only">
<button type="button" class="button hollow expanded" data-toggle="offCanvas"><%= t("admin.menu.admin") %></button>
</div>
<div class="hide-for-small-only">
<%= side_menu %>
</div>
</div>
<div class="admin-content small-12 medium-9 large-10 column">
<%= render 'layouts/flash' %>
<%= yield %>
</div>
</main>
</div>
</div>
<div class="admin-content small-12 medium-9 large-10 column">
<%= render 'layouts/flash' %>
<%= yield %>
</div>
</main>
</div>
</body>
</html>

View File

@@ -50,6 +50,7 @@ en:
hide: Hidden
restore: Restored
by: Moderated by
content: Content
filter: Show
filters:
all: All
@@ -93,6 +94,7 @@ en:
user_not_found: User not found
menu:
activity: Moderator activity
admin: Admin menu
banner: Manage banners
debate_topics: Debate topics
hidden_comments: Hidden comments
@@ -140,7 +142,6 @@ en:
cost: Cost
officials:
edit:
back: Back
destroy: Remove 'Official' status
title: 'Officials: Edit user'
flash:
@@ -166,9 +167,9 @@ en:
pending: Pending
rejected: Rejected
verified: Verified
hidden_count:
one: There is also one organisation with no users or with a hidden user
other: There are %{count} organisations with no users or with a hidden user
hidden_count_html:
one: There is also <strong>one organisation</strong> with no users or with a hidden user.
other: There are <strong>%{count} organisations</strong> with no users or with a hidden user.
reject: Reject
rejected: Rejected
search: Search
@@ -306,11 +307,10 @@ en:
without_confirmed_hide: Pending
title: Hidden users
show:
back: Back
email: 'Email:'
hidden_at: 'Hidden at:'
registered_at: 'Registered at:'
title: Activity of user %{user}
title: Activity of user (%{user})
verifications:
index:
phone_not_given: Phone not given

View File

@@ -11,7 +11,7 @@ es:
unmark_featured: Quitar destacado
banners:
index:
title: Anuncios
title: Banners
create: Crear un banner
edit: Editar banner
delete: Eliminar banner
@@ -48,6 +48,7 @@ es:
hide: Ocultado
restore: Restaurado
by: Moderado por
content: Contenido
filter: Mostrar
filters:
all: Todo
@@ -91,6 +92,7 @@ es:
user_not_found: Usuario no encontrado
menu:
activity: Actividad de moderadores
admin: Menú de administración
banner: Gestionar banners
debate_topics: Temas de debate
hidden_comments: Comentarios ocultos
@@ -138,7 +140,6 @@ es:
cost: Coste total
officials:
edit:
back: Volver
destroy: Eliminar condición de 'Cargo Público'
title: 'Cargos Públicos: Editar usuario'
flash:
@@ -164,9 +165,9 @@ es:
pending: Pendientes
rejected: Rechazadas
verified: Verificadas
hidden_count:
one: Hay además una organización sin usuario o con el usuario bloqueado
other: Hay %{count} organizaciones sin usuario o con el usuario bloqueado
hidden_count_html:
one: Hay además <strong>una organización</strong> sin usuario o con el usuario bloqueado.
other: Hay <strong>%{count} organizaciones</strong> sin usuario o con el usuario bloqueado.
reject: Rechazar
rejected: Rechazada
search: Buscar
@@ -304,11 +305,10 @@ es:
without_confirmed_hide: Pendientes
title: Usuarios bloqueados
show:
back: Volver
email: 'Email:'
hidden_at: 'Bloqueado:'
registered_at: 'Fecha de alta:'
title: Actividad del usuario %{user}
title: Actividad del usuario (%{user})
verifications:
index:
phone_not_given: No ha dado su teléfono