summaryrefslogtreecommitdiff
path: root/app/views/tournaments/index.html.erb
diff options
context:
space:
mode:
authorTomer Kimia <tkimia@purdue.edu>2014-03-07 17:54:11 -0500
committerTomer Kimia <tkimia@purdue.edu>2014-03-07 17:54:11 -0500
commitda284d090e74d790bd80a8e4ed0400eb073e36b6 (patch)
tree21d058fa92ed008f30234f6813dc1d386799e293 /app/views/tournaments/index.html.erb
parent7e7a0a4a0465142612acd1e0d050cb1b91f93d90 (diff)
tournaments table is better
Diffstat (limited to 'app/views/tournaments/index.html.erb')
-rw-r--r--app/views/tournaments/index.html.erb35
1 files changed, 24 insertions, 11 deletions
diff --git a/app/views/tournaments/index.html.erb b/app/views/tournaments/index.html.erb
index d4ef414..7fb4a1d 100644
--- a/app/views/tournaments/index.html.erb
+++ b/app/views/tournaments/index.html.erb
@@ -6,11 +6,8 @@
<tr>
<th>Game</th>
<th>Status</th>
- <th>Min players per team</th>
- <th>Max players per team</th>
- <th>Min teams per match</th>
- <th>Max teams per match</th>
- <th>Set rounds</th>
+ <th>Players per team</th>
+ <th>Teams per match</th>
<th>Randomized teams</th>
<th></th>
<th></th>
@@ -22,12 +19,28 @@
<% @tournaments.each do |tournament| %>
<tr>
<td><%= tournament.id %></td>
- <td><%= tournament.status %></td>
- <td><%= tournament.min_players_per_team %></td>
- <td><%= tournament.max_players_per_team %></td>
- <td><%= tournament.min_teams_per_match %></td>
- <td><%= tournament.max_teams_per_match %></td>
- <td><%= tournament.set_rounds %></td>
+ <td><% case tournament.status
+ when 0 %>
+ <%= form_tag(tournament_path(tournament), method: "put") do %>
+ <input type="hidden" name="update_action" value="join">
+ <%= submit_tag("Join") %>
+ <% end %>
+ <% when 1 %>
+ Ongoing
+ <% else %>
+ Closed
+ <%end %>
+ </td>
+ <td><%= tournament.min_players_per_team %>
+ <% if tournament.min_players_per_team != tournament.max_players_per_team %>
+ to <%= tournament.max_players_per_team %>
+ <% end %>
+ </td>
+ <td><%= tournament.min_teams_per_match %>
+ <% if tournament.min_teams_per_match != tournament.max_teams_per_match %>
+ to <%= tournament.max_teams_per_match %>
+ <% end %>
+ </td>
<td><%= tournament.randomized_teams %></td>
<td><%= link_to 'Show', tournament %></td>
<td><%= link_to 'Edit', edit_tournament_path(tournament) %></td>