From fb6dbdf2f9f54bf82c0d81ea652271e1106ea4c5 Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Wed, 1 Jun 2016 13:23:57 +0200 Subject: [PATCH] Improves all pages for admin section --- app/views/admin/activity/show.html.erb | 2 +- app/views/admin/banners/_form.html.erb | 61 +++++---- app/views/admin/banners/index.html.erb | 33 +++-- app/views/admin/comments/index.html.erb | 50 ++++---- app/views/admin/debates/index.html.erb | 8 +- app/views/admin/managers/_manager.html.erb | 37 ++++-- app/views/admin/managers/index.html.erb | 57 ++++++--- app/views/admin/managers/search.js.erb | 2 +- .../admin/managers/user_not_found.js.erb | 2 +- .../admin/moderators/_moderator.html.erb | 39 ++++-- app/views/admin/moderators/index.html.erb | 60 ++++++--- app/views/admin/moderators/search.js.erb | 2 +- .../admin/moderators/user_not_found.js.erb | 2 +- app/views/admin/officials/edit.html.erb | 29 +++-- app/views/admin/officials/index.html.erb | 34 ++--- app/views/admin/officials/search.html.erb | 30 +++-- app/views/admin/organizations/index.html.erb | 27 ++-- app/views/admin/organizations/search.html.erb | 16 +-- app/views/admin/proposals/index.html.erb | 8 +- app/views/admin/settings/index.html.erb | 121 +++++++++++------- app/views/admin/tags/index.html.erb | 40 +++--- app/views/admin/users/index.html.erb | 36 +++--- app/views/admin/users/show.html.erb | 42 +++--- app/views/admin/valuators/_valuator.html.erb | 24 ++-- app/views/admin/valuators/index.html.erb | 56 ++++---- app/views/admin/valuators/summary.html.erb | 5 +- .../admin/valuators/user_not_found.js.erb | 2 +- app/views/admin/verifications/index.html.erb | 20 +-- app/views/layouts/admin.html.erb | 45 +++++-- config/locales/admin.en.yml | 12 +- config/locales/admin.es.yml | 14 +- 31 files changed, 529 insertions(+), 387 deletions(-) diff --git a/app/views/admin/activity/show.html.erb b/app/views/admin/activity/show.html.erb index 0f422cfa8..92ff3e26a 100644 --- a/app/views/admin/activity/show.html.erb +++ b/app/views/admin/activity/show.html.erb @@ -8,7 +8,7 @@ <%= t("admin.activity.show.type") %> <%= t("admin.activity.show.action") %> - + <%= t("admin.activity.show.content") %> <%= t("admin.activity.show.by") %> <% @activity.each do |activity| %> diff --git a/app/views/admin/banners/_form.html.erb b/app/views/admin/banners/_form.html.erb index dce669777..9c8d20612 100644 --- a/app/views/admin/banners/_form.html.erb +++ b/app/views/admin/banners/_form.html.erb @@ -1,40 +1,20 @@ <%= form_for [:admin, @banner] do |f| %> <%= render 'errors' %> - +
-
+
<%= 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") %>
-
+
<%= 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") %>
-
- <%= 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"} %> -
- -
- <%= 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") %> -
- -
- <%= f.label :target_url, t("admin.banners.banner.target_url") %> - <%= f.text_field :target_url, - label: false, - placeholder: t("admin.banners.banner.target_url") %> -
<% date_started_at = @banner.post_started_at.present? ? I18n.localize(@banner.post_started_at) : "" %> -
+
<%= 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" %>
<% date_ended_at = @banner.post_ended_at.present? ? I18n.localize(@banner.post_ended_at) : ""%> -
+
<%= 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" %>
+
-
- <%= f.submit(class: "button", value: t("admin.banners.edit.form.submit_button")) %> +
+
+ <%= 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"} %> +
+ +
+ <%= f.label :target_url, t("admin.banners.banner.target_url") %> + <%= f.text_field :target_url, + label: false, + placeholder: t("admin.banners.banner.target_url") %> +
+
+ +
+
+ <%= 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") %> +
+
+ +
+
+ <%= f.submit(class: "button expanded", value: t("admin.banners.edit.form.submit_button")) %>
diff --git a/app/views/admin/banners/index.html.erb b/app/views/admin/banners/index.html.erb index 3dc337740..db58c1303 100644 --- a/app/views/admin/banners/index.html.erb +++ b/app/views/admin/banners/index.html.erb @@ -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" %>

