diff options
author | Tomer Kimia <tkimia@purdue.edu> | 2014-03-07 17:54:11 -0500 |
---|---|---|
committer | Tomer Kimia <tkimia@purdue.edu> | 2014-03-07 17:54:11 -0500 |
commit | da284d090e74d790bd80a8e4ed0400eb073e36b6 (patch) | |
tree | 21d058fa92ed008f30234f6813dc1d386799e293 /app/views | |
parent | 7e7a0a4a0465142612acd1e0d050cb1b91f93d90 (diff) |
tournaments table is better
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/tournaments/index.html.erb | 35 |
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> |