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