ensl.org/app/views/gathers/index.html.erb
2020-03-26 20:50:14 +02:00

57 lines
No EOL
1.5 KiB
Text

<h1>Gather Archive</h1>
<h5 class="title">Players starred were captains for their respective teams.</h5>
<%= will_paginate @gathers %>
<table class="gathers striped">
<tr>
<th class="info">Info</th>
<th class="team1">Team 1</th>
<th class="team2">Team 2</th>
</tr>
<% @gathers.each do |gather| %>
<tr class="<%= cycle('even', 'odd') %>">
<td>
<p>
<%= link_to gather.updated_at.strftime("%Y/%m/%d %H:%M:%S"), gather %>
</p>
<p>
<%= namelink gather&.map1&.map %>
<%= namelink gather&.map2&.map %>
</p>
</td>
<td>
<ul>
<% gather.gatherers.ordered.each do |gatherer| %>
<li>
<% if gatherer.team == 1 %>
<%= link_to gatherer.user.to_s, User.find_by_username(gatherer.user.to_s) %>
<% if gather.captain1 == gatherer %>
<%= icon 'star' %>
<% end %>
<% end %>
</li>
<% end %>
</ul>
</td>
<td>
<ul>
<% gather.gatherers.ordered.each do |gatherer| %>
<li>
<% if gatherer.team == 2 %>
<%= link_to gatherer.user.to_s, User.find_by_username(gatherer.user.to_s) %>
<% if gather.captain2 == gatherer %>
<%= icon 'star' %>
<% end %>
<% end %>
</li>
<% end %>
</ul>
</td>
</tr>
<% end %>
</table>
<%= will_paginate @gathers %>