<h1 class="title">Listing Challenges</h1>

<table class="striped">
  <tr>
    <th>Challenger</th>
    <th>Recipient</th>
    <th>Match time</th>
    <th>Status</th>
    <th class="actions"></th>
  </tr>

  <% @challenges.each do |challenge| %>
    <tr class="<%= cycle('even', 'odd') %>">
      <td><%= namelink challenge.contester1.team %></td>
      <td><%= namelink challenge.contester2.team %></td>
      <td><%= link_to (shorttime challenge.match_time), challenge %></td>
      <td><%= challenge.statuses[challenge.status] %></td>
      <td class="actions"><%= link_to icon('times'), challenge, confirm: 'Are you sure?', method: :delete %></td>
    </tr>
  <% end %>
</table>