<div class="box wide">
  <p>
  These persons have requested invitations and confirmed their e-mail
  addresses.  If you recognize anyone, feel free to send them an invitation and
  remove their request.  If a request looks suspicious, delete it.
  </p>

  <table class="data zebra" width="100%" cellspacing=0>
  <tr>
    <th width="15%">Date/Time</th>
    <th width="20%">Name</th>
    <th width="40%">Memo</th>
    <th width="15%"></th>
    <th width="10%"></th>
  </tr>
  <% @invitation_requests.each do |ir| %>
    <tr>
      <td><%= ir.created_at.strftime("%Y-%m-%d %H:%M:%S") %></td>
      <td><%= ir.name %>
        <% if @user.is_moderator? %>
          <br>
          <em><%= ir.email %></em>
        <% end %></td>
      <td><%= raw ir.markeddown_memo %></td>
      <td><%= form_with url: send_invitation_for_request_path do |f| %>
        <%= f.hidden_field "code", :value => ir.code %>
        <%= f.submit "Send Invitation" %>
      <% end %></td>
      <td><%= form_with url: delete_invitation_request_path do |f| %>
        <%= f.hidden_field "code", :value => ir.code %>
        <%= f.submit "Delete" %>
      <% end %>
    </tr>
  <% end %>
  <% if @invitation_requests.length == 0 %>
    <tr>
      <td colspan=<%= @user.is_moderator?? 5 : 4 %> align="center"><span class="na">No invitation requests</span></td>
    </tr>
  <% end %>
  </table>
</div>
