1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-04-02 13:15:27 +00:00
Files
wrestlingdev.com/app/views/tournaments/all_brackets.html.erb

28 lines
1.3 KiB
Plaintext

<% cache ["#{@tournament.id}_all_brackets", @tournament] do %>
<div id="exportable">
<%= render :file => 'tournaments/team_scores' %>
<% @tournament.weights.sort_by{|w| w.max}.each do |weight| %>
<table class='pagebreak'>
<tr>
<% if @tournament.tournament_type == "Pool to bracket" %>
<td valign="top" style="padding: 10px;">
<!-- Need to define what the tournaments#bracket controller defines -->
<% @matches = @tournament.matches.select{|m| m.weight_id == weight.id} %>
<% @wrestlers = Wrestler.where(weight_id: weight.id) %>
<% @pools = weight.pool_rounds(@matches) %>
<% @weight = weight %>
<%= render 'bracket_partial' %>
</td>
<% elsif @tournament.tournament_type == "Modified 16 Man Double Elimination" or @tournament.tournament_type == "Double Elimination 1-6" %>
<td valign="top" style="padding: 10px;">
<!-- Need to define what the tournaments#bracket controller defines -->
<% @matches = weight.matches %>
<% @weight = weight %>
<%= render 'bracket_partial' %>
</td>
<% end %>
</tr>
</table>
<% end %>
</div>
<% end %>