1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-04-08 07:22:38 +00:00

Cached all_brackets page

This commit is contained in:
2015-12-29 15:13:43 +00:00
parent efe4036a5e
commit 50641edce3

View File

@@ -1,52 +1,55 @@
<style> <% cache ["all_brackets", @tournament] do %>
.pagebreak {
page-break-after: always;
border: none;
margin: 0px;
padding: 0px;
width: 7in; /* width: 7in; */
height: 9.5in; /* or height: 9.5in; */
font-size: 10px;
position: relative;
left: 1in;
height: 1in;
}
<style>
.pagebreak {
</style> page-break-after: always;
border: none;
<%= link_to "Back to #{@tournament.name} weights", "/tournaments/#{@tournament.id}/brackets" %> margin: 0px;
<br> padding: 0px;
<br> width: 7in; /* width: 7in; */
<div id="exportable"> height: 9.5in; /* or height: 9.5in; */
<% @tournament.weights.sort_by{|w| w.max}.each do |w| %> font-size: 10px;
<table class='pagebreak'> position: relative;
<td> left: 1in;
<% @weight = w %> height: 1in;
<% @matches = @tournament.matches.select{|m| m.weight_id == @weight.id} %> }
<% @wrestlers = Wrestler.where(weight_id: @weight.id) %>
<% @pools = w.poolRounds(@matches) %>
<h5><%= @weight.max %> lbs Bracket</h5>
</style>
<%= render 'pool' %>
</td> <%= link_to "Back to #{@tournament.name} weights", "/tournaments/#{@tournament.id}/brackets" %>
</table> <br>
<table class='pagebreak'> <br>
<td> <div id="exportable">
<% if w.pool_bracket_type == "twoPoolsToFinal" %> <% @tournament.weights.sort_by{|w| w.max}.each do |w| %>
<%= render 'twoPoolFinalBracket' %> <table class='pagebreak'>
<% end %> <td>
<% if w.pool_bracket_type == "twoPoolsToSemi" %> <% @weight = w %>
<%= render 'twoPoolSemiBracket' %> <% @matches = @tournament.matches.select{|m| m.weight_id == @weight.id} %>
<% end %> <% @wrestlers = Wrestler.where(weight_id: @weight.id) %>
<% if w.pool_bracket_type == "fourPoolsToQuarter" %> <% @pools = w.poolRounds(@matches) %>
<%= render 'fourPoolQuarterBracket' %> <h5><%= @weight.max %> lbs Bracket</h5>
<% end %>
<% if w.pool_bracket_type == "fourPoolsToSemi" %> <%= render 'pool' %>
<%= render 'fourPoolSemiBracket' %> </td>
<% end %> </table>
</td> <table class='pagebreak'>
</table> <td>
<% end %> <% if w.pool_bracket_type == "twoPoolsToFinal" %>
</div> <%= render 'twoPoolFinalBracket' %>
<% end %>
<% if w.pool_bracket_type == "twoPoolsToSemi" %>
<%= render 'twoPoolSemiBracket' %>
<% end %>
<% if w.pool_bracket_type == "fourPoolsToQuarter" %>
<%= render 'fourPoolQuarterBracket' %>
<% end %>
<% if w.pool_bracket_type == "fourPoolsToSemi" %>
<%= render 'fourPoolSemiBracket' %>
<% end %>
</td>
</table>
<% end %>
</div>
<% end %>