<% @tournament.weights.sort_by{|w| w.max}.each do |w| %>
diff --git a/app/views/tournaments/bracket.html.erb b/app/views/tournaments/bracket.html.erb
index d5404c8..1ee6a27 100644
--- a/app/views/tournaments/bracket.html.erb
+++ b/app/views/tournaments/bracket.html.erb
@@ -1,4 +1,56 @@
+
<% cache ["#{@weight.id}_bracket", @weight] do %>
@@ -7,26 +59,33 @@
<%= link_to "Back to #{@tournament.name}", "/tournaments/#{@tournament.id}", :class=>"btn btn-default" %>
-
- <%= 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 %>
-
- <% if @weight.wrestlers.size <= 6 && @weight.allPoolMatchesFinished(1) %>
- <%= render 'onePoolResults' %>
- <% end %>
+
+ <%= @tournament.name %> - <%= @weight.max %> lbs Bracket
+
+ |
+ <% @matches = @tournament.matches.select{|m| m.weight_id == @weight.id} %>
+ <% @wrestlers = Wrestler.where(weight_id: @weight.id) %>
+ <% @pools = @weight.poolRounds(@matches) %>
+ <%= render 'pool' %>
+ |
+
+
+
+ <% if @weight.pool_bracket_type == "twoPoolsToFinal" %>
+ <%= render 'twoPoolFinalBracket' %>
+ <% end %>
+ <% if @weight.pool_bracket_type == "twoPoolsToSemi" %>
+ <%= render 'twoPoolSemiBracket' %>
+ <% end %>
+ <% if @weight.pool_bracket_type == "fourPoolsToQuarter" %>
+ <%= render 'fourPoolQuarterBracket' %>
+ <% end %>
+ <% if @weight.pool_bracket_type == "fourPoolsToSemi" %>
+ <%= render 'fourPoolSemiBracket' %>
+ <% end %>
+ |
+
+