<%= t("admin.banners.index.title") %>

@@ -11,6 +11,12 @@ <% @banners.each do |banner| %> + + <%= t("admin.banners.banner.post_started_at")%> <%= banner.post_started_at %> +  |  + <%= t("admin.banners.banner.post_ended_at")%> <%= banner.post_ended_at%> + +
<%= link_to banner.target_url do %> @@ -19,24 +25,15 @@ <% end %>
- - <%= t("admin.banners.banner.post_started_at")%> <%= banner.post_started_at %> -  |  - <%= t("admin.banners.banner.post_ended_at")%> <%= banner.post_ended_at%> - - <%= link_to edit_admin_banner_path(banner), - class: 'edit-banner button' do %> - - <%= t("admin.banners.index.edit") %> - <% end %> - - - <%= link_to admin_banner_path(banner), method: :delete, - class: 'delete' do %> - - <%= t("admin.banners.index.delete") %> - <% end %> + + + <%= 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' %> <% end %> diff --git a/app/views/admin/comments/index.html.erb b/app/views/admin/comments/index.html.erb index af436c7c4..4166be938 100644 --- a/app/views/admin/comments/index.html.erb +++ b/app/views/admin/comments/index.html.erb @@ -4,34 +4,32 @@

<%= page_entries_info @comments %>

-
    + <% @comments.each do |comment| %> -
  • -
    -
    - <%= text_with_links comment.body %>
    - <% 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 %> -
    -
    - <%= link_to t("admin.actions.restore"), - restore_admin_comment_path(comment, request.query_parameters), +
  • + + + <% end %> - +
    + <%= text_with_links comment.body %>
    + <% 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 %> +
    + <%= 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 %> - - - + class: "button hollow warning on-hover" %> + <% end %> +
    <%= paginate @comments %> diff --git a/app/views/admin/debates/index.html.erb b/app/views/admin/debates/index.html.erb index b755e70a1..987aa6e72 100644 --- a/app/views/admin/debates/index.html.erb +++ b/app/views/admin/debates/index.html.erb @@ -14,19 +14,17 @@ <%= debate.description %>
- + <%= 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" %> - - + 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 %> diff --git a/app/views/admin/managers/_manager.html.erb b/app/views/admin/managers/_manager.html.erb index 24dd1565c..3e709eb60 100644 --- a/app/views/admin/managers/_manager.html.erb +++ b/app/views/admin/managers/_manager.html.erb @@ -1,13 +1,24 @@ -<%= manager.name %> - •  -<%= manager.email %> -<% 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 %> +
+ + + + + + +
+ <%= manager.name %> + + <%= manager.email %> + + <% 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 %> +
+
diff --git a/app/views/admin/managers/index.html.erb b/app/views/admin/managers/index.html.erb index 3113907a4..d479ba303 100644 --- a/app/views/admin/managers/index.html.erb +++ b/app/views/admin/managers/index.html.erb @@ -1,24 +1,43 @@

<%= t("admin.managers.index.title") %>

+
-
- <%= form_tag search_admin_managers_path, method: :get, remote: true do %> -
- <%= text_field_tag :email, '', placeholder: t('admin.managers.search.email_placeholder') %> -
-
- <%= submit_tag t('admin.managers.search.search'), class: 'button' %> -
- <% end %> -
-
-
-

<%= page_entries_info @managers %>

-
    - <% @managers.each do |manager| %> -
  • - <%= render 'manager', manager: manager %> -
  • + <%= form_tag search_admin_managers_path, method: :get, remote: true do %> +
    + <%= text_field_tag :email, '', placeholder: t('admin.managers.search.email_placeholder') %> +
    +
    + <%= submit_tag t('admin.managers.search.search'), class: 'button' %> +
    <% end %> -
