<% cache ["#{@tournament.id}_all_brackets", @tournament] do %>
<%= render :template => 'tournaments/team_scores' %>
<% @weights.sort_by{|w| w.max}.each do |weight| %> <% if @tournament.tournament_type == "Pool to bracket" %> <% @matches = @matches_by_weight_id[weight.id] || [] %> <% @wrestlers = @wrestlers_by_weight_id[weight.id] || [] %> <% @pools = weight.pool_rounds(@matches) %> <% @weight = weight %> <%= render 'bracket_partial' %> <% elsif @tournament.tournament_type.include? "Modified 16 Man Double Elimination" or @tournament.tournament_type.include? "Regular Double Elimination" %> <% @matches = @matches_by_weight_id[weight.id] || [] %> <% @wrestlers = @wrestlers_by_weight_id[weight.id] || [] %> <% @weight = weight %> <%= render 'bracket_partial' %> <% end %> <% end %> <% end %>