mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-04-06 14:36:59 +00:00
Added all_results page to tournaments
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
<ul class="dropdown-menu">
|
||||
<li><strong>Results</strong></li>
|
||||
<li><%= link_to "Team Scores" , "/tournaments/#{@tournament.id}/team_scores" %></li>
|
||||
<li><%= link_to "All Match Results" , "/tournaments/#{@tournament.id}/all_results" %></li>
|
||||
<li><strong>Brackets</strong></li>
|
||||
<% @tournament.weights.sort_by{|weight| weight.max }.each do |weight| %>
|
||||
<li><%= link_to "#{weight.max}" , "/tournaments/#{@tournament.id}/brackets/#{weight.id}" %></li>
|
||||
|
||||
8
app/views/tournaments/all_results.html.erb
Normal file
8
app/views/tournaments/all_results.html.erb
Normal file
@@ -0,0 +1,8 @@
|
||||
<% @matches.select{|m| m.finished == 1 && m.w1 && m.w2}.sort_by{|m| [ m.bout_number, m.bracket_position, m.weight.max ]}.each do |match| %>
|
||||
<% if @round != match.round || @bracket_position != match.bracket_position %>
|
||||
<p><strong><%= match.bracket_position %> Round: <%= match.round %></strong></p>
|
||||
<% end %>
|
||||
<p><%= match.all_results_text %></p>
|
||||
<% @round = match.round %>
|
||||
<% @bracket_position = match.bracket_position %>
|
||||
<% end %>
|
||||
Reference in New Issue
Block a user