From da284d090e74d790bd80a8e4ed0400eb073e36b6 Mon Sep 17 00:00:00 2001 From: Tomer Kimia Date: Fri, 7 Mar 2014 17:54:11 -0500 Subject: tournaments table is better --- app/views/tournaments/index.html.erb | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) (limited to 'app/views/tournaments') 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 @@ Game Status - Min players per team - Max players per team - Min teams per match - Max teams per match - Set rounds + Players per team + Teams per match Randomized teams @@ -22,12 +19,28 @@ <% @tournaments.each do |tournament| %> <%= tournament.id %> - <%= tournament.status %> - <%= tournament.min_players_per_team %> - <%= tournament.max_players_per_team %> - <%= tournament.min_teams_per_match %> - <%= tournament.max_teams_per_match %> - <%= tournament.set_rounds %> + <% case tournament.status + when 0 %> + <%= form_tag(tournament_path(tournament), method: "put") do %> + + <%= submit_tag("Join") %> + <% end %> + <% when 1 %> + Ongoing + <% else %> + Closed + <%end %> + + <%= tournament.min_players_per_team %> + <% if tournament.min_players_per_team != tournament.max_players_per_team %> + to <%= tournament.max_players_per_team %> + <% end %> + + <%= tournament.min_teams_per_match %> + <% if tournament.min_teams_per_match != tournament.max_teams_per_match %> + to <%= tournament.max_teams_per_match %> + <% end %> + <%= tournament.randomized_teams %> <%= link_to 'Show', tournament %> <%= link_to 'Edit', edit_tournament_path(tournament) %> -- cgit v1.2.3-54-g00ecf