1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-04-06 22:44:14 +00:00

Created one page for all pools

This commit is contained in:
2015-03-27 16:33:09 +00:00
parent 86faf8b2a4
commit a821c28cf7
4 changed files with 60 additions and 11 deletions

View File

@@ -0,0 +1,35 @@
<% @round = 1 %>
<% @pool = 1 %>
<% until @wrestlers.select{|w| w.generatePoolNumber == @pool}.blank? %>
<h5>Pool <%= @pool %></h5>
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>Name</th>
<% until @matches.select{|m| m.round == @round}.blank? %>
<% if @round <= @weight.poolRounds(@matches) %>
<th>R<%= @round %></th>
<% end %>
<% @round = @round + 1 %>
<% end %>
</tr>
</thead>
<tbody>
<% @wrestlers.select{|w| w.generatePoolNumber == @pool}.each do |w| %>
<tr>
<td><%= w.original_seed %> <%= w.name %> <%= w.season_win %>-<%= w.season_loss %> <%= w.school.name %></td>
<% @round = 1 %>
<% until @matches.select{|m| m.round == @round}.blank? %>
<% if @round <= @weight.poolRounds(@matches) %>
<td><%= w.boutByRound(@round,@matches) %><br>Result</td>
<% end %>
<% @round = @round + 1 %>
<% end %>
</tr>
<% end %>
</tbody>
</table>
<% @pool = @pool + 1 %>
<% @round = 1 %>
<% end %>

View File

@@ -6,10 +6,18 @@
<br>
<br>
<h1><%= @weight.max %> lbs Bracket</h1>
<% if @weight.pools == 4 %>
<%= render 'fourPool' %>
<% elsif @weight.pools == 2 %>
<%= render 'twoPool' %>
<% elsif @weight.pools == 1 %>
<%= render 'onePool' %>
<%= 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 %>