From ae206648a6f5a7e996ff7f07a035cbc52b6fa9e4 Mon Sep 17 00:00:00 2001 From: decabeza Date: Thu, 19 Oct 2017 16:37:44 +0200 Subject: [PATCH 01/18] improves styles for admin administrators views --- .../administrators/_administrator.html.erb | 55 ++++++------ app/views/admin/administrators/index.html.erb | 84 +++++++++++-------- .../administrators/user_not_found.js.erb | 2 +- config/locales/en/admin.yml | 5 +- config/locales/es/admin.yml | 5 +- 5 files changed, 86 insertions(+), 65 deletions(-) diff --git a/app/views/admin/administrators/_administrator.html.erb b/app/views/admin/administrators/_administrator.html.erb index d948e1eed..de480597d 100644 --- a/app/views/admin/administrators/_administrator.html.erb +++ b/app/views/admin/administrators/_administrator.html.erb @@ -1,26 +1,29 @@ -
- - - - - - - - -
- <%= administrator.name %> - - <%= administrator.email %> - - <% if administrator.persisted? %> - <%= link_to t('admin.administrators.administrator.delete'), - admin_administrator_path(administrator), - method: :delete, - class: "button hollow alert" %> - <% else %> - <%= link_to t('admin.administrators.administrator.add'),{ controller: "admin/administrators", action: :create, user_id: administrator.user_id }, - method: :post, - class: "button success" %> - <% end %> -
-
+ + + + + + + + + + + + + +
<%= t("admin.administrators.index.name") %><%= t("admin.administrators.index.email") %><%= t("admin.shared.actions") %>
+ <%= administrator.name %> + + <%= administrator.email %> + + <% if administrator.persisted? %> + <%= link_to t('admin.administrators.administrator.delete'), + admin_administrator_path(administrator), + method: :delete, + class: "button hollow alert expanded" %> + <% else %> + <%= link_to t('admin.administrators.administrator.add'),{ controller: "admin/administrators", action: :create, user_id: administrator.user_id }, + method: :post, + class: "button success expanded" %> + <% end %> +
diff --git a/app/views/admin/administrators/index.html.erb b/app/views/admin/administrators/index.html.erb index 1cfbf5079..a98d46618 100644 --- a/app/views/admin/administrators/index.html.erb +++ b/app/views/admin/administrators/index.html.erb @@ -1,46 +1,58 @@ -

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

+

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

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

<%= page_entries_info @administrators %>

+<% if @administrators.any? %> +

<%= page_entries_info @administrators %>