+
+ +
+ +

<%= page_entries_info @managers %>

+ + + <% @managers.each do |manager| %> + + + + + + <% end %> +
+ <%= manager.name %> + + <%= manager.email %> + + <% 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 %> +
<%= paginate @managers %> diff --git a/app/views/admin/managers/search.js.erb b/app/views/admin/managers/search.js.erb index 0f0fd09cd..e54b84293 100644 --- a/app/views/admin/managers/search.js.erb +++ b/app/views/admin/managers/search.js.erb @@ -1 +1 @@ -$("#search-result").html("
<%= j render 'manager', manager: @manager %>
"); +$("#search-result").html("<%= j render 'manager', manager: @manager %>"); diff --git a/app/views/admin/managers/user_not_found.js.erb b/app/views/admin/managers/user_not_found.js.erb index 0116de21d..53e9d7e20 100644 --- a/app/views/admin/managers/user_not_found.js.erb +++ b/app/views/admin/managers/user_not_found.js.erb @@ -1 +1 @@ -$("#search-result").html("
<%= j t('admin.managers.search.user_not_found') %>
"); +$("#search-result").html("
<%= j t('admin.managers.search.user_not_found') %>
"); diff --git a/app/views/admin/moderators/_moderator.html.erb b/app/views/admin/moderators/_moderator.html.erb index 0f01b47b9..57a29d2e8 100644 --- a/app/views/admin/moderators/_moderator.html.erb +++ b/app/views/admin/moderators/_moderator.html.erb @@ -1,13 +1,26 @@ -<%= moderator.name %> - •  -<%= moderator.email %> -<% 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 %> +
+ + + + + + + + +
+ <%= moderator.name %> + + <%= moderator.email %> + + <% 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 %> +
+
diff --git a/app/views/admin/moderators/index.html.erb b/app/views/admin/moderators/index.html.erb index 7c39f3234..d2a5d45e0 100644 --- a/app/views/admin/moderators/index.html.erb +++ b/app/views/admin/moderators/index.html.erb @@ -1,24 +1,46 @@

<%= t("admin.moderators.index.title") %>

+
-
- <%= form_tag search_admin_moderators_path, method: :get, remote: true do %> -
- <%= text_field_tag :email, '', placeholder: t('admin.moderators.search.email_placeholder') %> -
-
- <%= submit_tag t('admin.moderators.search.search'), class: 'button' %> -
- <% end %> -
-
-
-

<%= page_entries_info @moderators %>

-
    - <% @moderators.each do |moderator| %> -
  • - <%= render 'moderator', moderator: moderator %> -
  • + <%= form_tag search_admin_moderators_path, method: :get, remote: true do %> +
    + <%= text_field_tag :email, '', placeholder: t('admin.moderators.search.email_placeholder') %> +
    +
    + <%= submit_tag t('admin.moderators.search.search'), class: 'button' %> +
    <% end %> -
+
+ +
+ +

<%= page_entries_info @moderators %>

+ + + <% @moderators.each do |moderator| %> + + + + + + <% end %> +
+ <%= moderator.name %> + + <%= moderator.email %> + + <% 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 %> +
<%= paginate @moderators %> diff --git a/app/views/admin/moderators/search.js.erb b/app/views/admin/moderators/search.js.erb index a6ac48206..887d8aa3a 100644 --- a/app/views/admin/moderators/search.js.erb +++ b/app/views/admin/moderators/search.js.erb @@ -1 +1 @@ -$("#search-result").html("
<%= j render 'moderator', moderator: @moderator %>
"); +$("#search-result").html("<%= j render 'moderator', moderator: @moderator %>"); diff --git a/app/views/admin/moderators/user_not_found.js.erb b/app/views/admin/moderators/user_not_found.js.erb index a3f86936c..a8573236c 100644 --- a/app/views/admin/moderators/user_not_found.js.erb +++ b/app/views/admin/moderators/user_not_found.js.erb @@ -1 +1 @@ -$("#search-result").html("
<%= j t('admin.moderators.search.user_not_found') %>
"); +$("#search-result").html("
<%= j t('admin.moderators.search.user_not_found') %>
"); diff --git a/app/views/admin/officials/edit.html.erb b/app/views/admin/officials/edit.html.erb index defbaa483..10ec9b23f 100644 --- a/app/views/admin/officials/edit.html.erb +++ b/app/views/admin/officials/edit.html.erb @@ -1,15 +1,20 @@ -

- <%= t("admin.officials.edit.title") %> - <%= @user.name %> (<%= @user.email %>) -

+<%= 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 %> +
- <% if @user.official? %> - <%= link_to t("admin.officials.edit.destroy"), admin_official_path(@user), method: :delete, class: 'delete' %> +
<%= @user.name %> (<%= @user.email %>)
+ +

<%= t("admin.officials.edit.title") %>

+ +
+
+ <%= 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 %> +
+
diff --git a/app/views/admin/officials/index.html.erb b/app/views/admin/officials/index.html.erb index ea0e8dccf..078d5bbbc 100644 --- a/app/views/admin/officials/index.html.erb +++ b/app/views/admin/officials/index.html.erb @@ -4,20 +4,24 @@

<%= page_entries_info @officials %>

-
    -<% @officials.each do |official| %> -
  • - <%= link_to official.name, edit_admin_official_path(official) %> -  •  - <%= t("admin.officials.level_#{official.official_level}") %> -  •  - - <%= official.official_position %> - - - <%= 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" %> -
  • -<% end %> -
+ + <% @officials.each do |official| %> + + + + + + <% end %> +
+ <%= link_to official.name, edit_admin_official_path(official) %> + + + <%= official.official_position %> + + (<%= t("admin.officials.level_#{official.official_level}") %>) + + <%= link_to official.official? ? t("admin.officials.search.edit_official") : t("admin.officials.search.make_official"), + edit_admin_official_path(official), class: "button hollow" %> +
<%= paginate @officials %> diff --git a/app/views/admin/officials/search.html.erb b/app/views/admin/officials/search.html.erb index c7a7dc2a6..f2d90c143 100644 --- a/app/views/admin/officials/search.html.erb +++ b/app/views/admin/officials/search.html.erb @@ -4,18 +4,22 @@

<%= page_entries_info @users %>

-
    + <% @users.each do |user| %> -
  • - <%= link_to user.name, edit_admin_official_path(user) %> -  •  - - <%= user.official_position %> - -  •  - <%= t("admin.officials.level_#{user.official_level}") %> - - <%= 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" %> -
  • + + + + + <% end %> - +
    + <%= link_to user.name, edit_admin_official_path(user) %> + + + <%= user.official_position %> + + (<%= t("admin.officials.level_#{user.official_level}") %>) + + <%= link_to user.official? ? t("admin.officials.search.edit_official") : t("admin.officials.search.make_official"), + edit_admin_official_path(user), class: "button hollow" %> +
    diff --git a/app/views/admin/organizations/index.html.erb b/app/views/admin/organizations/index.html.erb index ec834eebf..0ddee4247 100644 --- a/app/views/admin/organizations/index.html.erb +++ b/app/views/admin/organizations/index.html.erb @@ -22,12 +22,12 @@ <% @organizations.each do |organization| %> <% hidden += 1 and next if organization.user.nil? || organization.user.hidden? %> - <%= organization.name %> - <%= organization.email %> - <%= organization.phone_number %> - <%= organization.responsible_name %> +

    <%= organization.name %>

    +

    <%= organization.email %>

    +

    <%= organization.phone_number %>

    +

    <%= organization.responsible_name %>

    <% if organization.verified? %> - + <%= t("admin.organizations.index.verified") %> @@ -36,27 +36,32 @@ <%= 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" %> <% end %> <% if organization.rejected? %> - + <%= t("admin.organizations.index.rejected") %> <% end %> <% if can? :reject, organization %> - <%= link_to t("admin.organizations.index.reject"), + + <%= 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" + %> <% end %> <% end %> -<%= t("admin.organizations.index.hidden_count", count: hidden) if hidden > 0 %> +<% if hidden > 0 %> +
    + <%= t("admin.organizations.index.hidden_count_html", count: hidden) %> +
    +<% end %> <%= paginate @organizations %> diff --git a/app/views/admin/organizations/search.html.erb b/app/views/admin/organizations/search.html.erb index 9e90975ab..5b5071c5b 100644 --- a/app/views/admin/organizations/search.html.erb +++ b/app/views/admin/organizations/search.html.erb @@ -18,12 +18,12 @@ <% @organizations.each do |organization| %> - - - - + + + + <% if organization.verified? %> - @@ -32,12 +32,12 @@ <% end %> <% if organization.rejected? %> - @@ -45,7 +45,7 @@ <% if can? :reject, organization %> <% end %> diff --git a/app/views/admin/proposals/index.html.erb b/app/views/admin/proposals/index.html.erb index 8df15af87..cbe1e6d74 100644 --- a/app/views/admin/proposals/index.html.erb +++ b/app/views/admin/proposals/index.html.erb @@ -22,19 +22,17 @@

    <%= proposal.question %>

    - - diff --git a/app/views/admin/settings/index.html.erb b/app/views/admin/settings/index.html.erb index 44aa09026..14c89b776 100644 --- a/app/views/admin/settings/index.html.erb +++ b/app/views/admin/settings/index.html.erb @@ -1,68 +1,97 @@

    <%= t("admin.settings.index.title") %>

    -
      - <% @settings.each do |setting| %> -
    • - <%= t("settings.#{setting.key}") %> - - <%= 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 %> -
    • - <% end %> -
    +
    <%= organization.name %><%= organization.email %><%= organization.phone_number %><%= organization.responsible_name %>

    <%= organization.name %>

    <%= organization.email %>

    <%= organization.phone_number %>

    <%= organization.responsible_name %>

    + <%= t("admin.organizations.index.verified") %> <%= 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" %> + <%= t("admin.organizations.index.rejected") %> <%= 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" %> + <%= 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" %> - + 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 %>
    + + <% @settings.each do |setting| %> + + + + + <% end %> + +
    + <%= t("settings.#{setting.key}") %> + + <%= 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 expanded") %> +
    + <% end %> +

    <%= t("admin.settings.index.feature_flags") %>

    -
      - <% @feature_flags.each do |feature_flag| %> -
    • - <%= t("settings.#{feature_flag.key}") %> + + + <% @feature_flags.each do |feature_flag| %> + + -
      - <%= feature_flag.enabled? ? t("admin.settings.index.features.enabled") : t("admin.settings.index.features.disabled") %> -
      +
      - <%= form_for(feature_flag, url: admin_setting_path(feature_flag), html: { id: "edit_#{dom_id(feature_flag)}"}) do |f| %> + + + <% end %> + +
      + <%= t("settings.#{feature_flag.key}") %> + + <%= feature_flag.enabled? ? t("admin.settings.index.features.enabled") : t("admin.settings.index.features.disabled") %> + + <%= 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 %> - - <% end %> - + <%= 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 %> +
      <% if @banner_styles.present? %>

      <%= t("admin.settings.index.banners") %>

      -
        + + <% @banner_styles.each do |setting| %> -
      • - <%= t("settings.#{setting.key}") %> +
      • + - <%= 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 %> - + + <% end %> - -<% end %> + +
        + <%= t("settings.#{setting.key}") %> + + <%= 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 %> +
        +<% end %> <% if @banner_imgs.present?%>

        <%= t("admin.settings.index.banner_imgs") %>

        -
          - <% @banner_imgs.each do |setting| %> -
        • - <%= t("settings.#{setting.key}") %> + + + <% @banner_imgs.each do |setting| %> + + - <%= 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 %> - + + <% end %> - + +
          + <%= t("settings.#{setting.key}") %> + + <%= 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 %> +
          <% end %> diff --git a/app/views/admin/tags/index.html.erb b/app/views/admin/tags/index.html.erb index 5e5ca5c99..c1eda4b30 100644 --- a/app/views/admin/tags/index.html.erb +++ b/app/views/admin/tags/index.html.erb @@ -22,29 +22,29 @@

          <%= t("admin.tags.index.title") %>: <%= page_entries_info @tags %>

          -
            + <% @tags.each do |tag| %> -
          • - <%= tag.name %> +
          • + + <% end %> - +
            + <%= 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| %> + + <%= tag.name %> + <%= 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" %> + <%= t("admin.tags.mark_as_featured") %> + <% end %> + - - <%= 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" %> - <%= t("admin.tags.mark_as_featured") %> - <% end %> - - - <%= 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 %> - + <%= 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 %> +
            <%= paginate @tags %> diff --git a/app/views/admin/users/index.html.erb b/app/views/admin/users/index.html.erb index a575bdef2..336443055 100644 --- a/app/views/admin/users/index.html.erb +++ b/app/views/admin/users/index.html.erb @@ -4,25 +4,29 @@

            <%= page_entries_info @users %>

            -
              + <% @users.each do |user| %> -
            • - <%= link_to user.name, admin_user_path(user) %> +
            • + - <%= 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 %> - + + <% end %> - +
              +

              <%= link_to user.name, admin_user_path(user) %>

              +
              + <%= 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 %> +
              <%= paginate @users %> diff --git a/app/views/admin/users/show.html.erb b/app/views/admin/users/show.html.erb index 7fba928b3..1a6ab9795 100644 --- a/app/views/admin/users/show.html.erb +++ b/app/views/admin/users/show.html.erb @@ -1,3 +1,5 @@ +<%= render 'shared/back_link' %> +

              <%= t("admin.users.show.title", user: @user.name) %>

              @@ -5,37 +7,33 @@ <%= t("admin.users.show.registered_at") %> <%= @user.confirmed_at %> | <%= t("admin.users.show.hidden_at") %> <%= @user.hidden_at %>

              -

              - <%= link_to t("admin.users.show.back"), admin_users_path, - class: "button small secondary" %> -

              <% if @debates.present? %>

              <%= page_entries_info @debates %>

              <% end %> -
                -<% @debates.each do |debate| %> -
              • - <%= link_to debate.title, debate_path(debate) %> -
              • -<% end %> -
              + + <% @debates.each do |debate| %> + + + + <% end %> +
              + <%= link_to debate.title, debate_path(debate) %> +
              <% if @comments.present? %>

              <%= page_entries_info @comments %>

              <% end %> -
                -<% @comments.each do |comment| %> -
              • -
                -
                - <%= text_with_links comment.body %> -
                -
                -
              • -<% end %> -
              + + <% @comments.each do |comment| %> + + + + <% end %> +
              + <%= text_with_links comment.body %> +
              <%= paginate [@debates, @comments].sort_by {|x| x.size}.last %> diff --git a/app/views/admin/valuators/_valuator.html.erb b/app/views/admin/valuators/_valuator.html.erb index 0c64fcef0..e5971391b 100644 --- a/app/views/admin/valuators/_valuator.html.erb +++ b/app/views/admin/valuators/_valuator.html.erb @@ -1,12 +1,16 @@ -

              <%= t('admin.valuators.valuator.user_found') %>:

              -
              -
              -

              - <%= valuator.name %> -  •  - <%= valuator.email %> -

              -
              +
              +

              <%= t('admin.valuators.valuator.user_found') %>

              + + + + + + +
              + <%= valuator.name %> + + <%= valuator.email %> +
              <% unless @valuator.persisted? %> <%= form_for @valuator, url: admin_valuators_path do |f| %> @@ -21,4 +25,4 @@
              <% end %> <% end %> -
              \ No newline at end of file +
diff --git a/app/views/admin/valuators/index.html.erb b/app/views/admin/valuators/index.html.erb index f3abe5e03..30132e66f 100644 --- a/app/views/admin/valuators/index.html.erb +++ b/app/views/admin/valuators/index.html.erb @@ -1,30 +1,36 @@

<%= t("admin.valuators.index.title") %>

+
-
- <%= form_tag search_admin_valuators_path, method: :get, remote: true do %> -
- <%= text_field_tag :email, '', placeholder: t('admin.valuators.search.email_placeholder') %> -
-
- <%= submit_tag t('admin.valuators.search.search'), class: 'button radius' %> -
- <% end %> -
-
-
-

<%= page_entries_info @valuators %>

-
    - <% @valuators.each do |valuator| %> -
  • - <%= valuator.name %> -  •  - <%= valuator.email %> - <% if valuator.description.present? %> -  •  - <%= valuator.description %> - <% end %> -
  • + <%= form_tag search_admin_valuators_path, method: :get, remote: true do %> +
    + <%= text_field_tag :email, '', placeholder: t('admin.valuators.search.email_placeholder') %> +
    +
    + <%= submit_tag t('admin.valuators.search.search'), class: 'button radius' %> +
    <% end %> -
+
+ +
+ +

<%= page_entries_info @valuators %>

+ + + <% @valuators.each do |valuator| %> + + + + + + <% end %> +
+ <%= valuator.name %> + + <%= valuator.email %> + + <% if valuator.description.present? %> + <%= valuator.description %> + <% end %> +
<%= paginate @valuators %> diff --git a/app/views/admin/valuators/summary.html.erb b/app/views/admin/valuators/summary.html.erb index 6de304cb1..81cbc54d4 100644 --- a/app/views/admin/valuators/summary.html.erb +++ b/app/views/admin/valuators/summary.html.erb @@ -1,7 +1,4 @@ -<%= link_to admin_spending_proposals_path, class: "back" do %> - - <%= t("shared.back") %> -<% end %> +<%= render 'shared/back_link' %>

<%= t("admin.valuators.summary.title") %>

diff --git a/app/views/admin/valuators/user_not_found.js.erb b/app/views/admin/valuators/user_not_found.js.erb index 1425577f4..af3f83a3f 100644 --- a/app/views/admin/valuators/user_not_found.js.erb +++ b/app/views/admin/valuators/user_not_found.js.erb @@ -1 +1 @@ -$("#search-result").html("

<%= j t('admin.valuators.search.user_not_found') %>

"); +$("#search-result").html("
<%= j t('admin.valuators.search.user_not_found') %>
"); diff --git a/app/views/admin/verifications/index.html.erb b/app/views/admin/verifications/index.html.erb index 429972ba1..97cca3a4e 100644 --- a/app/views/admin/verifications/index.html.erb +++ b/app/views/admin/verifications/index.html.erb @@ -4,13 +4,17 @@

<%= page_entries_info @users %>

- + + <% @users.each do |user| %> + + + + + <% end %> +
+ <%= link_to user.name, admin_user_path(user) %> + + <%= render "pending_step", user: user %> +
<%= paginate @users %> \ No newline at end of file diff --git a/app/views/layouts/admin.html.erb b/app/views/layouts/admin.html.erb index dc2de2862..9364e066a 100644 --- a/app/views/layouts/admin.html.erb +++ b/app/views/layouts/admin.html.erb @@ -14,20 +14,39 @@ - <%= render 'layouts/admin_header' %> +
+
+
-
-
- <%= side_menu %> + + + <%= side_menu %> +
+ +
+ <%= render 'layouts/admin_header' %> + +
+
+ +
+ +
+ +
+ <%= side_menu %> +
+
+ +
+ <%= render 'layouts/flash' %> + <%= yield %> +
+
+
- -
- - <%= render 'layouts/flash' %> - - <%= yield %> -
- - +
diff --git a/config/locales/admin.en.yml b/config/locales/admin.en.yml index 6f39b76bb..ec3542c2c 100755 --- a/config/locales/admin.en.yml +++ b/config/locales/admin.en.yml @@ -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 one organisation with no users or with a hidden user. + other: There are %{count} organisations 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 diff --git a/config/locales/admin.es.yml b/config/locales/admin.es.yml index 27369e012..eef5ce10e 100644 --- a/config/locales/admin.es.yml +++ b/config/locales/admin.es.yml @@ -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 una organización sin usuario o con el usuario bloqueado. + other: Hay %{count} organizaciones 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