improves admin managers views

This commit is contained in:
decabeza
2017-10-25 18:50:30 +02:00
parent 2131c651f6
commit 4b7a0358e5
2 changed files with 39 additions and 24 deletions

View File

@@ -2,28 +2,43 @@
<%= render 'admin/shared/user_search', url: search_admin_managers_path %>
<div id="managers">
<% if @users.any? %>
<h3><%= page_entries_info @users %></h3>
<table id="managers">
<table>
<thead>
<th scope="col"><%= t("admin.managers.index.name") %></th>
<th scope="col"><%= t("admin.managers.index.email") %></th>
<th scope="col" class="small-3"><%= t("admin.shared.actions") %></th>
</thead>
<tbody>
<% @users.each do |user| %>
<tr>
<td><%= user.name %></td>
<td><%= user.email %></td>
<td class="text-right">
<td>
<% if user.manager? && user.manager.persisted? %>
<%= link_to t('admin.managers.manager.delete'),
admin_manager_path(user),
method: :delete,
class: "button hollow alert" %>
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" %>
class: "button success expanded" %>
<% end %>
</td>
</tr>
<% end %>
</tbody>
</table>
<% else %>
<div class="callout alert margin">
<%= t("admin.shared.no_search_results") %>
</div>
<% end %>
</div>

View File

@@ -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