summaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authortkimia <tkimia@purdue.edu>2014-04-22 17:43:02 -0400
committertkimia <tkimia@purdue.edu>2014-04-22 17:43:02 -0400
commit27ed02ceaafe466307fc5a5d584aa329ea147be5 (patch)
tree0a54bb2c9c8cfb7d82eeea8cf4fca9283e0b27d5 /app/views
parentbb53f8ac2ab52301b32fe65ddc10a32f6bc730e8 (diff)
parent42aa0fe7fdfc51f79cda90c4d71621a797995a6c (diff)
Merge branch 'master' of https://github.com/LukeShu/leaguer
Diffstat (limited to 'app/views')
-rw-r--r--app/views/matches/index.html.erb36
-rw-r--r--app/views/servers/edit.html.erb2
2 files changed, 20 insertions, 18 deletions
diff --git a/app/views/matches/index.html.erb b/app/views/matches/index.html.erb
index abca42b..058477a 100644
--- a/app/views/matches/index.html.erb
+++ b/app/views/matches/index.html.erb
@@ -12,26 +12,30 @@
</thead>
<tbody class="table-hover">
- <% @tournament.matches.order(:id).reverse.each do |match| %><tr>
- <td><%= "Match #{match.id}" %></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">
- <% @startable = (match.status == 0) and (match.teams.count >= @tournament.min_teams_per_match) %>
- <%= submit_tag("Start Match", :disabled => ! @startable) %>
+ <% @tournament.stages_ordered.keys.sort.each do |stage_key| %>
+ <% stage = @tournament.stages_ordered[stage_key] %>
+ <% stage.matches_ordered.keys.sort.reverse.each do |match_key| %><tr>
+ <% match = stage.matches_ordered[match_key] %>
+ <td><%= "Match #{match.id}" %></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">
+ <% @startable = (match.status == 0) and (match.teams.count >= @tournament.min_teams_per_match) %>
+ <%= submit_tag("Start Match", :disabled => ! @startable) %>
+ <% end %>
<% end %>
- <% end %>
- </td>
- </tr><% end %>
+ </td>
+ </tr><% end %>
+ <% end %>
</tbody>
</table>
<br>
-<% @tournament.stages_ordered.each do |stage| %>
- <div class="graph"><%= stage.to_svg %></div>
+<% @tournament.stages_ordered.keys.sort.each do |stage_key| %>
+ <div class="graph"><%= raw @tournament.stages_ordered[stage_key].to_svg %></div>
<% end %>
diff --git a/app/views/servers/edit.html.erb b/app/views/servers/edit.html.erb
index d37864f..f29a65c 100644
--- a/app/views/servers/edit.html.erb
+++ b/app/views/servers/edit.html.erb
@@ -1,5 +1,3 @@
<h1>Editing server</h1>
<%= render 'form' %>
-
-<%= link_to server_path %>