Show unused invitations list
This commit is contained in:
@@ -1,23 +1,46 @@
|
||||
<section>
|
||||
<h2>Invitations</h2>
|
||||
<% if @invitations_unused.any? %>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>URL</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @invitations_unused.each do |invitation| %>
|
||||
<tr>
|
||||
<td><%= 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? %>
|
||||
<h3>Accepted Invitations</h3>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Token</th>
|
||||
<th>Created at</th>
|
||||
<th colspan="3"></th>
|
||||
<th>URL</th>
|
||||
<th>Used at</th>
|
||||
<th>Invited user</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<% @invitations.each do |invitation| %>
|
||||
<% @invitations_used.each do |invitation| %>
|
||||
<tr>
|
||||
<td><%= invitation.token %></td>
|
||||
<td><%= invitation.created_at %></td>
|
||||
<td><%= link_to 'Delete', invitation, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||
<td><%= invitation_url(invitation.token) %></td>
|
||||
<td><%= invitation.used_at %></td>
|
||||
<td><%= User.find(invitation.invited_user_id).address %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
<% end %>
|
||||
|
||||
Reference in New Issue
Block a user