diff options
Diffstat (limited to 'app/views/tournaments')
-rw-r--r-- | app/views/tournaments/_selected.html.erb | 5 | ||||
-rw-r--r-- | app/views/tournaments/show.html.erb | 14 |
2 files changed, 13 insertions, 6 deletions
diff --git a/app/views/tournaments/_selected.html.erb b/app/views/tournaments/_selected.html.erb index 7e91e85..8734b14 100644 --- a/app/views/tournaments/_selected.html.erb +++ b/app/views/tournaments/_selected.html.erb @@ -17,10 +17,5 @@ </p> <% end %> - <div class="field"> - <%= f.label :status %><br> - <%= f.number_field :status %> - </div> - <%= f.submit %> <% end %> 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 %> + +<div class="progress"> + <%= 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"}) %> + <span class="sr-only">60% Complete (warning)</span> + </div> +</div> +<p><%= @tournament.players.count %> have signed up. <%= @tournament.min_players_per_team * @tournament.min_teams_per_match %> needed. </p> + <% if current_user.in_group?(:host) %> <p> <strong>Game:</strong> @@ -53,7 +61,11 @@ <%= form_tag(tournaments_path.to_s + "/" + @tournament.id.to_s + "/edit", method: "get") do %> <input type="hidden" name="close_action" value="close"> - <%= 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) %> | |