This partial was going to get too complex since in some places we've got different texts, different URLs or different confirmation messages. While we should probably try to be more consistent and that would make the partial work in most cases, there'll always be some exceptions, and using a partial (with, perhaps, some helper methods) will become messy really quickly.
42 lines
1.3 KiB
Plaintext
42 lines
1.3 KiB
Plaintext
<h2><%= t("admin.managers.search.title") %></h2>
|
|
|
|
<%= render "admin/shared/user_search", url: search_admin_managers_path %>
|
|
|
|
<div id="managers">
|
|
<% if @users.any? %>
|
|
<h3><%= page_entries_info @users %></h3>
|
|
|
|
<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>
|
|
<% if user.manager? && user.manager.persisted? %>
|
|
<%= render Admin::TableActionsComponent.new(user.manager, actions: [:destroy]) %>
|
|
<% else %>
|
|
<%= link_to t("admin.managers.manager.add"),
|
|
{ controller: "admin/managers",
|
|
action: :create,
|
|
user_id: user },
|
|
method: :post,
|
|
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>
|