- - <% @administrators.each do |administrator| %> - - - - - - <% end %> -
- <%= administrator.name %> - - <%= administrator.email %> - - <% if administrator.persisted? %> - <%= link_to t('admin.administrators.administrator.delete'), - admin_administrator_path(administrator), - method: :delete, - class: "button hollow alert" - %> - <% else %> - <%= link_to t('admin.administrators.administrator.add'), - { controller: "admin/administrators", action: :create, - user_id: administrator.user_id }, - method: :post, - class: "button success" %> - <% end %> -
+ + + + + + + <% @administrators.each do |administrator| %> + + + + + + <% end %> +
<%= t("admin.administrators.index.name") %><%= t("admin.administrators.index.email") %><%= t("admin.shared.actions") %>
+ <%= administrator.name %> + + <%= administrator.email %> + + <% if administrator.persisted? %> + <%= link_to t('admin.administrators.administrator.delete'), + admin_administrator_path(administrator), + method: :delete, + class: "button hollow alert expanded" + %> + <% else %> + <%= link_to t('admin.administrators.administrator.add'), + { controller: "admin/administrators", action: :create, + user_id: administrator.user_id }, + method: :post, + class: "button success expanded" %> + <% end %> +
-<%= paginate @administrators %> + <%= paginate @administrators %> +<% else %> +
+ <%= t("admin.administrators.index.no_administrators") %> +
+<% end %> diff --git a/app/views/admin/administrators/user_not_found.js.erb b/app/views/admin/administrators/user_not_found.js.erb index ba707fc9d..8e979e667 100644 --- a/app/views/admin/administrators/user_not_found.js.erb +++ b/app/views/admin/administrators/user_not_found.js.erb @@ -1 +1 @@ -$("#search-result").html("
<%= j t('admin.administrators.search.user_not_found') %>
"); +$("#search-result").html("
<%= j t('admin.administrators.search.user_not_found') %>
"); diff --git a/config/locales/en/admin.yml b/config/locales/en/admin.yml index 38abe6f56..c0111dea9 100644 --- a/config/locales/en/admin.yml +++ b/config/locales/en/admin.yml @@ -432,6 +432,9 @@ en: administrators: index: title: Administrators + name: Name + email: Email + no_administrators: There are no administrators. administrator: add: Add delete: Delete @@ -439,7 +442,7 @@ en: search: email_placeholder: Search user by email search: Search - user_not_found: User not found + user_not_found: User not found. moderators: index: title: Moderators diff --git a/config/locales/es/admin.yml b/config/locales/es/admin.yml index 3336cdc5b..5cb7badff 100644 --- a/config/locales/es/admin.yml +++ b/config/locales/es/admin.yml @@ -382,6 +382,9 @@ es: administrators: index: title: Administradores + name: Nombre + email: Email + no_administrators: No hay administradores. administrator: add: Añadir como Administrador delete: Borrar @@ -389,7 +392,7 @@ es: search: email_placeholder: Buscar usuario por email search: Buscar - user_not_found: Usuario no encontrado + user_not_found: Usuario no encontrado. managers: index: title: Gestores From f17d0a663ee8d96edb459306c5cec1f68ce78009 Mon Sep 17 00:00:00 2001 From: decabeza Date: Thu, 19 Oct 2017 18:52:04 +0200 Subject: [PATCH 02/18] improves styles for admin organizations views --- app/views/admin/organizations/index.html.erb | 116 ++++++++++-------- app/views/admin/organizations/search.html.erb | 112 +++++++++-------- config/locales/en/admin.yml | 8 ++ config/locales/es/admin.yml | 8 ++ 4 files changed, 142 insertions(+), 102 deletions(-) diff --git a/app/views/admin/organizations/index.html.erb b/app/views/admin/organizations/index.html.erb index 0ddee4247..b5de10c32 100644 --- a/app/views/admin/organizations/index.html.erb +++ b/app/views/admin/organizations/index.html.erb @@ -1,67 +1,79 @@

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

- -<%= form_for(Organization.new, url: search_admin_organizations_path, method: :get) do |f| %> -
-
+
+ <%= form_for(Organization.new, url: search_admin_organizations_path, method: :get) do |f| %> +
<%= text_field_tag :term, "", placeholder: t("admin.organizations.index.search_placeholder") %> + +
+ <%= f.submit t("admin.organizations.index.search"), class: "button" %> +
-
- <%= f.submit t("admin.organizations.index.search"), class: "button success" %> -
-
-<% end %> - + <% end %> +
<%= render 'shared/filter_subnav', i18n_namespace: "admin.organizations.index" %> -

<%= page_entries_info @organizations %>

+<% if @organizations.any? %> +

<%= page_entries_info @organizations %>

- - <% hidden = 0 %> - <% @organizations.each do |organization| %> - <% hidden += 1 and next if organization.user.nil? || organization.user.hidden? %> - - - - - - <% if organization.verified? %> - - <% end %> - <% if can? :verify, organization %> +

<%= organization.name %>

<%= organization.email %>

<%= organization.phone_number %>

<%= organization.responsible_name %>

- - <%= t("admin.organizations.index.verified") %> -
+ <% hidden = 0 %> + + + + + + + + + + <% @organizations.each do |organization| %> + <% hidden += 1 and next if organization.user.nil? || organization.user.hidden? %> + + + + + - <% end %> - <% if organization.rejected? %> - - <% end %> - <% if can? :reject, organization %> - <% end %> - -<% end %> -
<%= t("admin.organizations.index.name") %><%= t("admin.organizations.index.email") %><%= t("admin.organizations.index.phone_number") %><%= t("admin.organizations.index.responsible_name") %><%= t("admin.shared.status") %><%= t("admin.shared.actions") %>
<%= organization.name %><%= organization.email %><%= organization.phone_number %><%= organization.responsible_name %> - <%= link_to t("admin.organizations.index.verify"), - verify_admin_organization_path(organization, request.query_parameters), - method: :put, class: "button success expanded" - %> + <% if organization.verified? %> + + <%= t("admin.organizations.index.verified") %> + <% elsif organization.rejected? %> + + <%= t("admin.organizations.index.rejected") %> + <% else %> + + <%= t("admin.organizations.index.pending") %> + <% end %> - - <%= t("admin.organizations.index.rejected") %> - - <%= link_to t("admin.organizations.index.reject"), - reject_admin_organization_path(organization, request.query_parameters), - method: :put, class: "button hollow alert expanded" - %> -
+ <% if can? :verify, organization %> + <%= link_to t("admin.organizations.index.verify"), + verify_admin_organization_path(organization, request.query_parameters), + method: :put, class: "button success small-5" %> + <% end %> -<% if hidden > 0 %> + <% if can? :reject, organization %> + <%= link_to t("admin.organizations.index.reject"), + reject_admin_organization_path(organization, request.query_parameters), + method: :put, class: "button hollow alert small-5"%> + <% end %> + + + <% end %> + + + + <% if hidden > 0 %> +
+ <%= t("admin.organizations.index.hidden_count_html", count: hidden) %> +
+ <% end %> + + <%= paginate @organizations %> +<% else %>
- <%= t("admin.organizations.index.hidden_count_html", count: hidden) %> + <%= t("admin.organizations.index.no_organizations") %>
<% end %> - -<%= paginate @organizations %> diff --git a/app/views/admin/organizations/search.html.erb b/app/views/admin/organizations/search.html.erb index 5b5071c5b..3b40764a9 100644 --- a/app/views/admin/organizations/search.html.erb +++ b/app/views/admin/organizations/search.html.erb @@ -1,56 +1,68 @@

<%= t("admin.organizations.search.title") %>

- -<%= form_for(Organization.new, url: search_admin_organizations_path, method: :get) do |f| %> -
-
+
+ <%= form_for(Organization.new, url: search_admin_organizations_path, method: :get) do |f| %> +
<%= text_field_tag :term, "", placeholder: t("admin.organizations.index.search_placeholder") %> +
+ <%= f.submit t("admin.organizations.index.search"), class: "button" %> +
-
- <%= f.submit t("admin.organizations.index.search"), class: "button success" %> -
+ <% end %> +
+ +<% if @organizations.any? %> +

<%= page_entries_info @organizations %>

+ + + + + + + + + + + + <% @organizations.each do |organization| %> + + + + + + + + + <% end %> + +
<%= t("admin.organizations.index.name") %><%= t("admin.organizations.index.email") %><%= t("admin.organizations.index.phone_number") %><%= t("admin.organizations.index.responsible_name") %><%= t("admin.shared.status") %><%= t("admin.shared.actions") %>
<%= organization.name %><%= organization.email %><%= organization.phone_number %><%= organization.responsible_name %> + <% if organization.verified? %> + + <%= t("admin.organizations.index.verified") %> + <% elsif organization.rejected? %> + + <%= t("admin.organizations.index.rejected") %> + <% else %> + + <%= t("admin.organizations.index.pending") %> + <% end %> + + <% if can? :verify, organization %> + <%= link_to t("admin.organizations.index.verify"), + verify_admin_organization_path(organization, request.query_parameters), + method: :put, class: "button success small-5" %> + <% end %> + + <% if can? :reject, organization %> + <%= link_to t("admin.organizations.index.reject"), + reject_admin_organization_path(organization, request.query_parameters), + method: :put, class: "button hollow alert small-5" %> + <% end %> +
+ + <%= paginate @organizations %> +<% else %> +
+ <%= t("admin.organizations.search.no_results") %>
<% end %> - - -

<%= page_entries_info @organizations %>

- - - <% @organizations.each do |organization| %> - - - - - - <% if organization.verified? %> - - <% end %> - <% if can? :verify, organization %> - - <% end %> - <% if organization.rejected? %> - - <% end %> - <% if can? :reject, organization %> - - <% end %> - -<% end %> -

<%= 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 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 hollow alert expanded" - %> -
- -<%= paginate @organizations %> \ No newline at end of file diff --git a/config/locales/en/admin.yml b/config/locales/en/admin.yml index c0111dea9..e085bc1a9 100644 --- a/config/locales/en/admin.yml +++ b/config/locales/en/admin.yml @@ -712,6 +712,12 @@ en: 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. + name: Name + email: Email + phone_number: Phone + responsible_name: Responsible + status: Status + no_organizations: There are no organizations. reject: Reject rejected: Rejected search: Search @@ -719,8 +725,10 @@ en: title: Organisations verified: Verified verify: Verify + pending: Pending search: title: Search Organisations + no_results: No organizations found. proposals: index: filter: Filter diff --git a/config/locales/es/admin.yml b/config/locales/es/admin.yml index 5cb7badff..bcd6fe5eb 100644 --- a/config/locales/es/admin.yml +++ b/config/locales/es/admin.yml @@ -714,6 +714,12 @@ es: 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. + name: Nombre + email: Email + phone_number: Teléfono + responsible_name: Responsable + status: Estado + no_organizations: No hay organizaciones. reject: Rechazar rejected: Rechazada search: Buscar @@ -721,8 +727,10 @@ es: title: Organizaciones verified: Verificada verify: Verificar + pending: Pendiente search: title: Buscar Organizaciones + no_results: No se han encontrado organizaciones. proposals: index: filter: Filtro From bb7040359dabb6d845fcfdbb00b70fa0e93b9fc2 Mon Sep 17 00:00:00 2001 From: decabeza Date: Thu, 19 Oct 2017 19:09:57 +0200 Subject: [PATCH 03/18] fixes i18n key name --- app/views/admin/organizations/index.html.erb | 2 +- app/views/admin/organizations/search.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/admin/organizations/index.html.erb b/app/views/admin/organizations/index.html.erb index b5de10c32..f69b1448e 100644 --- a/app/views/admin/organizations/index.html.erb +++ b/app/views/admin/organizations/index.html.erb @@ -24,7 +24,7 @@ <%= t("admin.organizations.index.email") %> <%= t("admin.organizations.index.phone_number") %> <%= t("admin.organizations.index.responsible_name") %> - <%= t("admin.shared.status") %> + <%= t("admin.organizations.index.status") %> <%= t("admin.shared.actions") %> diff --git a/app/views/admin/organizations/search.html.erb b/app/views/admin/organizations/search.html.erb index 3b40764a9..01b5420bd 100644 --- a/app/views/admin/organizations/search.html.erb +++ b/app/views/admin/organizations/search.html.erb @@ -20,7 +20,7 @@ <%= t("admin.organizations.index.email") %> <%= t("admin.organizations.index.phone_number") %> <%= t("admin.organizations.index.responsible_name") %> - <%= t("admin.shared.status") %> + <%= t("admin.organizations.index.status") %> <%= t("admin.shared.actions") %> From 3c20ba0688136f16fe888b719aabdca924393494 Mon Sep 17 00:00:00 2001 From: decabeza Date: Thu, 19 Oct 2017 19:56:22 +0200 Subject: [PATCH 04/18] improve styles for admin officials views --- app/views/admin/officials/edit.html.erb | 18 +++--- app/views/admin/officials/index.html.erb | 58 +++++++++++------ app/views/admin/officials/search.html.erb | 68 ++++++++++++++------ app/views/admin/shared/_user_search.html.erb | 18 +++--- config/locales/en/admin.yml | 5 ++ config/locales/es/admin.yml | 5 ++ 6 files changed, 114 insertions(+), 58 deletions(-) diff --git a/app/views/admin/officials/edit.html.erb b/app/views/admin/officials/edit.html.erb index 4696ea4de..5a17d2445 100644 --- a/app/views/admin/officials/edit.html.erb +++ b/app/views/admin/officials/edit.html.erb @@ -1,20 +1,22 @@ -<%= back_link_to %> +<%= back_link_to admin_officials_path %>
-
<%= @user.name %> (<%= @user.email %>)
-

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

-
-
+
+ <%= @user.name %>
+ <%= @user.email %> +
+ +
<%= form_for @user, url: admin_official_path(@user) do |f| %> <%= f.text_field :official_position %> <%= f.select :official_level, official_level_options %> + <%= f.submit class: "button" %> <% if @user.official? %> - <%= link_to t("admin.officials.edit.destroy"), admin_official_path(@user), method: :delete, class: 'button hollow alert' %> +
+ <%= link_to t("admin.officials.edit.destroy"), admin_official_path(@user), method: :delete, class: 'delete' %> <% end %> - <%= f.submit class: "button hollow" %> <% end %> -
diff --git a/app/views/admin/officials/index.html.erb b/app/views/admin/officials/index.html.erb index 078d5bbbc..f4cbdd06c 100644 --- a/app/views/admin/officials/index.html.erb +++ b/app/views/admin/officials/index.html.erb @@ -2,26 +2,42 @@ <%= render 'admin/shared/user_search', url: search_admin_officials_path %> -

<%= page_entries_info @officials %>

+<% if @officials.any? %> +

<%= page_entries_info @officials %>

- - <% @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" %> -
+ + + + + + + + + <% @officials.each do |official| %> + + + + + + + <% end %> + +
<%= t("admin.officials.index.name") %><%= t("admin.officials.index.official_position") %><%= t("admin.officials.index.official_level") %><%= t("admin.shared.actions") %>
+ <%= 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 expanded" %> +
-<%= paginate @officials %> + <%= paginate @officials %> +<% else %> +
+ <%= t("admin.officials.index.no_officials") %> +
+<% end %> diff --git a/app/views/admin/officials/search.html.erb b/app/views/admin/officials/search.html.erb index f2d90c143..e2a067c9d 100644 --- a/app/views/admin/officials/search.html.erb +++ b/app/views/admin/officials/search.html.erb @@ -2,24 +2,52 @@ <%= render 'admin/shared/user_search', url: search_admin_officials_path %> -

<%= page_entries_info @users %>

+<% if @users.any? %> - - <% @users.each do |user| %> - - - - - - <% 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" %> -
+

<%= page_entries_info @users %>

+ + + + + + + + + + <% @users.each do |user| %> + + + + + + + <% end %> + +
<%= t("admin.officials.index.name") %><%= t("admin.officials.index.official_position") %><%= t("admin.officials.index.official_level") %><%= t("admin.shared.actions") %>
+ <%= link_to user.name, edit_admin_official_path(user) %> + + <% if user.official? %> + + <%= user.official_position %> + + <% else %> + <%= t("admin.officials.level_0") %> + <% end %> + + <%= t("admin.officials.level_#{user.official_level}") %> + + <% if user.official? %> + <%= link_to t("admin.officials.search.edit_official"), + edit_admin_official_path(user), + class: "button hollow expanded" %> + <% else %> + <%= link_to t("admin.officials.search.make_official"), + edit_admin_official_path(user), + class: "button expanded" %> + <% end %> +
+<% else %> +
+ <%= t("admin.officials.search.no_results") %> +
+<% end %> \ No newline at end of file diff --git a/app/views/admin/shared/_user_search.html.erb b/app/views/admin/shared/_user_search.html.erb index a964ce549..c553052c2 100644 --- a/app/views/admin/shared/_user_search.html.erb +++ b/app/views/admin/shared/_user_search.html.erb @@ -1,10 +1,10 @@ -<%= form_for(User.new, url: url, as: :user, method: :get) do |f| %> -
-
- <%= text_field_tag :name_or_email, "", placeholder: t("admin.shared.user_search.placeholder") %> +
+ <%= form_for(User.new, url: url, as: :user, method: :get) do |f| %> +
+ <%= text_field_tag :name_or_email, "", placeholder: t("admin.shared.user_search.placeholder") %> +
+ <%= f.submit t("admin.shared.user_search.button"), class: "button" %> +
-
- <%= f.submit t("admin.shared.user_search.button"), class: "button success" %> -
-
-<% end %> \ No newline at end of file + <% end %> +
diff --git a/config/locales/en/admin.yml b/config/locales/en/admin.yml index e085bc1a9..a6a407a41 100644 --- a/config/locales/en/admin.yml +++ b/config/locales/en/admin.yml @@ -691,6 +691,10 @@ en: official_updated: Details of official saved index: title: Officials + no_officials: There are no officials. + name: Nombre + official_position: Official position + official_level: Level level_0: Not official level_1: Level 1 level_2: Level 2 @@ -701,6 +705,7 @@ en: edit_official: Edit official make_official: Make official title: 'Official positions: User search' + no_results: Official positions not found. organizations: index: filter: Filter diff --git a/config/locales/es/admin.yml b/config/locales/es/admin.yml index bcd6fe5eb..503cdafc3 100644 --- a/config/locales/es/admin.yml +++ b/config/locales/es/admin.yml @@ -693,6 +693,10 @@ es: official_updated: Datos del cargo público guardados index: title: Cargos Públicos + no_officials: No hay cargos públicos. + name: Nombre + official_position: Cargo público + official_level: Nivel level_0: No es cargo público level_1: Nivel 1 level_2: Nivel 2 @@ -703,6 +707,7 @@ es: edit_official: Editar cargo público make_official: Convertir en cargo público title: 'Cargos Públicos: Búsqueda de usuarios' + no_results: No se han encontrado cargos públicos. organizations: index: filter: Filtro From fc44abae5ab814e31ebc87c8c3831e8b7c6b8b16 Mon Sep 17 00:00:00 2001 From: decabeza Date: Thu, 19 Oct 2017 20:06:08 +0200 Subject: [PATCH 05/18] improves styles for admin moderators views --- .../admin/moderators/_moderator.html.erb | 56 +++++++------ app/views/admin/moderators/index.html.erb | 84 +++++++++++-------- .../admin/moderators/user_not_found.js.erb | 2 +- config/locales/en/admin.yml | 3 + config/locales/es/admin.yml | 3 + 5 files changed, 86 insertions(+), 62 deletions(-) diff --git a/app/views/admin/moderators/_moderator.html.erb b/app/views/admin/moderators/_moderator.html.erb index 57a29d2e8..c69b559fc 100644 --- a/app/views/admin/moderators/_moderator.html.erb +++ b/app/views/admin/moderators/_moderator.html.erb @@ -1,26 +1,30 @@ -
- - - - - - - - -
- <%= 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 %> -
-
+ + + + + + + + + + + + + + +
<%= t("admin.moderators.index.name") %><%= t("admin.moderators.index.email") %><%= t("admin.shared.actions") %>
+ <%= moderator.name %> + + <%= moderator.email %> + + <% if moderator.persisted? %> + <%= link_to t('admin.moderators.moderator.delete'), + admin_moderator_path(moderator), + method: :delete, + class: "button hollow alert expanded" %> + <% else %> + <%= link_to t('admin.moderators.moderator.add'),{ controller: "admin/moderators", action: :create, user_id: moderator.user_id }, + method: :post, + class: "button success expanded" %> + <% end %> +
diff --git a/app/views/admin/moderators/index.html.erb b/app/views/admin/moderators/index.html.erb index 0fc8703fd..d6a9b50bb 100644 --- a/app/views/admin/moderators/index.html.erb +++ b/app/views/admin/moderators/index.html.erb @@ -2,47 +2,61 @@

<%= 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' %> +
+ <%= submit_tag t('admin.moderators.search.search'), class: 'button' %> +
<% end %>
-
+
-

<%= page_entries_info @moderators %>

+<% if @moderators.any? %> - - <% @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 %> -
+

<%= page_entries_info @moderators %>

-<%= paginate @moderators %> + + + + + + + + <% @moderators.each do |moderator| %> + + + + + + <% end %> + +
<%= t("admin.moderators.index.name") %><%= t("admin.moderators.index.email") %><%= t("admin.shared.actions") %>
+ <%= moderator.name %> + + <%= moderator.email %> + + <% if moderator.persisted? %> + <%= link_to t('admin.moderators.moderator.delete'), + admin_moderator_path(moderator), + method: :delete, + class: "button hollow alert expanded" + %> + <% else %> + <%= link_to t('admin.moderators.moderator.add'), + { controller: "admin/moderators", action: :create, + user_id: moderator.user_id }, + method: :post, + class: "button success expanded" %> + <% end %> +
+ + <%= paginate @moderators %> +<% else %> +
+ <%= t("admin.moderators.index.no_moderators") %> +
+<% end %> diff --git a/app/views/admin/moderators/user_not_found.js.erb b/app/views/admin/moderators/user_not_found.js.erb index a8573236c..9667d81ed 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/config/locales/en/admin.yml b/config/locales/en/admin.yml index a6a407a41..ff1d83cd9 100644 --- a/config/locales/en/admin.yml +++ b/config/locales/en/admin.yml @@ -446,6 +446,9 @@ en: moderators: index: title: Moderators + name: Name + email: Email + no_moderators: There are no moderators. moderator: add: Add delete: Delete diff --git a/config/locales/es/admin.yml b/config/locales/es/admin.yml index 503cdafc3..af3ef5830 100644 --- a/config/locales/es/admin.yml +++ b/config/locales/es/admin.yml @@ -446,6 +446,9 @@ es: moderators: index: title: Moderadores + name: Nombre + email: Email + no_moderators: No hay moderadores. moderator: add: Añadir como Moderador delete: Borrar From c333522b47f6c9901963ed0b73cd86d125b1176e Mon Sep 17 00:00:00 2001 From: decabeza Date: Fri, 20 Oct 2017 10:40:07 +0200 Subject: [PATCH 06/18] improves styles for admin activity views --- app/helpers/admin_helper.rb | 2 +- app/views/admin/_menu.html.erb | 2 +- app/views/admin/activity/show.html.erb | 87 +++++++++++++++----------- config/locales/en/admin.yml | 1 + config/locales/es/admin.yml | 3 +- 5 files changed, 55 insertions(+), 40 deletions(-) diff --git a/app/helpers/admin_helper.rb b/app/helpers/admin_helper.rb index e508cf813..37a186ff1 100644 --- a/app/helpers/admin_helper.rb +++ b/app/helpers/admin_helper.rb @@ -29,7 +29,7 @@ module AdminHelper end def menu_profiles? - ["administrators", "organizations", "officials", "moderators", "valuators", "managers", "users"].include? controller_name + ["administrators", "organizations", "officials", "moderators", "valuators", "managers", "users", "activity"].include? controller_name end def menu_banners? diff --git a/app/views/admin/_menu.html.erb b/app/views/admin/_menu.html.erb index f2af2c116..b573f6b41 100644 --- a/app/views/admin/_menu.html.erb +++ b/app/views/admin/_menu.html.erb @@ -115,7 +115,7 @@ <%= link_to t("admin.menu.officials"), admin_officials_path %> -
  • > +
  • > <%= link_to t('admin.menu.moderators'), admin_moderators_path%>
  • diff --git a/app/views/admin/activity/show.html.erb b/app/views/admin/activity/show.html.erb index 92ff3e26a..dd4cee125 100644 --- a/app/views/admin/activity/show.html.erb +++ b/app/views/admin/activity/show.html.erb @@ -1,43 +1,56 @@ +<%= back_link_to admin_moderators_path %> +

    <%= t("admin.activity.show.title") %>

    <%= render 'shared/filter_subnav', i18n_namespace: "admin.activity.show" %> -

    <%= page_entries_info @activity %>

    +<% if @activity.any? %> +

    <%= page_entries_info @activity %>

    - - - - - - - - <% @activity.each do |activity| %> - - - - - - - <% end %> -
    <%= t("admin.activity.show.type") %><%= t("admin.activity.show.action") %><%= t("admin.activity.show.content") %><%= t("admin.activity.show.by") %>
    - <%= activity.actionable_type.constantize.model_name.human %>
    - <%= l activity.actionable.created_at.to_date %> -
    - <%= t("admin.activity.show.actions.#{activity.action}") %>
    - <%= l activity.created_at.to_date %> -
    - <% case activity.actionable_type %> - <% when "User" %> - <%= activity.actionable.username %> (<%= activity.actionable.email %>) - <% when "Comment" %> - <%= activity.actionable.body %> - <% else %> - <%= activity.actionable.title %> -
    -
    - <%= activity.actionable.description %> -
    - <% end %> -
    <%= activity.user.name %> (<%= activity.user.email %>)
    + + + + + + + + + + + <% @activity.each do |activity| %> + + + + + + <% end %> + +
    <%= t("admin.activity.show.type") %><%= t("admin.activity.show.action") %><%= t("admin.activity.show.content") %><%= t("admin.activity.show.by") %>
    + <%= activity.actionable_type.constantize.model_name.human %>
    + <%= l activity.actionable.created_at.to_date %> +
    + <%= t("admin.activity.show.actions.#{activity.action}") %>
    + <%= l activity.created_at.to_date %> +
    + <% case activity.actionable_type %> + <% when "User" %> + <%= activity.actionable.username %> (<%= activity.actionable.email %>) + <% when "Comment" %> + <%= activity.actionable.body %> + <% else %> + <%= activity.actionable.title %> +
    +
    + <%= activity.actionable.description %> +
    + <% end %> +
    + <%= activity.user.name %> (<%= activity.user.email %>) +
    -<%= paginate @activity %> + <%= paginate @activity %> +<% else %> +
    + <%= t("admin.activity.show.no_activity") %> +
    +<% end %> diff --git a/config/locales/en/admin.yml b/config/locales/en/admin.yml index ff1d83cd9..d92dcbf05 100644 --- a/config/locales/en/admin.yml +++ b/config/locales/en/admin.yml @@ -62,6 +62,7 @@ en: on_users: Users title: Moderator activity type: Type + no_activity: There ares no moderators activity. budgets: index: title: Participatory budgets diff --git a/config/locales/es/admin.yml b/config/locales/es/admin.yml index af3ef5830..0fe04d2be 100644 --- a/config/locales/es/admin.yml +++ b/config/locales/es/admin.yml @@ -60,8 +60,9 @@ es: on_debates: Debates on_proposals: Propuestas on_users: Usuarios - title: Actividad de los Moderadores + title: Actividad de Moderadores type: Tipo + no_activity: No hay actividad de moderadores. budgets: index: title: Presupuestos participativos From 53046dfd4a359efeb43849487bca59f1c6974682 Mon Sep 17 00:00:00 2001 From: decabeza Date: Fri, 20 Oct 2017 11:52:03 +0200 Subject: [PATCH 07/18] improves styles for admin valuators views --- app/views/admin/valuators/_valuator.html.erb | 34 ++++++---- app/views/admin/valuators/index.html.erb | 65 ++++++++++++------- .../admin/valuators/user_not_found.js.erb | 2 +- config/locales/en/admin.yml | 5 ++ config/locales/es/admin.yml | 5 ++ 5 files changed, 71 insertions(+), 40 deletions(-) diff --git a/app/views/admin/valuators/_valuator.html.erb b/app/views/admin/valuators/_valuator.html.erb index e5971391b..e4495ba3b 100644 --- a/app/views/admin/valuators/_valuator.html.erb +++ b/app/views/admin/valuators/_valuator.html.erb @@ -1,7 +1,11 @@ -
    -

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

    +

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

    - +
    + + + + + -
    <%= t("admin.valuators.index.name") %><%= t("admin.valuators.index.email") %>
    <%= valuator.name %> @@ -10,19 +14,21 @@ <%= valuator.email %>
    + + - <% unless @valuator.persisted? %> - <%= form_for @valuator, url: admin_valuators_path do |f| %> -
    -
    - <%= f.text_field :description, label: false, placeholder: t('admin.valuators.valuator.description_placeholder') %> +<% unless @valuator.persisted? %> + <%= form_for @valuator, url: admin_valuators_path do |f| %> +
    +
    + <%= f.text_field :description, label: false, placeholder: t('admin.valuators.valuator.description_placeholder') %> + +
    <%= f.hidden_field :user_id %> -
    -
    - <%= f.submit t('admin.valuators.valuator.add'), class: "button success float-left" %> + <%= f.submit t('admin.valuators.valuator.add'), class: "button success" %>
    - <% end %> +
    +
    <% end %> -
    +<% end %> diff --git a/app/views/admin/valuators/index.html.erb b/app/views/admin/valuators/index.html.erb index 30132e66f..ca30006c8 100644 --- a/app/views/admin/valuators/index.html.erb +++ b/app/views/admin/valuators/index.html.erb @@ -1,36 +1,51 @@

    <%= 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' %> +
    + <%= submit_tag t('admin.valuators.search.search'), class: 'button' %> +
    <% end %>
    -
    +
    -

    <%= page_entries_info @valuators %>

    +<% if @valuators.any? %> +

    <%= page_entries_info @valuators %>

    - - <% @valuators.each do |valuator| %> - - - - - - <% end %> -
    - <%= valuator.name %> - - <%= valuator.email %> - - <% if valuator.description.present? %> - <%= valuator.description %> - <% end %> -
    + + + + + + + + <% @valuators.each do |valuator| %> + + + + + + <% end %> + +
    <%= t("admin.valuators.index.name") %><%= t("admin.valuators.index.email") %><%= t("admin.valuators.index.description") %>
    + <%= valuator.name %> + + <%= valuator.email %> + + <% if valuator.description.present? %> + <%= valuator.description %> + <% else %> + <%= t("admin.valuators.index.no_description") %> + <% end %> +
    -<%= paginate @valuators %> + <%= paginate @valuators %> +<% else %> +
    + <%= t("admin.valuators.index.no_valuators") %> +
    +<% end %> diff --git a/app/views/admin/valuators/user_not_found.js.erb b/app/views/admin/valuators/user_not_found.js.erb index af3f83a3f..11b549382 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/config/locales/en/admin.yml b/config/locales/en/admin.yml index d92dcbf05..fc79e93e5 100644 --- a/config/locales/en/admin.yml +++ b/config/locales/en/admin.yml @@ -464,6 +464,11 @@ en: valuators: index: title: Valuators + name: Name + email: Email + description: Description + no_description: No description + no_valuators: There are no valuators. valuator: description_placeholder: 'Description (optional)' user_found: User found diff --git a/config/locales/es/admin.yml b/config/locales/es/admin.yml index 0fe04d2be..74ba800bb 100644 --- a/config/locales/es/admin.yml +++ b/config/locales/es/admin.yml @@ -464,6 +464,11 @@ es: valuators: index: title: Evaluadores + name: Nombre + email: Email + description: Descripción + no_description: Sin descripción + no_valuators: No hay evaluadores. valuator: description_placeholder: "Descripción (opcional)" user_found: Usuario encontrado From 870ce7bfe245f68f9dfcf435130b51a6433fe565 Mon Sep 17 00:00:00 2001 From: decabeza Date: Fri, 20 Oct 2017 11:52:24 +0200 Subject: [PATCH 08/18] improves styles for admin managers views --- app/views/admin/managers/_manager.html.erb | 51 ++++++------ app/views/admin/managers/index.html.erb | 77 +++++++++++-------- .../admin/managers/user_not_found.js.erb | 2 +- config/locales/en/admin.yml | 3 + config/locales/es/admin.yml | 3 + 5 files changed, 79 insertions(+), 57 deletions(-) diff --git a/app/views/admin/managers/_manager.html.erb b/app/views/admin/managers/_manager.html.erb index 3e709eb60..e2a59ea75 100644 --- a/app/views/admin/managers/_manager.html.erb +++ b/app/views/admin/managers/_manager.html.erb @@ -1,24 +1,27 @@ -
    - - - - - - -
    - <%= 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 %> -
    -
    + + + + + + + + + + + +
    <%= t("admin.managers.index.name") %><%= t("admin.managers.index.email") %><%= t("admin.shared.actions") %>
    + <%= manager.name %> + + <%= manager.email %> + + <% if manager.persisted? %> + <%= link_to t('admin.managers.manager.delete'), + admin_manager_path(manager), + method: :delete, + class: "button hollow alert expanded" + %> + <% else %> + <%= link_to t('admin.managers.manager.add'),{ controller: "admin/managers", action: :create, user_id: manager.user_id }, + method: :post, class: "button success expanded" %> + <% end %> +
    diff --git a/app/views/admin/managers/index.html.erb b/app/views/admin/managers/index.html.erb index d479ba303..0eded59b3 100644 --- a/app/views/admin/managers/index.html.erb +++ b/app/views/admin/managers/index.html.erb @@ -1,43 +1,56 @@

    <%= 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' %> +
    + <%= submit_tag t('admin.managers.search.search'), class: 'button' %> +
    <% end %>
    -
    +
    -

    <%= page_entries_info @managers %>

    +<% if @managers.any? %> +

    <%= 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 %> -
    + + + + + + + + <% @managers.each do |manager| %> + + + + + + <% end %> + +
    <%= t("admin.managers.index.name") %><%= t("admin.managers.index.email") %><%= t("admin.shared.actions") %>
    + <%= manager.name %> + + <%= manager.email %> + + <% if manager.persisted? %> + <%= link_to t('admin.managers.manager.delete'), + admin_manager_path(manager), + method: :delete, + class: "button hollow alert expanded" + %> + <% else %> + <%= link_to t('admin.managers.manager.add'),{ controller: "admin/managers", action: :create, user_id: manager.user_id }, + method: :post, class: "button success expanded" %> + <% end %> +
    -<%= paginate @managers %> + <%= paginate @managers %> +<% else %> +
    + <%= t("admin.managers.index.no_managers") %> +
    +<% end %> \ No newline at end of file diff --git a/app/views/admin/managers/user_not_found.js.erb b/app/views/admin/managers/user_not_found.js.erb index 53e9d7e20..c0771b03b 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/config/locales/en/admin.yml b/config/locales/en/admin.yml index fc79e93e5..d3360f0a9 100644 --- a/config/locales/en/admin.yml +++ b/config/locales/en/admin.yml @@ -383,6 +383,9 @@ en: managers: index: title: Managers + name: Name + email: Email + no_managers: There are no managers. manager: add: Add delete: Delete diff --git a/config/locales/es/admin.yml b/config/locales/es/admin.yml index 74ba800bb..ddaac5dd0 100644 --- a/config/locales/es/admin.yml +++ b/config/locales/es/admin.yml @@ -397,6 +397,9 @@ es: managers: index: title: Gestores + name: Nombre + email: Email + no_managers: No hay gestores. manager: add: Añadir como Gestor delete: Borrar From ef91fc7941cd129391c7c35ebcf2162009b940b1 Mon Sep 17 00:00:00 2001 From: decabeza Date: Fri, 20 Oct 2017 12:29:24 +0200 Subject: [PATCH 09/18] improves styles for admin users views --- app/views/admin/users/_users.html.erb | 40 ++++++++++++++++----------- app/views/admin/users/index.html.erb | 13 +++++---- config/locales/en/admin.yml | 1 + config/locales/es/admin.yml | 1 + 4 files changed, 33 insertions(+), 22 deletions(-) diff --git a/app/views/admin/users/_users.html.erb b/app/views/admin/users/_users.html.erb index f3c6af0fa..2c4c4db2e 100644 --- a/app/views/admin/users/_users.html.erb +++ b/app/views/admin/users/_users.html.erb @@ -1,24 +1,32 @@ -

    <%= page_entries_info @users %>

    +<% if @users.any? %> +

    <%= page_entries_info @users %>

    - - - - - + + + + + - <% @users.each do |user| %> - - - - - - - - <% end %> + + <% @users.each do |user| %> + + + + + + + + <% end %> +
    <%= t('admin.users.columns.name') %><%= t('admin.users.columns.email') %><%= t('admin.users.columns.document_number') %><%= t('admin.users.columns.roles') %><%= t('admin.users.columns.verification_level') %><%= t("admin.users.columns.name") %><%= t("admin.users.columns.email") %><%= t("admin.users.columns.document_number") %><%= t("admin.users.columns.roles") %><%= t("admin.users.columns.verification_level") %>
    <%= user.name %><%= user.email %><%= user.document_number %><%= display_user_roles(user) %><%= user.user_type %>
    <%= user.name %><%= user.email %><%= user.document_number %><%= display_user_roles(user) %><%= user.user_type %>
    -<%= paginate @users %> + <%= paginate @users %> +<% else %> +
    + <%= t("admin.users.index.no_users") %> +
    +<% end %> diff --git a/app/views/admin/users/index.html.erb b/app/views/admin/users/index.html.erb index 2713399ed..ceee64394 100644 --- a/app/views/admin/users/index.html.erb +++ b/app/views/admin/users/index.html.erb @@ -1,16 +1,17 @@

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

    -
    +
    <%= form_tag admin_users_path, method: :get, remote: true do %> -
    +
    <%= text_field_tag :search, '', placeholder: t('admin.users.search.placeholder') %> -
    -
    - <%= submit_tag t('admin.users.search.search'), class: 'button' %> +
    + <%= submit_tag t('admin.users.search.search'), class: 'button' %> +
    <% end %>
    -
    + +
    <%= render "users" %>
    diff --git a/config/locales/en/admin.yml b/config/locales/en/admin.yml index d3360f0a9..f01129868 100644 --- a/config/locales/en/admin.yml +++ b/config/locales/en/admin.yml @@ -961,6 +961,7 @@ en: verification_level: Verification level index: title: User + no_users: There are no users. search: placeholder: Search user by email, name or document number search: Search diff --git a/config/locales/es/admin.yml b/config/locales/es/admin.yml index ddaac5dd0..5a25e5ee5 100644 --- a/config/locales/es/admin.yml +++ b/config/locales/es/admin.yml @@ -963,6 +963,7 @@ es: verification_level: Nivel de verficación index: title: Usuarios + no_users: No hay usuarios. search: placeholder: Buscar usuario por email, nombre o DNI search: Buscar From 90067814e456f1a55028115702df96d304bf95cc Mon Sep 17 00:00:00 2001 From: decabeza Date: Fri, 20 Oct 2017 13:59:58 +0200 Subject: [PATCH 10/18] moves table ids to fixes specs --- app/views/admin/managers/index.html.erb | 80 ++++++------- app/views/admin/moderators/index.html.erb | 86 +++++++------- app/views/admin/organizations/search.html.erb | 106 +++++++++--------- 3 files changed, 139 insertions(+), 133 deletions(-) diff --git a/app/views/admin/managers/index.html.erb b/app/views/admin/managers/index.html.erb index 0eded59b3..a31998323 100644 --- a/app/views/admin/managers/index.html.erb +++ b/app/views/admin/managers/index.html.erb @@ -13,44 +13,46 @@
    -<% if @managers.any? %> -

    <%= page_entries_info @managers %>

    +
    + <% if @managers.any? %> +

    <%= page_entries_info @managers %>

    - - - - - - - - <% @managers.each do |manager| %> - - - - - - <% end %> - -
    <%= t("admin.managers.index.name") %><%= t("admin.managers.index.email") %><%= t("admin.shared.actions") %>
    - <%= manager.name %> - - <%= manager.email %> - - <% if manager.persisted? %> - <%= link_to t('admin.managers.manager.delete'), - admin_manager_path(manager), - method: :delete, - class: "button hollow alert expanded" - %> - <% else %> - <%= link_to t('admin.managers.manager.add'),{ controller: "admin/managers", action: :create, user_id: manager.user_id }, - method: :post, class: "button success expanded" %> - <% end %> -
    + + + + + + + + <% @managers.each do |manager| %> + + + + + + <% end %> + +
    <%= t("admin.managers.index.name") %><%= t("admin.managers.index.email") %><%= t("admin.shared.actions") %>
    + <%= manager.name %> + + <%= manager.email %> + + <% if manager.persisted? %> + <%= link_to t('admin.managers.manager.delete'), + admin_manager_path(manager), + method: :delete, + class: "button hollow alert expanded" + %> + <% else %> + <%= link_to t('admin.managers.manager.add'),{ controller: "admin/managers", action: :create, user_id: manager.user_id }, + method: :post, class: "button success expanded" %> + <% end %> +
    - <%= paginate @managers %> -<% else %> -
    - <%= t("admin.managers.index.no_managers") %> -
    -<% end %> \ No newline at end of file + <%= paginate @managers %> + <% else %> +
    + <%= t("admin.managers.index.no_managers") %> +
    + <% end %> +
    diff --git a/app/views/admin/moderators/index.html.erb b/app/views/admin/moderators/index.html.erb index d6a9b50bb..061180970 100644 --- a/app/views/admin/moderators/index.html.erb +++ b/app/views/admin/moderators/index.html.erb @@ -15,48 +15,50 @@
    -<% if @moderators.any? %> +
    + <% if @moderators.any? %> -

    <%= page_entries_info @moderators %>

    +

    <%= page_entries_info @moderators %>

    - - - - - - - - <% @moderators.each do |moderator| %> - - - - - - <% end %> - -
    <%= t("admin.moderators.index.name") %><%= t("admin.moderators.index.email") %><%= t("admin.shared.actions") %>
    - <%= moderator.name %> - - <%= moderator.email %> - - <% if moderator.persisted? %> - <%= link_to t('admin.moderators.moderator.delete'), - admin_moderator_path(moderator), - method: :delete, - class: "button hollow alert expanded" - %> - <% else %> - <%= link_to t('admin.moderators.moderator.add'), - { controller: "admin/moderators", action: :create, - user_id: moderator.user_id }, - method: :post, - class: "button success expanded" %> - <% end %> -
    + + + + + + + + <% @moderators.each do |moderator| %> + + + + + + <% end %> + +
    <%= t("admin.moderators.index.name") %><%= t("admin.moderators.index.email") %><%= t("admin.shared.actions") %>
    + <%= moderator.name %> + + <%= moderator.email %> + + <% if moderator.persisted? %> + <%= link_to t('admin.moderators.moderator.delete'), + admin_moderator_path(moderator), + method: :delete, + class: "button hollow alert expanded" + %> + <% else %> + <%= link_to t('admin.moderators.moderator.add'), + { controller: "admin/moderators", action: :create, + user_id: moderator.user_id }, + method: :post, + class: "button success expanded" %> + <% end %> +
    - <%= paginate @moderators %> -<% else %> -
    - <%= t("admin.moderators.index.no_moderators") %> -
    -<% end %> + <%= paginate @moderators %> + <% else %> +
    + <%= t("admin.moderators.index.no_moderators") %> +
    + <% end %> +
    diff --git a/app/views/admin/organizations/search.html.erb b/app/views/admin/organizations/search.html.erb index 01b5420bd..e3d0564cf 100644 --- a/app/views/admin/organizations/search.html.erb +++ b/app/views/admin/organizations/search.html.erb @@ -11,58 +11,60 @@ <% end %>
    -<% if @organizations.any? %> -

    <%= page_entries_info @organizations %>

    +
    + <% if @organizations.any? %> +

    <%= page_entries_info @organizations %>

    - - - - - - - - - - - <% @organizations.each do |organization| %> - - - - - - - + + <% end %> + +
    <%= t("admin.organizations.index.name") %><%= t("admin.organizations.index.email") %><%= t("admin.organizations.index.phone_number") %><%= t("admin.organizations.index.responsible_name") %><%= t("admin.organizations.index.status") %><%= t("admin.shared.actions") %>
    <%= organization.name %><%= organization.email %><%= organization.phone_number %><%= organization.responsible_name %> - <% if organization.verified? %> - - <%= t("admin.organizations.index.verified") %> - <% elsif organization.rejected? %> - - <%= t("admin.organizations.index.rejected") %> - <% else %> - - <%= t("admin.organizations.index.pending") %> - <% end %> - - <% if can? :verify, organization %> - <%= link_to t("admin.organizations.index.verify"), - verify_admin_organization_path(organization, request.query_parameters), - method: :put, class: "button success small-5" %> - <% end %> + + + + + + + + + + + <% @organizations.each do |organization| %> + + + + + + + - - <% end %> - -
    <%= t("admin.organizations.index.name") %><%= t("admin.organizations.index.email") %><%= t("admin.organizations.index.phone_number") %><%= t("admin.organizations.index.responsible_name") %><%= t("admin.organizations.index.status") %><%= t("admin.shared.actions") %>
    <%= organization.name %><%= organization.email %><%= organization.phone_number %><%= organization.responsible_name %> + <% if organization.verified? %> + + <%= t("admin.organizations.index.verified") %> + <% elsif organization.rejected? %> + + <%= t("admin.organizations.index.rejected") %> + <% else %> + + <%= t("admin.organizations.index.pending") %> + <% end %> + + <% if can? :verify, organization %> + <%= link_to t("admin.organizations.index.verify"), + verify_admin_organization_path(organization, request.query_parameters), + method: :put, class: "button success small-5" %> + <% end %> - <% if can? :reject, organization %> - <%= link_to t("admin.organizations.index.reject"), - reject_admin_organization_path(organization, request.query_parameters), - method: :put, class: "button hollow alert small-5" %> - <% end %> -
    + <% if can? :reject, organization %> + <%= link_to t("admin.organizations.index.reject"), + reject_admin_organization_path(organization, request.query_parameters), + method: :put, class: "button hollow alert small-5" %> + <% end %> +
    - <%= paginate @organizations %> -<% else %> -
    - <%= t("admin.organizations.search.no_results") %> -
    -<% end %> + <%= paginate @organizations %> + <% else %> +
    + <%= t("admin.organizations.search.no_results") %> +
    + <% end %> +
    From b7b0651ccb2363189a288ab637b075b63cdf2e91 Mon Sep 17 00:00:00 2001 From: decabeza Date: Fri, 20 Oct 2017 16:00:03 +0200 Subject: [PATCH 11/18] adds missing i18n on activerecord --- config/locales/en/activerecord.yml | 6 ++++++ config/locales/es/activerecord.yml | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/config/locales/en/activerecord.yml b/config/locales/en/activerecord.yml index 8ef98b4d1..20c497417 100644 --- a/config/locales/en/activerecord.yml +++ b/config/locales/en/activerecord.yml @@ -31,6 +31,12 @@ en: administrator: one: "Administrator" other: "Administrators" + valuator: + one: "Evaluador" + other: "Evaluadores" + manager: + one: "Manager" + other: "Managers" vote: one: "Vote" other: "Votes" diff --git a/config/locales/es/activerecord.yml b/config/locales/es/activerecord.yml index 03de3965d..a29157431 100644 --- a/config/locales/es/activerecord.yml +++ b/config/locales/es/activerecord.yml @@ -31,6 +31,12 @@ es: administrator: one: "Administrador" other: "Administradores" + valuator: + one: "Evaluador" + other: "Evaluadores" + manager: + one: "Gestor" + other: "Gestores" vote: one: "Voto" other: "Votos" From 1e4926528878eeb706d7994819433ab688c8e692 Mon Sep 17 00:00:00 2001 From: decabeza Date: Wed, 25 Oct 2017 18:40:17 +0200 Subject: [PATCH 12/18] improves admin administrators views --- app/views/admin/administrators/index.html.erb | 82 ++++++++++--------- .../admin/administrators/search.html.erb | 59 ++++++++----- spec/features/admin/administrators_spec.rb | 2 +- 3 files changed, 80 insertions(+), 63 deletions(-) diff --git a/app/views/admin/administrators/index.html.erb b/app/views/admin/administrators/index.html.erb index edb548ab4..44b423f39 100644 --- a/app/views/admin/administrators/index.html.erb +++ b/app/views/admin/administrators/index.html.erb @@ -2,45 +2,47 @@ <%= render 'admin/shared/user_search', url: search_admin_administrators_path %> -<% if @administrators.any? %> -

    <%= page_entries_info @administrators %>

    +
    + <% if @administrators.any? %> +

    <%= page_entries_info @administrators %>

    - - - - - - - <% @administrators.each do |administrator| %> - - - - - - <% end %> -
    <%= t("admin.administrators.index.name") %><%= t("admin.administrators.index.email") %><%= t("admin.shared.actions") %>
    - <%= administrator.name %> - - <%= administrator.email %> - - <% if administrator.persisted? %> - <%= link_to t('admin.administrators.administrator.delete'), - admin_administrator_path(administrator), - method: :delete, - class: "button hollow alert expanded" - %> - <% else %> - <%= link_to t('admin.administrators.administrator.add'), - { controller: "admin/administrators", action: :create, - user_id: administrator.user_id }, - method: :post, - class: "button success expanded" %> - <% end %> -
    + + + + + + + <% @administrators.each do |administrator| %> + + + + + + <% end %> +
    <%= t("admin.administrators.index.name") %><%= t("admin.administrators.index.email") %><%= t("admin.shared.actions") %>
    + <%= administrator.name %> + + <%= administrator.email %> + + <% if administrator.persisted? %> + <%= link_to t('admin.administrators.administrator.delete'), + admin_administrator_path(administrator), + method: :delete, + class: "button hollow alert expanded" + %> + <% else %> + <%= link_to t('admin.administrators.administrator.add'), + { controller: "admin/administrators", action: :create, + user_id: administrator.user_id }, + method: :post, + class: "button success expanded" %> + <% end %> +
    - <%= paginate @administrators %> -<% else %> -
    - <%= t("admin.administrators.index.no_administrators") %> -
    -<% end %> + <%= paginate @administrators %> + <% else %> +
    + <%= t("admin.administrators.index.no_administrators") %> +
    + <% end %> +
    diff --git a/app/views/admin/administrators/search.html.erb b/app/views/admin/administrators/search.html.erb index 3f3c269f1..d8ab78511 100644 --- a/app/views/admin/administrators/search.html.erb +++ b/app/views/admin/administrators/search.html.erb @@ -2,28 +2,43 @@ <%= render 'admin/shared/user_search', url: search_admin_administrators_path %> -

    <%= page_entries_info @users %>

    +
    + <% if @users.any? %> +

    <%= page_entries_info @users %>

    - - <% @users.each do |user| %> - - - -
    <%= user.name %><%= user.email %> - <% if user.administrator? && user.administrator.persisted? %> - <%= link_to t('admin.administrators.administrator.delete'), - admin_administrator_path(user), - method: :delete, - class: "button hollow alert" %> - <% else %> - <%= link_to t('admin.administrators.administrator.add'), - { controller: "admin/administrators", - action: :create, - user_id: user }, - method: :post, - class: "button success" %> + + + + + + + + <% @users.each do |user| %> + + + + + <% end %> - - + +
    <%= t("admin.administrators.index.name") %><%= t("admin.administrators.index.email") %><%= t("admin.shared.actions") %>
    <%= user.name %><%= user.email %> + <% if user.administrator? && user.administrator.persisted? %> + <%= link_to t('admin.administrators.administrator.delete'), + admin_administrator_path(user), + method: :delete, + class: "button hollow alert expanded" %> + <% else %> + <%= link_to t('admin.administrators.administrator.add'), + { controller: "admin/administrators", + action: :create, + user_id: user }, + method: :post, + class: "button success expanded" %> + <% end %> +
    + <% else %> +
    + <%= t("admin.shared.no_search_results") %> +
    <% end %> -
    +
    diff --git a/spec/features/admin/administrators_spec.rb b/spec/features/admin/administrators_spec.rb index 4e2091d11..c39d5ade5 100644 --- a/spec/features/admin/administrators_spec.rb +++ b/spec/features/admin/administrators_spec.rb @@ -60,7 +60,7 @@ feature 'Admin administrators' do click_button 'Search' expect(page).to have_content('Administrators: User search') - expect(page).to have_content('users cannot be found') + expect(page).to have_content('No results found') expect(page).to_not have_content(@administrator1.name) expect(page).to_not have_content(@administrator2.name) end From 0f4c03e407ef50c73ef12a33ca035a34878795c2 Mon Sep 17 00:00:00 2001 From: decabeza Date: Wed, 25 Oct 2017 18:43:19 +0200 Subject: [PATCH 13/18] improves admin moderators views --- app/views/admin/moderators/index.html.erb | 84 +++++++++++----------- app/views/admin/moderators/search.html.erb | 60 ++++++++++------ spec/features/admin/moderators_spec.rb | 2 +- 3 files changed, 80 insertions(+), 66 deletions(-) diff --git a/app/views/admin/moderators/index.html.erb b/app/views/admin/moderators/index.html.erb index 596d49671..be067d73d 100644 --- a/app/views/admin/moderators/index.html.erb +++ b/app/views/admin/moderators/index.html.erb @@ -5,48 +5,48 @@ <%= render 'admin/shared/user_search', url: search_admin_moderators_path %>
    -<% if @moderators.any? %> -

    <%= page_entries_info @moderators %>

    + <% if @moderators.any? %> +

    <%= page_entries_info @moderators %>

    - - - - - - - - <% @moderators.each do |moderator| %> - - - - - - <% end %> - -
    <%= t("admin.moderators.index.name") %><%= t("admin.moderators.index.email") %><%= t("admin.shared.actions") %>
    - <%= moderator.name %> - - <%= moderator.email %> - - <% if moderator.persisted? %> - <%= link_to t('admin.moderators.moderator.delete'), - admin_moderator_path(moderator), - method: :delete, - class: "button hollow alert expanded" - %> - <% else %> - <%= link_to t('admin.moderators.moderator.add'), - { controller: "admin/moderators", action: :create, - user_id: moderator.user_id }, - method: :post, - class: "button success expanded" %> - <% end %> -
    + + + + + + + + <% @moderators.each do |moderator| %> + + + + + + <% end %> + +
    <%= t("admin.moderators.index.name") %><%= t("admin.moderators.index.email") %><%= t("admin.shared.actions") %>
    + <%= moderator.name %> + + <%= moderator.email %> + + <% if moderator.persisted? %> + <%= link_to t('admin.moderators.moderator.delete'), + admin_moderator_path(moderator), + method: :delete, + class: "button hollow alert expanded" + %> + <% else %> + <%= link_to t('admin.moderators.moderator.add'), + { controller: "admin/moderators", action: :create, + user_id: moderator.user_id }, + method: :post, + class: "button success expanded" %> + <% end %> +
    - <%= paginate @moderators %> -<% else %> -
    - <%= t("admin.moderators.index.no_moderators") %> -
    -<% end %> + <%= paginate @moderators %> + <% else %> +
    + <%= t("admin.moderators.index.no_moderators") %> +
    + <% end %>
    diff --git a/app/views/admin/moderators/search.html.erb b/app/views/admin/moderators/search.html.erb index 89e9dc9a7..a7ad117f9 100644 --- a/app/views/admin/moderators/search.html.erb +++ b/app/views/admin/moderators/search.html.erb @@ -2,28 +2,42 @@ <%= render 'admin/shared/user_search', url: search_admin_moderators_path %> -

    <%= page_entries_info @users %>

    +
    + <% if @users.any? %> +

    <%= page_entries_info @users %>

    - - <% @users.each do |user| %> - - - - - +
    <%= user.name %><%= user.email %> - <% if user.moderator? && user.moderator.persisted? %> - <%= link_to t('admin.moderators.moderator.delete'), - admin_moderator_path(user), - method: :delete, - class: "button hollow alert" %> - <% else %> - <%= link_to t('admin.moderators.moderator.add'), - { controller: "admin/moderators", - action: :create, - user_id: user }, - method: :post, - class: "button success" %> - <% end %> -
    + + + + + + + <% @users.each do |user| %> + + + + + + <% end %> +
    <%= t("admin.moderators.index.name") %><%= t("admin.moderators.index.email") %><%= t("admin.shared.actions") %>
    <%= user.name %><%= user.email %> + <% if user.moderator? && user.moderator.persisted? %> + <%= link_to t('admin.moderators.moderator.delete'), + admin_moderator_path(user), + method: :delete, + class: "button hollow alert" %> + <% else %> + <%= link_to t('admin.moderators.moderator.add'), + { controller: "admin/moderators", + action: :create, + user_id: user }, + method: :post, + class: "button success" %> + <% end %> +
    + <% else %> +
    + <%= t("admin.shared.no_search_results") %> +
    <% end %> - +
    diff --git a/spec/features/admin/moderators_spec.rb b/spec/features/admin/moderators_spec.rb index 2c2994d62..8a32762f1 100644 --- a/spec/features/admin/moderators_spec.rb +++ b/spec/features/admin/moderators_spec.rb @@ -52,7 +52,7 @@ feature 'Admin moderators' do click_button 'Search' expect(page).to have_content('Moderators: User search') - expect(page).to have_content('users cannot be found') + expect(page).to have_content('No results found') expect(page).to_not have_content(@moderator1.name) expect(page).to_not have_content(@moderator2.name) end From 2131c651f6b8f0febb22145dc34a01176d612701 Mon Sep 17 00:00:00 2001 From: decabeza Date: Wed, 25 Oct 2017 18:47:26 +0200 Subject: [PATCH 14/18] improves admin valuators views --- app/views/admin/valuators/index.html.erb | 70 ++++++++++++----------- app/views/admin/valuators/search.html.erb | 55 +++++++++++------- spec/features/admin/valuators_spec.rb | 2 +- 3 files changed, 72 insertions(+), 55 deletions(-) diff --git a/app/views/admin/valuators/index.html.erb b/app/views/admin/valuators/index.html.erb index bcb723029..622d01307 100644 --- a/app/views/admin/valuators/index.html.erb +++ b/app/views/admin/valuators/index.html.erb @@ -2,39 +2,41 @@ <%= render 'admin/shared/user_search', url: search_admin_valuators_path %> -<% if @valuators.any? %> -

    <%= page_entries_info @valuators %>

    +
    + <% if @valuators.any? %> +

    <%= page_entries_info @valuators %>

    - - - - - - - - <% @valuators.each do |valuator| %> - - - - - - <% end %> - -
    <%= t("admin.valuators.index.name") %><%= t("admin.valuators.index.email") %><%= t("admin.valuators.index.description") %>
    - <%= valuator.name %> - - <%= valuator.email %> - - <% if valuator.description.present? %> - <%= valuator.description %> - <% else %> - <%= t("admin.valuators.index.no_description") %> - <% end %> -
    + + + + + + + + <% @valuators.each do |valuator| %> + + + + + + <% end %> + +
    <%= t("admin.valuators.index.name") %><%= t("admin.valuators.index.email") %><%= t("admin.valuators.index.description") %>
    + <%= valuator.name %> + + <%= valuator.email %> + + <% if valuator.description.present? %> + <%= valuator.description %> + <% else %> + <%= t("admin.valuators.index.no_description") %> + <% end %> +
    - <%= paginate @valuators %> -<% else %> -
    - <%= t("admin.valuators.index.no_valuators") %> -
    -<% end %> + <%= paginate @valuators %> + <% else %> +
    + <%= t("admin.valuators.index.no_valuators") %> +
    + <% end %> +
    diff --git a/app/views/admin/valuators/search.html.erb b/app/views/admin/valuators/search.html.erb index 4663a944b..9f5448c43 100644 --- a/app/views/admin/valuators/search.html.erb +++ b/app/views/admin/valuators/search.html.erb @@ -2,26 +2,41 @@ <%= render 'admin/shared/user_search', url: search_admin_valuators_path %> -

    <%= page_entries_info @users %>

    +
    + <% if @users.any? %> +

    <%= page_entries_info @users %>

    - - <% @users.each do |user| %> - - - -
    <%= user.name %><%= user.email %> - <% if user.valuator? && user.valuator.description.present? %> - <%= user.valuator.description %> - <% else %> - <%= form_for Valuator.new(user: user), url: admin_valuators_path do |f| %> - <%= f.text_field :description, - label: false, - placeholder: t("admin.valuators.valuator.description_placeholder") %> - <%= f.hidden_field :user_id %> - <%= f.submit t("admin.valuators.valuator.add"), class: "button success float-left" %> - <% end %> + + + + + + + + <% @users.each do |user| %> + + + + + <% end %> - - + +
    <%= t("admin.valuators.index.name") %><%= t("admin.valuators.index.email") %><%= t("admin.valuators.index.description") %>
    <%= user.name %><%= user.email %> + <% if user.valuator? && user.valuator.description.present? %> + <%= user.valuator.description %> + <% else %> + <%= form_for Valuator.new(user: user), url: admin_valuators_path do |f| %> + <%= f.text_field :description, + label: false, + placeholder: t("admin.valuators.valuator.description_placeholder") %> + <%= f.hidden_field :user_id %> + <%= f.submit t("admin.valuators.valuator.add"), class: "button success float-left" %> + <% end %> + <% end %> +
    + <% else %> +
    + <%= t("admin.shared.no_search_results") %> +
    <% end %> -
    +
    diff --git a/spec/features/admin/valuators_spec.rb b/spec/features/admin/valuators_spec.rb index 86f2c89e9..bb631cbc3 100644 --- a/spec/features/admin/valuators_spec.rb +++ b/spec/features/admin/valuators_spec.rb @@ -47,7 +47,7 @@ feature 'Admin valuators' do click_button 'Search' expect(page).to have_content('Valuators: User search') - expect(page).to have_content('users cannot be found') + expect(page).to have_content('No results found') expect(page).to_not have_content(@valuator1.name) expect(page).to_not have_content(@valuator2.name) end From 4b7a0358e5012b7cceaefe781bd4f11cee8898c7 Mon Sep 17 00:00:00 2001 From: decabeza Date: Wed, 25 Oct 2017 18:50:30 +0200 Subject: [PATCH 15/18] improves admin managers views --- app/views/admin/managers/search.html.erb | 61 +++++++++++++++--------- spec/features/admin/managers_spec.rb | 2 +- 2 files changed, 39 insertions(+), 24 deletions(-) diff --git a/app/views/admin/managers/search.html.erb b/app/views/admin/managers/search.html.erb index c6ea3c2cd..cad2c7100 100644 --- a/app/views/admin/managers/search.html.erb +++ b/app/views/admin/managers/search.html.erb @@ -2,28 +2,43 @@ <%= render 'admin/shared/user_search', url: search_admin_managers_path %> -

    <%= page_entries_info @users %>

    +
    + <% if @users.any? %> +

    <%= page_entries_info @users %>

    - - <% @users.each do |user| %> - - - - - +
    <%= user.name %><%= user.email %> - <% if user.manager? && user.manager.persisted? %> - <%= link_to t('admin.managers.manager.delete'), - admin_manager_path(user), - method: :delete, - class: "button hollow alert" %> - <% else %> - <%= link_to t('admin.managers.manager.add'), - { controller: "admin/managers", - action: :create, - user_id: user }, - method: :post, - class: "button success" %> - <% end %> -
    + + + + + + + <% @users.each do |user| %> + + + + + + <% end %> + +
    <%= t("admin.managers.index.name") %><%= t("admin.managers.index.email") %><%= t("admin.shared.actions") %>
    <%= user.name %><%= user.email %> + <% if user.manager? && user.manager.persisted? %> + <%= link_to t('admin.managers.manager.delete'), + admin_manager_path(user), + method: :delete, + class: "button hollow alert expanded" %> + <% else %> + <%= link_to t('admin.managers.manager.add'), + { controller: "admin/managers", + action: :create, + user_id: user }, + method: :post, + class: "button success expanded" %> + <% end %> +
    + <% else %> +
    + <%= t("admin.shared.no_search_results") %> +
    <% end %> - +
    diff --git a/spec/features/admin/managers_spec.rb b/spec/features/admin/managers_spec.rb index 5fe1b3892..e59b1da4c 100644 --- a/spec/features/admin/managers_spec.rb +++ b/spec/features/admin/managers_spec.rb @@ -52,7 +52,7 @@ feature 'Admin managers' do click_button 'Search' expect(page).to have_content('Managers: User search') - expect(page).to have_content('users cannot be found') + expect(page).to have_content('No results found') expect(page).to_not have_content(@manager1.name) expect(page).to_not have_content(@manager2.name) end From c53181843530d91a3871fe7ed902121fb8e5fb9a Mon Sep 17 00:00:00 2001 From: decabeza Date: Wed, 25 Oct 2017 18:52:35 +0200 Subject: [PATCH 16/18] add missing class for buttons --- app/views/admin/moderators/search.html.erb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/admin/moderators/search.html.erb b/app/views/admin/moderators/search.html.erb index a7ad117f9..7fc479b8a 100644 --- a/app/views/admin/moderators/search.html.erb +++ b/app/views/admin/moderators/search.html.erb @@ -17,19 +17,19 @@ <%= user.name %> <%= user.email %> - + <% if user.moderator? && user.moderator.persisted? %> <%= link_to t('admin.moderators.moderator.delete'), admin_moderator_path(user), method: :delete, - class: "button hollow alert" %> + class: "button hollow alert expanded" %> <% else %> <%= link_to t('admin.moderators.moderator.add'), { controller: "admin/moderators", action: :create, user_id: user }, method: :post, - class: "button success" %> + class: "button success expanded" %> <% end %> From 2542b2c695b2411ee71425d22e49f3750ebff5f2 Mon Sep 17 00:00:00 2001 From: decabeza Date: Wed, 25 Oct 2017 19:02:04 +0200 Subject: [PATCH 17/18] improves admin valuators search form --- app/views/admin/valuators/search.html.erb | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/app/views/admin/valuators/search.html.erb b/app/views/admin/valuators/search.html.erb index 9f5448c43..2710cb44d 100644 --- a/app/views/admin/valuators/search.html.erb +++ b/app/views/admin/valuators/search.html.erb @@ -11,22 +11,31 @@ <%= t("admin.valuators.index.name") %> <%= t("admin.valuators.index.email") %> <%= t("admin.valuators.index.description") %> + <%= t("admin.shared.actions") %> <% @users.each do |user| %> <%= user.name %> <%= user.email %> - - <% if user.valuator? && user.valuator.description.present? %> - <%= user.valuator.description %> + + <% if user.valuator? %> + <% if user.valuator.description.present? %> + <%= user.valuator.description %> + <% else %> + <%= t("admin.valuators.index.no_description") %> + <% end %> <% else %> + <%= t("admin.valuators.index.no_description") %> + <% end %> + + <% unless user.valuator? %> <%= form_for Valuator.new(user: user), url: admin_valuators_path do |f| %> <%= f.text_field :description, label: false, placeholder: t("admin.valuators.valuator.description_placeholder") %> <%= f.hidden_field :user_id %> - <%= f.submit t("admin.valuators.valuator.add"), class: "button success float-left" %> + <%= f.submit t("admin.valuators.valuator.add"), class: "button success expanded" %> <% end %> <% end %> From f0c119f7a64650cecefcac069158c45b8fe8048f Mon Sep 17 00:00:00 2001 From: decabeza Date: Wed, 25 Oct 2017 19:27:44 +0200 Subject: [PATCH 18/18] removes unused i18n keys --- config/locales/en/admin.yml | 3 --- config/locales/es/admin.yml | 3 --- 2 files changed, 6 deletions(-) diff --git a/config/locales/en/admin.yml b/config/locales/en/admin.yml index b41d864b7..a2062f8ce 100644 --- a/config/locales/en/admin.yml +++ b/config/locales/en/admin.yml @@ -443,9 +443,6 @@ en: delete: Delete restricted_removal: "Sorry, you can't remove yourself from the administrators" search: - email_placeholder: Search user by email - search: Search - user_not_found: User not found. title: "Administrators: User search" moderators: index: diff --git a/config/locales/es/admin.yml b/config/locales/es/admin.yml index 459c291bd..1c7d0fa74 100644 --- a/config/locales/es/admin.yml +++ b/config/locales/es/admin.yml @@ -391,9 +391,6 @@ es: delete: Borrar restricted_removal: "Lo sentimos, no puedes eliminarte a ti mismo de la lista" search: - email_placeholder: Buscar usuario por email - search: Buscar - user_not_found: Usuario no encontrado. title: "Administradores: Búsqueda de usuarios" managers: index: