1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-03-25 01:14:43 +00:00
Files
wrestlingdev.com/app/views/tournaments/all_brackets.html.erb

43 lines
1.6 KiB
Plaintext

<style>
.pagebreak {
page-break-after: always;
border: none;
margin: 0px;
padding: 0px;
width: 8in; /* width: 7in; */
height: 9.5in; /* or height: 9.5in; */
font-size: 8px;
position: relative;
left: 0in;
height: 1in;
}
</style>
<% cache ["#{@tournament.id}_all_brackets", @tournament] do %>
<div id="exportable" >
<%= render file: Rails.root.join('app/views/tournaments/team_scores.html.erb') %>
<% @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 %>