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