diff --git a/app/views/tournaments/_bracket_partial.html.erb b/app/views/tournaments/_bracket_partial.html.erb index d55d783..a276604 100644 --- a/app/views/tournaments/_bracket_partial.html.erb +++ b/app/views/tournaments/_bracket_partial.html.erb @@ -77,43 +77,47 @@ table.smallText tr td { font-size: 10px; } min-height: 12px; } - -
<%= @tournament.name %> - <%= @weight.max %> Bracket
+<% if @tournament.tournament_type == "Pool to bracket" %> +
+
+

<%= @tournament.name %> - <%= @weight.max %> Bracket

+
- <% if @tournament.tournament_type == "Pool to bracket" %> - - - - - <% elsif @tournament.tournament_type.include? "Modified 16 Man Double Elimination" %> - <% elsif @tournament.tournament_type.include? "Regular Double Elimination" %> + <% @matches = @tournament.matches.select{|m| m.weight_id == @weight.id} %> + <% @wrestlers = Wrestler.where(weight_id: @weight.id) %> + <% @pools = @weight.pool_rounds(@matches) %> + <%= render 'pool' %> + - <% end %> -
- <% @matches = @tournament.matches.select{|m| m.weight_id == @weight.id} %> - <% @wrestlers = Wrestler.where(weight_id: @weight.id) %> - <% @pools = @weight.pool_rounds(@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 == "eightPoolsToQuarter" %> - <%= render 'fourPoolQuarterBracket' %> - <% end %> - <% if @weight.pool_bracket_type == "fourPoolsToSemi" %> - <%= render 'fourPoolSemiBracket' %> - <% end %> - - <%= render 'modified_sixteen_man_double_elimination_bracket' %> - - <%= render 'double_elimination_bracket' %> + <% 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 == "eightPoolsToQuarter" %> + <%= render 'fourPoolQuarterBracket' %> + <% end %> + <% if @weight.pool_bracket_type == "fourPoolsToSemi" %> + <%= render 'fourPoolSemiBracket' %> + <% end %>
\ No newline at end of file + + + +<% elsif @tournament.tournament_type.include? "Modified 16 Man Double Elimination" %> +
+
+

<%= @tournament.name %> - <%= @weight.max %> Bracket

+ <%= render 'modified_sixteen_man_double_elimination_bracket' %> +
+
+<% elsif @tournament.tournament_type.include? "Regular Double Elimination" %> + <%= render 'double_elimination_bracket' %> +<% end %> + \ No newline at end of file diff --git a/app/views/tournaments/_double_elimination_bracket.html.erb b/app/views/tournaments/_double_elimination_bracket.html.erb index 0f7fc12..504aaa6 100644 --- a/app/views/tournaments/_double_elimination_bracket.html.erb +++ b/app/views/tournaments/_double_elimination_bracket.html.erb @@ -1,46 +1,56 @@ -

Championship Bracket

-
- <% if @weight.highest_bracket_round %> - <% (1..@weight.highest_bracket_round).each do |round| %> - <% @round_matches = @matches.select{|m|m.bracket_position == "Bracket" and m.round == round} %> +
+
+

<%= @tournament.name %> - <%= @weight.max %> Bracket

+

Championship Bracket

+
+ <% if @weight.highest_bracket_round %> + <% (1..@weight.highest_bracket_round).each do |round| %> + <% @round_matches = @matches.select{|m|m.bracket_position == "Bracket" and m.round == round} %> + <%= render 'bracket_round' %> + <% end %> + <% end %> + <% @round_matches = @matches.select{|m|m.bracket_position == "Quarter"} %> <%= render 'bracket_round' %> - <% end %> - <% end %> - <% @round_matches = @matches.select{|m|m.bracket_position == "Quarter"} %> - <%= render 'bracket_round' %> - <% @round_matches = @matches.select{|m|m.bracket_position == "Semis"} %> - <%= render 'bracket_round' %> - <% @final_match = @matches.select{|m|m.bracket_position == "1/2"} %> - <% @winner_place = "1st" %> - <%= render 'bracket_final' %> -
-

Consolation Bracket

-
- <% if @weight.highest_conso_round %> - <% (1..@weight.highest_conso_round).each do |round| %> - <% @round_matches = @matches.select{|m|m.bracket_position == "Conso" and m.round == round} %> + <% @round_matches = @matches.select{|m|m.bracket_position == "Semis"} %> <%= render 'bracket_round' %> - <% end %> - <% end %> - <% @round_matches = @matches.select{|m|m.bracket_position == "Conso Quarter"} %> - <%= render 'bracket_round' %> - <% @round_matches = @matches.select{|m|m.bracket_position == "Conso Semis"} %> - <%= render 'bracket_round' %> - <% @final_match = @matches.select{|m|m.bracket_position == "3/4"} %> - <% @winner_place = "3rd" %> - <%= render 'bracket_final' %> -
-

5/6 place match

-
- <% @final_match = @matches.select{|m|m.bracket_position == "5/6"} %> - <% @winner_place = "5th" %> - <%= render 'bracket_final' %> -
-<% if @tournament.number_of_placers >= 8 %> -

7/8 place match

-
- <% @final_match = @matches.select{|m|m.bracket_position == "7/8"} %> - <% @winner_place = "7th" %> - <%= render 'bracket_final' %> + <% @final_match = @matches.select{|m|m.bracket_position == "1/2"} %> + <% @winner_place = "1st" %> + <%= render 'bracket_final' %> +
-<% end %> \ No newline at end of file +
+
+
+

<%= @tournament.name %> - <%= @weight.max %> Bracket

+

Consolation Bracket

+
+ <% if @weight.highest_conso_round %> + <% (1..@weight.highest_conso_round).each do |round| %> + <% @round_matches = @matches.select{|m|m.bracket_position == "Conso" and m.round == round} %> + <%= render 'bracket_round' %> + <% end %> + <% end %> + <% @round_matches = @matches.select{|m|m.bracket_position == "Conso Quarter"} %> + <%= render 'bracket_round' %> + <% @round_matches = @matches.select{|m|m.bracket_position == "Conso Semis"} %> + <%= render 'bracket_round' %> + <% @final_match = @matches.select{|m|m.bracket_position == "3/4"} %> + <% @winner_place = "3rd" %> + <%= render 'bracket_final' %> +
+

5/6 place match

+
+ <% @final_match = @matches.select{|m|m.bracket_position == "5/6"} %> + <% @winner_place = "5th" %> + <%= render 'bracket_final' %> +
+ <% if @tournament.number_of_placers >= 8 %> +

7/8 place match

+
+ <% @final_match = @matches.select{|m|m.bracket_position == "7/8"} %> + <% @winner_place = "7th" %> + <%= render 'bracket_final' %> +
+ <% end %> +
+
\ No newline at end of file diff --git a/app/views/tournaments/_pool.html.erb b/app/views/tournaments/_pool.html.erb index 3b2029b..7ffa162 100644 --- a/app/views/tournaments/_pool.html.erb +++ b/app/views/tournaments/_pool.html.erb @@ -1,6 +1,11 @@ <% @round = 1 %> <% @pool = 1 %> <% until @wrestlers.select{|w| w.pool == @pool}.blank? %> + + <% if @pool == 5 %> + + + <% end %>
Pool <%= @pool %>
diff --git a/app/views/tournaments/all_brackets.html.erb b/app/views/tournaments/all_brackets.html.erb index 4576b17..03dd923 100644 --- a/app/views/tournaments/all_brackets.html.erb +++ b/app/views/tournaments/all_brackets.html.erb @@ -1,43 +1,76 @@ + + <% cache ["#{@tournament.id}_all_brackets", @tournament] do %> -
- <%= render :template => 'tournaments/team_scores' %> +
+
+ <%= render :template => 'tournaments/team_scores' %> +
+
<% @weights.sort_by{|w| w.max}.each do |weight| %> -
- <% if @tournament.tournament_type == "Pool to bracket" %> - <% elsif @tournament.tournament_type.include? "Modified 16 Man Double Elimination" or @tournament.tournament_type.include? "Regular Double Elimination" %> - <% 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 %> \ No newline at end of file