From 13966bb1265ba6a26baa37317fbc83cf380a38f6 Mon Sep 17 00:00:00 2001 From: Tomer Kimia Date: Thu, 27 Mar 2014 17:57:11 -0400 Subject: ROUGH listing of tournaments --- app/views/tournaments/index.html.erb | 88 +++++++++++++++++------------------- 1 file changed, 41 insertions(+), 47 deletions(-) (limited to 'app/views') diff --git a/app/views/tournaments/index.html.erb b/app/views/tournaments/index.html.erb index 90c3d7a..804d086 100644 --- a/app/views/tournaments/index.html.erb +++ b/app/views/tournaments/index.html.erb @@ -1,55 +1,49 @@

Listing Tournaments

<% if @tournaments.length > 0 %> - - - - - - - - - - - - - - - - - <% @tournaments.each do |tournament| %> - - - - - - - - - - +

You've signed up for this tournament!

+ <% end %> + + + <% end %> - -
NameGameStatusPlayers per teamTeams per matchRandomized teams
<%= tournament.name %><% case tournament.status - when 0 %> - <%= form_tag(tournament_path(tournament), method: "put") do %> - - <%= submit_tag("Join") %> - <% end %> - <% when 1 %> - Ongoing +
+ + <% @tournaments.each do |t| %> +
+
Gravatar of Host Goes Here
+ + +
+ <%# "header" %> + <%= link_to(t) do %> +

<%= t.name %>

+ <% end %> + +
+
+ Hosted by: <%= t.hosts.first.name %> +
+
+

Players per team

+

two

+
+
+ +
+ + +
+ <%# If this guy is logged in AND not in the tournament %> + <% if signed_in? && !t.players.include?(current_user) %> + <%= form_tag(tournament_path(t), method: "put") do %> + + <%= submit_tag("Join") %> + <% end %> <% 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) %><%= link_to 'Destroy', tournament, method: :delete, data: { confirm: 'Are you sure?' } %>
+ + + <% else %>

No tournaments going on right now... Why not start your own?

<% end %> -- cgit v1.2.3-2-g168b