<% cache ["#{@tournament.id}_all_brackets", @tournament] do %>
<%= render :file => 'tournaments/team_scores' %> <% @tournament.weights.sort_by{|w| w.max}.each do |weight| %> <% if @tournament.tournament_type == "Pool to bracket" %> <% elsif @tournament.tournament_type == "Modified 16 Man Double Elimination" or @tournament.tournament_type == "Double Elimination 1-6" %> <% end %>
<% @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' %> <% @matches = weight.matches %> <% @weight = weight %> <%= render 'bracket_partial' %>
<% end %>
<% end %>