Display users as table in admin panel
This commit is contained in:
parent
50ad689b28
commit
b4e56645f6
1 changed files with 20 additions and 7 deletions
|
|
@ -2,13 +2,26 @@
|
|||
|
||||
<h2 class="mb-4"><%= _("Users") %></h2>
|
||||
|
||||
<ul class="mb-5">
|
||||
<% @users.sort_by { |user| user.email }.each do |user| %>
|
||||
<li>
|
||||
<a href="/admin/users/<%= user.id %>"><%= user.email %></a>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<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| %>
|
||||
<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 %>
|
||||
</table>
|
||||
|
||||
<h2 class="mb-4"><%= _("Votes") %></h2>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue