summaryrefslogtreecommitdiff
path: root/app/views/matches/index.html.erb
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/matches/index.html.erb')
-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>