From 87d69d44d9d7f56071f34597fd46bd26b59ab9fd Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 7 Apr 2014 12:43:23 -0400 Subject: stuff --- app/views/tournaments/index.html.erb | 100 +++++++++++++++++------------------ 1 file changed, 48 insertions(+), 52 deletions(-) (limited to 'app/views/tournaments/index.html.erb') diff --git a/app/views/tournaments/index.html.erb b/app/views/tournaments/index.html.erb index 72eacba..7957042 100644 --- a/app/views/tournaments/index.html.erb +++ b/app/views/tournaments/index.html.erb @@ -1,56 +1,52 @@

Listing Tournaments

-<% if @tournaments.length > 0 %> -
- - <%# Each tournament has a div for its listing %> - <% @tournaments.each do |t| %> -
-
<%= image_tag 'http://www.gravatar.com/avatar/' + Digest::MD5.hexdigest(t.hosts.first.email) + '?s=100&d=mm' %>
- +
+ <% if @tournaments.length > 0 %> + <%# Each tournament has a div for its listing %> + <% @tournaments.each do |t| %> +
+
<%= image_tag 'http://www.gravatar.com/avatar/' + Digest::MD5.hexdigest(t.hosts.first.email) + '?s=100&d=mm' %>
+
+ <%# "header" %> + <%= link_to(t) do %>

<%= t.name %>

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

Players per team: <%= t.min_players_per_team %>

+

Players signed up: <%= t.players.count %>

+
+
+

<%= (t.randomized_teams)? "Teams are Random" : "Teams are Chosen" %>

+

Players signed up: <%= t.players.count %>

+
+
+
+
+ <% if signed_in? %> + <% if !t.players.include?(current_user) %> + <%= form_tag(tournament_path(t), method: "put") do %> + + <%= submit_tag("Join") + %> + <% end %> + <% else %> +

You've signed up for this tournament!

+ <% end %> + <% end %> +
+
+ <% end %> + <% else %> +

No tournaments going on right now... + <% if current_user.can?(:create_tournament) %> + Why not start your own? + <% end %> +

+ <% end %> +
-
- <%# "header" %> - <%= link_to(t) do %> -

<%= t.name %>

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

Players per team: <%= t.min_players_per_team %>

-

Players signed up: <%= t.players.count %>

-
-
-

<%= (t.randomized_teams)? "Teams are Random" : "Teams are Chosen" %>

-

Players signed up: <%= t.players.count %>

-
-
- -
- - -
- <%# 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 %> -

You've signed up for this tournament!

- <% end %> -
- -
- <% end %> - -
-<% else %> -

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

+<% if current_user.can?(:create_tournament) %> +
<%= link_to 'New Tournament', new_tournament_path, :class => "btn btn-warning btn-lg" %>
<% end %> -
- -<%= link_to 'New Tournament', new_tournament_path, :class => "btn btn-warning btn-lg" %> -- cgit v1.2.3-2-g168b