51 lines
1.6 KiB
Plaintext
51 lines
1.6 KiB
Plaintext
<%= render HeaderComponent.new(title: "Invitations") %>
|
|
|
|
<%= render MainSimpleComponent.new do %>
|
|
<section>
|
|
<%= render QuickstatsContainerComponent.new do %>
|
|
<%= render QuickstatsItemComponent.new(
|
|
type: :number,
|
|
title: 'Available',
|
|
value: @stats[:available],
|
|
) %>
|
|
<%= render QuickstatsItemComponent.new(
|
|
type: :number,
|
|
title: 'Accepted',
|
|
value: @stats[:accepted],
|
|
) %>
|
|
<%= render QuickstatsItemComponent.new(
|
|
type: :number,
|
|
title: 'Users with referrals',
|
|
value: @stats[:users_with_referrals],
|
|
meta: "/ #{User.count}"
|
|
) %>
|
|
<% end %>
|
|
</section>
|
|
<% if @invitations_used.any? %>
|
|
<section>
|
|
<h3>Accepted</h3>
|
|
<table class="divided mb-8">
|
|
<thead>
|
|
<tr>
|
|
<th>Token</th>
|
|
<th>Accepted</th>
|
|
<th>Inviter</th>
|
|
<th>Invited user</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<% @invitations_used.each do |invitation| %>
|
|
<tr>
|
|
<td class="overflow-ellipsis font-mono"><%= invitation.token %></td>
|
|
<td><%= invitation.used_at.strftime("%Y-%m-%d (%H:%M UTC)") %></td>
|
|
<td><%= link_to invitation.user.cn, admin_user_path(invitation.user.cn), class: "ks-text-link" %></td>
|
|
<td><%= link_to invitation.invitee.cn, admin_user_path(invitation.invitee.cn), class: "ks-text-link" %></td>
|
|
</tr>
|
|
<% end %>
|
|
</tbody>
|
|
</table>
|
|
<%== pagy_nav @pagy %>
|
|
</section>
|
|
<% end %>
|
|
<% end %>
|