2014-04-26 02:42:16 +00:00
|
|
|
<h1 class="title">Listing Contests</h1>
|
2014-03-23 00:22:25 +00:00
|
|
|
|
|
|
|
<% if cuser and cuser.admin? %>
|
2014-04-26 02:42:16 +00:00
|
|
|
<%= link_to 'New Contest', new_contest_path, class: 'button' %>
|
2014-03-23 00:22:25 +00:00
|
|
|
<% end %>
|
|
|
|
|
2014-04-26 02:42:16 +00:00
|
|
|
<div id="contests">
|
|
|
|
<div class="current">
|
|
|
|
<h3 class="title">Current Contests</h3>
|
2014-03-23 00:22:25 +00:00
|
|
|
|
2014-04-26 02:42:16 +00:00
|
|
|
<table class="current striped">
|
|
|
|
<tr>
|
|
|
|
<th class="name">Name</th>
|
|
|
|
<th class="date">Start</th>
|
|
|
|
<th class="status">Status</th>
|
|
|
|
<% if cuser and cuser.admin? %>
|
|
|
|
<th class="actions"></th>
|
|
|
|
<% end %>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<% @contests_active.each do |contest| %>
|
|
|
|
<tr>
|
|
|
|
<td><%= link_to (h contest.name), contest %></td>
|
|
|
|
<td><%= longdate contest.start %></td>
|
|
|
|
<td><%= contest.statuses[contest.status] %></td>
|
|
|
|
<% if cuser and cuser.admin? %>
|
|
|
|
<td class="actions">
|
|
|
|
<%= link_to icon('pencil'), edit_contest_path(contest) %>
|
|
|
|
<%= link_to icon('times'), contest, confirm: 'Are you sure?', method: :delete %>
|
|
|
|
</td>
|
|
|
|
<% end %>
|
|
|
|
</tr>
|
2014-03-23 00:22:25 +00:00
|
|
|
<% end %>
|
2014-04-26 02:42:16 +00:00
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="previous">
|
|
|
|
<h3 class="title">Previous Contests</h3>
|
2014-03-23 00:22:25 +00:00
|
|
|
|
2014-04-26 02:42:16 +00:00
|
|
|
<table class="previous striped">
|
|
|
|
<tr>
|
|
|
|
<th class="name">Name</th>
|
|
|
|
<th class="date">Date</th>
|
|
|
|
<th class="winner">Winner</th>
|
|
|
|
<% if cuser and cuser.admin? %>
|
|
|
|
<th class="actions"></th>
|
|
|
|
<% end %>
|
|
|
|
</tr>
|
2014-03-23 00:22:25 +00:00
|
|
|
|
2014-04-26 02:42:16 +00:00
|
|
|
<% @contests_inactive.reverse_each do |contest| %>
|
|
|
|
<tr>
|
|
|
|
<td><%= link_to (h contest.name), contest %></td>
|
|
|
|
<td><%= longdate contest.start %></td>
|
|
|
|
<% if contest.winner then %>
|
|
|
|
<td><%= flag contest.winner.team.country %> <%= link_to (h contest.winner.team.name), contest.winner %></td>
|
|
|
|
<% else %>
|
|
|
|
<td></td>
|
|
|
|
<% end %>
|
|
|
|
<% if cuser and cuser.admin? %>
|
|
|
|
<td class="actions">
|
|
|
|
<%= link_to icon('pencil'), edit_contest_path(contest) %>
|
|
|
|
<%= link_to icon('times'), contest, confirm: 'Are you sure?', method: :delete %>
|
|
|
|
</td>
|
|
|
|
<% end %>
|
|
|
|
</tr>
|
2014-03-23 00:22:25 +00:00
|
|
|
<% end %>
|
2014-04-26 02:42:16 +00:00
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<% if cuser and cuser.admin? %>
|
|
|
|
<%= link_to 'New Contest', new_contest_path, class: 'button' %>
|
2014-03-23 00:22:25 +00:00
|
|
|
<% end %>
|
2014-04-26 02:42:16 +00:00
|
|
|
</div>
|