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/assets/stylesheets/tournaments.css.scss | 25 ++++++++ app/views/tournaments/index.html.erb | 88 ++++++++++++++--------------- 2 files changed, 66 insertions(+), 47 deletions(-) diff --git a/app/assets/stylesheets/tournaments.css.scss b/app/assets/stylesheets/tournaments.css.scss index eca4c7e..8de3d81 100644 --- a/app/assets/stylesheets/tournaments.css.scss +++ b/app/assets/stylesheets/tournaments.css.scss @@ -39,4 +39,29 @@ span.default-explanation { .black { color: black; } +} + +div.tournament-listing { + margin-top: 10px; + border-radius: 5px; + box-shadow: 2px 2px 4px #B8B8B8; + border: 2px solid #AAAAAA; + min-height: 100px; + padding: 4px; + + + h3 { + margin-top: 0px; + color: #F0AD4E; + font-weight: bold; + } + + h3:hover { + color: #D09D3E; + } + + .host { + font-weight: bold; + } + } \ No newline at end of file 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