summaryrefslogtreecommitdiff
path: root/app/views/matches
diff options
context:
space:
mode:
authorguntasgrewal <guntasgrewal@gmail.com>2014-04-07 02:08:30 -0400
committerguntasgrewal <guntasgrewal@gmail.com>2014-04-07 02:08:30 -0400
commit4b76651ab6aa295eb9f2f9b7787f8d0fd612526c (patch)
tree2f888242952da717cc148691c84067aad8742267 /app/views/matches
parent13fe3bab84f236b46b3dbda080a22051553346c2 (diff)
fix bugs
Diffstat (limited to 'app/views/matches')
-rw-r--r--app/views/matches/index.html.erb11
1 files changed, 5 insertions, 6 deletions
diff --git a/app/views/matches/index.html.erb b/app/views/matches/index.html.erb
index 1941179..5a18109 100644
--- a/app/views/matches/index.html.erb
+++ b/app/views/matches/index.html.erb
@@ -4,26 +4,25 @@
<table class="table">
<thead>
<tr>
- <th>Status</th>
<th>Name</th>
+ <th>Status</th>
<th>Winner</th>
<th></th>
</tr>
</thead>
<tbody class="table-hover">
- <% @tournament.matches.each do |match| %>
+ <% @tournament.matches.order(:id).reverse.each do |match| %>
<tr>
- <td><%= match.status %></td>
- <td><%= match.id%></td>
<td><%= match.name %></td>
+ <td><%= match.status %></td>
+ <td><%= (match.winner.nil? ? "-" : "Team #{match.winner.id}") %></td>
<td><%= link_to "Show", tournament_match_path(@tournament, match) %>
<td> <%# If user is the host, let them start the tournment %>
<% if @tournament.hosts.include?(current_user) %>
-
<%= form_tag(tournament_match_path(@tournament, match), method: "put") do %>
<input type="hidden" name="update_action" value="start">
- <%= submit_tag("Start Match") %>
+ <%= submit_tag("Start Match", :dissabled => match.teams.count < @tournament.min_teams_per_match) %>
<% end %>
<% end %>
</div></td>