mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-04-21 14:22:24 +00:00
Added 16 man modified double elimination bracket type. Still need to fix swap wrestlers code.
This commit is contained in:
@@ -1,104 +1,26 @@
|
||||
<% cache ["#{@tournament.id}_all_brackets", @tournament] do %>
|
||||
|
||||
<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;
|
||||
}
|
||||
/*
|
||||
* Bracket Layout Specifics
|
||||
*/
|
||||
main, ul {
|
||||
display:flex;
|
||||
}
|
||||
|
||||
ul {
|
||||
flex-direction:column;
|
||||
width: 125px;
|
||||
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:60px;
|
||||
}
|
||||
|
||||
.bracket-winner {
|
||||
border-bottom:1px solid #aaa;
|
||||
}
|
||||
|
||||
.bout-number {
|
||||
text-align: center;
|
||||
padding-top: 15px;
|
||||
}
|
||||
|
||||
.game-bottom {
|
||||
border-top:1px solid #aaa;
|
||||
}
|
||||
</style>
|
||||
|
||||
<% cache ["#{@tournament.id}_all_brackets", @tournament] do %>
|
||||
<div id="exportable">
|
||||
<%= render :file => 'tournaments/team_scores' %>
|
||||
<% @tournament.weights.sort_by{|w| w.max}.each do |w| %>
|
||||
<% @tournament.weights.sort_by{|w| w.max}.each do |weight| %>
|
||||
<table class='pagebreak'>
|
||||
<h5><strong><%= @tournament.name %> - <%= w.max %> lbs Bracket</strong></h5>
|
||||
<tr>
|
||||
<td valign="top" style="padding: 0px;">
|
||||
<% @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>
|
||||
|
||||
|
||||
<% if @tournament.tournament_type == "Pool to bracket" %>
|
||||
<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 %>
|
||||
<!-- 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" %>
|
||||
<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 %>
|
||||
|
||||
Reference in New Issue
Block a user