<% cache ["#{@tournament.id}_all_brackets", @tournament] do %>
<%= render :file => 'tournaments/team_scores' %> <% @tournament.weights.sort_by{|w| w.max}.each do |w| %>
<%= @tournament.name %> - <%= w.max %> lbs Bracket
<% @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' %> <% 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 %>
<% end %>
<% end %>