1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-04-13 00:26:31 +00:00

Condensed the bracket pages

This commit is contained in:
2017-02-01 19:37:58 +00:00
parent 9ac3b3baa9
commit 8fa529dc5f
7 changed files with 226 additions and 382 deletions

View File

@@ -1,4 +1,56 @@
<style>
/*
* Bracket Layout Specifics
*/
main {
display:flex;
}
.round {
display:flex;
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>
<% cache ["#{@weight.id}_bracket", @weight] do %>
</br>
</br>
@@ -7,26 +59,33 @@
<%= link_to "Back to #{@tournament.name}", "/tournaments/#{@tournament.id}", :class=>"btn btn-default" %>
<br>
<br>
<h1><%= @weight.max %> lbs Bracket</h1>
<%= render 'pool' %>
<% if @bracketType == "twoPoolsToFinal" %>
<%= render 'twoPoolFinalBracket' %>
<% end %>
<% if @bracketType == "twoPoolsToSemi" %>
<%= render 'twoPoolSemiBracket' %>
<% end %>
<% if @bracketType == "fourPoolsToQuarter" %>
<%= render 'fourPoolQuarterBracket' %>
<% end %>
<% if @bracketType == "fourPoolsToSemi" %>
<%= render 'fourPoolSemiBracket' %>
<% end %>
<br><br>
<% if @weight.wrestlers.size <= 6 && @weight.allPoolMatchesFinished(1) %>
<%= render 'onePoolResults' %>
<% end %>
<table class='pagebreak'>
<h5><strong><%= @tournament.name %> - <%= @weight.max %> lbs Bracket</strong></h5>
<tr>
<td valign="top" style="padding: 10px;">
<% @matches = @tournament.matches.select{|m| m.weight_id == @weight.id} %>
<% @wrestlers = Wrestler.where(weight_id: @weight.id) %>
<% @pools = @weight.poolRounds(@matches) %>
<%= render 'pool' %>
</td>
<td valign="top" style="padding: 10px;">
<% if @weight.pool_bracket_type == "twoPoolsToFinal" %>
<%= render 'twoPoolFinalBracket' %>
<% end %>
<% if @weight.pool_bracket_type == "twoPoolsToSemi" %>
<%= render 'twoPoolSemiBracket' %>
<% end %>
<% if @weight.pool_bracket_type == "fourPoolsToQuarter" %>
<%= render 'fourPoolQuarterBracket' %>
<% end %>
<% if @weight.pool_bracket_type == "fourPoolsToSemi" %>
<%= render 'fourPoolSemiBracket' %>
<% end %>
</td>
</tr>
</table>
<% end %>
<% if can? :manage, @tournament %>