Display users as table in admin panel

This commit is contained in:
ricola 2026-04-20 12:45:21 -06:00
parent 50ad689b28
commit b4e56645f6

View file

@ -2,13 +2,26 @@
<h2 class="mb-4"><%= _("Users") %></h2>
<ul class="mb-5">
<table class="table table-striped mb-5">
<thead>
<tr>
<th><%= _("Email") %></th>
<th><%= _("Created") %></th>
<th><%= _("Admin") %></th>
<th><%= _("Votes") %></th>
<th><%= _("Ratings") %></th>
</tr>
</thead>
<% @users.sort_by { |user| user.email }.each do |user| %>
<li>
<a href="/admin/users/<%= user.id %>"><%= user.email %></a>
</li>
<tr>
<td><a href="/admin/users/<%= user.id %>"><%= user.email %></a></td>
<td><%= format_date(user.created_at) %></td>
<td><%= user.admin %></td>
<td><%= user.votes.length %></td>
<td><%= user.ratings.length %></td>
</tr>
<% end %>
</ul>
</table>
<h2 class="mb-4"><%= _("Votes") %></h2>