Files
grecia/app/views/admin/moderators/index.html.erb
2017-10-25 18:43:19 +02:00

53 lines
1.7 KiB
Plaintext

<%= link_to t('admin.menu.activity'), admin_activity_path, class: "button hollow float-right" %>
<h2 class="inline-block"><%= t("admin.moderators.index.title") %></h2>
<%= render 'admin/shared/user_search', url: search_admin_moderators_path %>
<div id="moderators">
<% if @moderators.any? %>
<h3 class="margin"><%= page_entries_info @moderators %></h3>
<table>
<thead>
<th scope="col"><%= t("admin.moderators.index.name") %></th>
<th scope="col" class="small-6"><%= t("admin.moderators.index.email") %></th>
<th scope="col" class="small-3"><%= t("admin.shared.actions") %></th>
</thead>
<tbody>
<% @moderators.each do |moderator| %>
<tr>
<td>
<%= moderator.name %>
</td>
<td>
<%= moderator.email %>
</td>
<td>
<% 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 %>
</td>
</tr>
<% end %>
</tbody>
</table>
<%= paginate @moderators %>
<% else %>
<div class="callout primary">
<%= t("admin.moderators.index.no_moderators") %>
</div>
<% end %>
</div>