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

100 lines
2.3 KiB
Plaintext

<% cache ["#{@tournament.id}_all_brackets", @tournament] do %>
<style>
.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;
}
/*
* Bracket Layout Specifics
*/
main, ul {
display:flex;
}
ul {
flex-direction:column;
width: 100px;
list-style:none;
padding:0;
}
.game + li {
flex-grow:1;
}
li:first-child,li:last-child {
flex-grow:.5;
}
.game {
padding-left:5px;
}
.winner {
font-weight:bold;
}
.game span {
float:right;
margin-right:5px;
}
.game-top {
border-bottom:1px solid #aaa;
}
.game-top + li {
border-right:1px solid #aaa; min-height:30px;
}
.bracket-winner {
border-bottom:1px solid #aaa;
}
.game-bottom {
border-top:1px solid #aaa;
}
</style>
<div id="exportable">
<% @tournament.weights.sort_by{|w| w.max}.each do |w| %>
<table class='pagebreak'>
<h5><strong><%= @tournament.name %> - <%= w.max %> lbs Bracket</strong></h5>
<tr>
<td valign="top" style="padding: 10px;">
<% @weight = w %>
<% @matches = @tournament.matches.select{|m| m.weight_id == @weight.id} %>
<% @wrestlers = Wrestler.where(weight_id: @weight.id) %>
<% @pools = w.pool_rounds(@matches) %>
<%= render 'pool' %>
</td>
<td valign="top" style="padding: 10px;">
<% if w.pool_bracket_type == "twoPoolsToFinal" %>
<%= render 'twoPoolFinalBracket' %>
<% end %>
<% if w.pool_bracket_type == "twoPoolsToSemi" %>
<%= render 'twoPoolSemiBracket' %>
<% end %>
<% if w.pool_bracket_type == "fourPoolsToQuarter" or w.pool_bracket_type == "eightPoolsToQuarter" %>
<%= render 'fourPoolQuarterBracket' %>
<% end %>
<% if w.pool_bracket_type == "fourPoolsToSemi" %>
<%= render 'fourPoolSemiBracket' %>
<% end %>
</td>
</tr>
</table>
<% end %>
</div>
<% end %>