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