akkounts/app/views/invitations/index.html.erb
Sebastian Kippe 2e301c3019
All checks were successful
continuous-integration/drone/push Build is passing
Port admin to new layout
2022-02-20 11:22:06 -06:00

60 lines
1.6 KiB
Plaintext

<%= render partial: "components/header", locals: { page_title: "Invitations" } %>
<%= render layout: "components/main_simple" do %>
<section>
<% if @invitations_unused.any? %>
<p>
Invite your friends to a Kosmos account by sharing an invitation URL with them:
</p>
<% end %>
</section>
<section>
<% if @invitations_unused.any? %>
<table>
<thead>
<tr class="text-left">
<th>URL</th>
</tr>
</thead>
<tbody>
<% @invitations_unused.each do |invitation| %>
<tr>
<td class="font-mono"><%= invitation_url(invitation.token) %></td>
</tr>
<% end %>
</tbody>
</table>
<% else %>
<p>
You do not have any invitations to give away yet. All good
things come in time.
</p>
<% end %>
</section>
<% if @invitations_used.any? %>
<section>
<h3>Accepted Invitations</h3>
<table>
<thead>
<tr class="text-left">
<th class="hidden md:block">ID</th>
<th>Accepted</th>
<th>Invited user</th>
</tr>
</thead>
<tbody>
<% @invitations_used.each do |invitation| %>
<tr>
<td class="hidden md:block font-mono"><%= invitation.token %></td>
<td><%= invitation.used_at.strftime("%Y-%m-%d") %></td>
<td><%= User.find(invitation.invited_user_id).address %></td>
</tr>
<% end %>
</tbody>
</table>
</section>
<% end %>
<% end %>