From fbac4c86b00ade6172c74da55d5561604c00e6b3 Mon Sep 17 00:00:00 2001 From: Tomer Kimia Date: Fri, 7 Mar 2014 19:03:04 -0500 Subject: FUCK IT WAS THE DAMN PERCENT IT COMES AFTER THE NUMBER NOT BEFORE WTF. the progress bar in the tournament is up --- app/views/tournaments/show.html.erb | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (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 5629980..6b6cb25 100644 --- a/app/views/tournaments/show.html.erb +++ b/app/views/tournaments/show.html.erb @@ -5,6 +5,14 @@ <% 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) %>

Game: @@ -53,7 +61,11 @@ <%= form_tag(tournaments_path.to_s + "/" + @tournament.id.to_s + "/edit", method: "get") do %> - <%= submit_tag("Close Tournament Registration") %> + <% 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) %> | -- cgit v1.2.3