akkounts/app/views/admin/users/index.html.erb
Râu Cao cbbb4c6e47
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
Add pagination to admin pages
2023-03-01 17:08:36 +08:00

55 lines
1.4 KiB
Plaintext

<%= render HeaderComponent.new(title: "Users: #{@ou}") %>
<%= render MainSimpleComponent.new do %>
<section>
<%= render QuickstatsContainerComponent.new do %>
<%= render QuickstatsItemComponent.new(
type: :number,
title: 'Confirmed',
value: @stats[:users_confirmed],
) %>
<%= render QuickstatsItemComponent.new(
type: :number,
title: 'Pending',
value: @stats[:users_pending],
) %>
<% end %>
</section>
<% if @orgs.length > 1 %>
<section>
<h3 class="hidden">Domains</h3>
<ul>
<% @orgs.each do |org| %>
<li class="inline-block">
<%= link_to org[:ou], admin_users_path(ou: org[:ou]), class: "ks-text-link" %>
</li>
<% end %>
</ul>
</section>
<% end %>
<section>
<table class="divided mb-8">
<thead>
<tr>
<th>UID</th>
<th>Status</th>
<th>Roles</th>
<!-- <th>Password</th> -->
</tr>
</thead>
<tbody>
<% @users.each do |user| %>
<tr>
<td><%= link_to(user.cn, admin_user_path(user.address), class: 'ks-text-link') %></td>
<td><%= user.confirmed_at.nil? ? badge("pending", :yellow) : "" %></td>
<td><%= user.is_admin? ? badge("admin", :red) : "" %></td>
</tr>
<% end %>
</tbody>
</table>
<%== pagy_nav @pagy %>
</section>
<% end %>