diff --git a/app/models/pool_bracket_placement_points.rb b/app/models/pool_bracket_placement_points.rb index 26ea080..07d94a6 100644 --- a/app/models/pool_bracket_placement_points.rb +++ b/app/models/pool_bracket_placement_points.rb @@ -16,6 +16,9 @@ class PoolBracketPlacementPoints if @bracket == "fourPoolsToSemi" whilePointsAreZero { @points = fourPoolsToSemi } end + if wrestler.weight.size <= 6 && wrestler.weight.allPoolMatchesFinished(1) + whilePointsAreZero { @points = onePool } + end return @points end @@ -63,6 +66,19 @@ class PoolBracketPlacementPoints return 0 end + def onePool + poolOrder = wrestler.weight.poolOrder(1) + if wrestler == poolOrder.first + firstPlace + elsif wrestler == poolOrder.second + secondPlace + elsif wrestler == poolOrder.third + thirdPlace + elsif wrestler == poolOrder.fourth + fourthPlace + end + end + def finalMatchPoints if won_bracket_position_size("1/2") > 0 return firstPlace diff --git a/app/views/tournaments/_onePoolResults.html.erb b/app/views/tournaments/_onePoolResults.html.erb new file mode 100644 index 0000000..6fc7296 --- /dev/null +++ b/app/views/tournaments/_onePoolResults.html.erb @@ -0,0 +1,8 @@ +
Results
+
+
    +
  1. <%= @weight.poolOrder(1).first.name %>
  2. +
  3. <%= @weight.poolOrder(1).second.name %>
  4. +
  5. <%= @weight.poolOrder(1).third.name %>
  6. +
  7. <%= @weight.poolOrder(1).fourth.name %>
  8. +
\ No newline at end of file diff --git a/app/views/tournaments/bracket.html.erb b/app/views/tournaments/bracket.html.erb index 9751208..341a2fe 100644 --- a/app/views/tournaments/bracket.html.erb +++ b/app/views/tournaments/bracket.html.erb @@ -23,4 +23,8 @@ <% if @bracketType == "fourPoolsToSemi" %> <%= render 'fourPoolSemiBracket' %> <% end %> +

+ <% if @weight.size <= 6 && @weight.allPoolMatchesFinished(1) %> + <%= render 'onePoolResults' %> + <% end %> <% end %> \ No newline at end of file