<h1>Gather Archive</h1>
<h5 class="title">Players in bold were captains for their respective teams.</h5>

<table class="gathers striped">
  <tr>
    <th class="date">Date</th>
    <th class="team1">Team 1</th>
    <th class="team2">Team 2</th>
  </tr>

  <% @gathers.each do |gather| %>
    <tr class="<%= cycle('even', 'odd') %>">
      <td><%= link_to gather.updated_at.strftime("%Y/%m/%d %H:%M:%S"), gather %></td>
      <td>
        <ul>
          <% gather.gatherers.each do |gatherer| %>
            <li>
              <% if gatherer.team == 1 %>
                <% if gather.captain1 == gatherer %>
                  <strong>
                <% end %>
                <%= link_to gatherer.user.to_s, User.find_by_username(gatherer.user.to_s) %>
                <% if gather.captain1 == gatherer %>
                  </strong>
                <% end %>
              <% end %>
            </li>
          <% end %>
        </ul>
      </td>
      <td>
        <ul>
          <% gather.gatherers.each do |gatherer| %>
            <li>
              <% if gatherer.team == 2 %>
                <% if gather.captain2 == gatherer %>
                  <strong>
                <% end %>
                <%= link_to gatherer.user.to_s, User.find_by_username(gatherer.user.to_s) %>
                <% if gather.captain2 == gatherer %>
                  </strong>
                <% end %>
              <% end %>
            </li>
          <% end %>
        </ul>
      </td>
    </tr>
  <% end %>
</table>
