<% cache ["#{@tournament.id}_all_brackets", @tournament] do %>    
    <div id="exportable">
    <%= render :file => 'tournaments/team_scores' %>
    <% @tournament.weights.sort_by{|w| w.max}.each do |weight| %>
        <table class='pagebreak'>
        <tr>
          <% if @tournament.tournament_type == "Pool to bracket" %>
            <td valign="top" style="padding: 10px;">
                <!-- Need to define what the tournaments#bracket controller defines -->
                <% @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' %>
            </td>
          <% elsif @tournament.tournament_type == "Modified 16 Man Double Elimination" or @tournament.tournament_type == "Double Elimination 1-6" %>
          <td valign="top" style="padding: 10px;">
            <!-- Need to define what the tournaments#bracket controller defines -->
            <% @matches = weight.matches %>
            <% @weight = weight %>
            <%= render 'bracket_partial' %>
          </td>
          <% end %>
        </tr>
        </table>
    <% end %>
    </div>
<% end %>
<style>
    .pagebreak { 
      page-break-after: always;
      border: none;
        margin: 0px;
        padding: 0px;
        width: 8in; /* width: 7in; */
        height: 9.5in; /* or height: 9.5in; */
        font-size: 8px;
        position: relative;
        left: 0in;
        height: 1in;
    }
</style>

<% cache ["#{@tournament.id}_all_brackets", @tournament] do %> 
  <div id="exportable" >   
    <%= render :file => 'tournaments/team_scores' %>
    <% @tournament.weights.sort_by{|w| w.max}.each do |weight| %>
        <table class='pagebreak'>
        <tr>
          <% if @tournament.tournament_type == "Pool to bracket" %>
            <td valign="top" style="padding: 10px;">
                <!-- Need to define what the tournaments#bracket controller defines -->
                <% @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' %>
            </td>
          <% elsif @tournament.tournament_type == "Modified 16 Man Double Elimination" or @tournament.tournament_type == "Double Elimination 1-6" %>
          <td valign="top" style="padding: 10px;">
            <!-- Need to define what the tournaments#bracket controller defines -->
            <% @matches = weight.matches %>
            <% @weight = weight %>
            <%= render 'bracket_partial' %>
          </td>
          <% end %>
        </tr>
        </table>
    <% end %>
  </div>
<% end %>
Fix page break for all brackets
Fix page break for all brackets
