From 41e2a181bac54c965ef2bf7181289c21a83883f6 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 22 Apr 2014 17:05:06 -0400 Subject: I HATE CODE --- app/views/matches/index.html.erb | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) (limited to 'app/views') 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 @@ - <% @tournament.matches.order(:id).reverse.each do |match| %> - <%= "Match #{match.id}" %> - <%= match.status %> - <%= (match.winner.nil? ? "-" : "Team #{match.winner.id}") %> - <%= link_to "Show", tournament_match_path(@tournament, match) %> - <%# 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 %> - - <% @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| %> + <% match = stage.matches_ordered[match_key] %> + <%= "Match #{match.id}" %> + <%= match.status %> + <%= (match.winner.nil? ? "-" : "Team #{match.winner.id}") %> + <%= link_to "Show", tournament_match_path(@tournament, match) %> + <%# 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 %> + + <% @startable = (match.status == 0) and (match.teams.count >= @tournament.min_teams_per_match) %> + <%= submit_tag("Start Match", :disabled => ! @startable) %> + <% end %> <% end %> - <% end %> - - <% end %> + + <% end %> + <% end %>
-<% @tournament.stages_ordered.each do |stage| %> -
<%= stage.to_svg %>
+<% @tournament.stages_ordered.keys.sort.each do |stage_key| %> +
<%= raw @tournament.stages_ordered[stage_key].to_svg %>
<% end %> -- cgit v1.2.3-54-g00ecf From 50155acae565a6afbca053263fd44e568a0bea85 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 22 Apr 2014 17:05:16 -0400 Subject: fix link --- app/views/servers/edit.html.erb | 2 -- 1 file changed, 2 deletions(-) (limited to 'app/views') 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 @@

Editing server

<%= render 'form' %> - -<%= link_to server_path %> -- cgit v1.2.3-54-g00ecf