From 53b4f8028fc987b0cf26a7a073fec7064b4b6d8a Mon Sep 17 00:00:00 2001 From: AndrewMurrell Date: Tue, 25 Mar 2014 17:38:38 -0400 Subject: revert Guntas --- app/views/tournaments/show.html.erb | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) (limited to 'app/views/tournaments/show.html.erb') diff --git a/app/views/tournaments/show.html.erb b/app/views/tournaments/show.html.erb index 3cb6179..3de0623 100644 --- a/app/views/tournaments/show.html.erb +++ b/app/views/tournaments/show.html.erb @@ -1,5 +1,19 @@ -

<%= notice %>

+<% if @tournament.joinable_by?(current_user) %> + <%= form_tag(tournament_path(@tournament), method: "put") do %> + + <%= current_user.name %><%= submit_tag("Join") %> + <% end %> +<% end %> + +
+ <%= tag("div", {:class => "progress-bar progress-bar-warning", :style => "width: " +(@tournament.players.count * 100 / (@tournament.min_players_per_team * @tournament.min_teams_per_match)).to_s + "%", "aria-valuemax" => "100", "aria-valuemin" => "0", "aria-valuenow" => (@tournament.players.count * 100 / (@tournament.min_players_per_team * @tournament.min_teams_per_match)).to_s, "role" => "progressbar"}) %> + 60% Complete (warning) +
+ +

<%= @tournament.players.count %> have signed up. <%= @tournament.min_players_per_team * @tournament.min_teams_per_match %> needed.

+ +<% if current_user.in_group?(:host) %>

Name: <%= @tournament.name %> @@ -7,7 +21,7 @@

Game: - <%= @tournament.game %> + <%= @tournament.id %>

@@ -45,5 +59,22 @@ <%= @tournament.randomized_teams %>

+

+ Status: + <%= @tournament.status %> +

+ +<%= form_tag(tournaments_path.to_s + "/" + @tournament.id.to_s + "/edit", method: "get") do %> + + <% if @tournament.players.count >= @tournament.min_players_per_team * @tournament.min_teams_per_match %> + <%= submit_tag("Close Tournament Registration") %> + <% else %> + <%= submit_tag("Close Tournament Registration", disabled: true) %> + <% end %> +<% end %> + <%= link_to 'Edit', edit_tournament_path(@tournament) %> | <%= link_to 'Back', tournaments_path %> + +<% end %> + -- cgit v1.2.3-54-g00ecf