summaryrefslogtreecommitdiff
path: root/app/views/tournaments/show.html.erb
diff options
context:
space:
mode:
authorTomer Kimia <tkimia@purdue.edu>2014-03-27 16:59:11 -0400
committerTomer Kimia <tkimia@purdue.edu>2014-03-27 16:59:11 -0400
commita683a208e31d5bafe7658521921f9f2c1a637418 (patch)
treeabf23ef14f584583973796b3da573c5061eb8533 /app/views/tournaments/show.html.erb
parentaeda550c2ad04c9496a803b1d7f1d34a4566a9fe (diff)
parentd8acc6785ee41a2628cd0d59d91916b2f087290b (diff)
Merge branch 'master' of https://github.com/LukeShu/leaguer
Conflicts: app/views/tournaments/show.html.erb
Diffstat (limited to 'app/views/tournaments/show.html.erb')
-rw-r--r--app/views/tournaments/show.html.erb24
1 files changed, 16 insertions, 8 deletions
diff --git a/app/views/tournaments/show.html.erb b/app/views/tournaments/show.html.erb
index acff3d4..cc0f0e3 100644
--- a/app/views/tournaments/show.html.erb
+++ b/app/views/tournaments/show.html.erb
@@ -1,3 +1,6 @@
+<h2 id="tournament-name">
+ <%= @tournament.name %>
+</h2>
<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"}) %>
@@ -6,15 +9,16 @@
</div>
<p id="players-needed"><%= pluralize(@tournament.players.count, "player has", "players have") %> signed up. <%= @tournament.min_players_per_team * @tournament.min_teams_per_match %> needed. </p>
-<div id="tournament-side-params">
- <p>
- <strong>Game:</strong>
- <%= @tournament.id %>
- </p>
+<span id="tournament-side-params">
+
<p>
<strong>Status:</strong>
- <%= @tournament.status %>
+ <% if @tournament.status == 0 %>
+ Waiting for players...
+ <% else %>
+ Started
+ <% end %>
</p>
<p>
@@ -46,15 +50,19 @@
<strong>Randomized teams:</strong>
<%= @tournament.randomized_teams %>
</p>
-</div>
+</span>
+<div >
<%# Show all players in the tournament %>
<% if @tournament.players.length > 0 %>
+<h3> Players Here: </h3>
<ul id="tournament-users">
<% @tournament.players.each do |p| %>
<li><span class="black"> <%= p.user_name %> </span> </li>
<% end %>
</ul>
+ <% else %>
+ <h3 div="players-needed">Hmmm.... nobody's here yet! You and your friends should join the tournament.</h3>
<% end %>
<%# If user can join, and user hasn't joined already, show the join tournment tag %>
@@ -79,5 +87,5 @@
<%= link_to 'Back', tournaments_path %>
<% end %>
<%end %>
-
+</div>