diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index d83690e..952ba68 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -2,4 +2,5 @@ class ApplicationController < ActionController::Base # Prevent CSRF attacks by raising an exception. # For APIs, you may want to use :null_session instead. protect_from_forgery with: :exception + end diff --git a/app/controllers/static_pages_controller.rb b/app/controllers/static_pages_controller.rb index 468c632..70315dc 100644 --- a/app/controllers/static_pages_controller.rb +++ b/app/controllers/static_pages_controller.rb @@ -316,6 +316,8 @@ class StaticPagesController < ApplicationController end end + + diff --git a/app/models/match.rb b/app/models/match.rb index f5f8ffb..ff698b5 100644 --- a/app/models/match.rb +++ b/app/models/match.rb @@ -1,4 +1,10 @@ class Match < ActiveRecord::Base belongs_to :tournament WIN_TYPES = ["Decision", "Major", "Tech Fall", "Pin", "Forfeit", "Injury Default", "Default"] + + def bout + @round_number = self.round * 1000 + + self.bout_number = @round_number + self.id + end end diff --git a/app/models/tournament.rb b/app/models/tournament.rb index 93f4ed5..43e7045 100644 --- a/app/models/tournament.rb +++ b/app/models/tournament.rb @@ -2,5 +2,5 @@ class Tournament < ActiveRecord::Base has_many :schools, dependent: :destroy has_many :weights, dependent: :destroy has_many :matches, dependent: :destroy - has_many :mats, dependent: :destroy + has_many :mats, dependent: :destroy end diff --git a/app/views/static_pages/_man11.html.erb b/app/views/static_pages/_man11.html.erb new file mode 100644 index 0000000..8ec8beb --- /dev/null +++ b/app/views/static_pages/_man11.html.erb @@ -0,0 +1,155 @@ + +

Pool 1

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameR1R2R3
1. <%= @seed1.name %> <%= @seed1.season_win %>-<%= @seed1.season_loss %> <%= School.find(@seed1.school_id).name %>BYEV3V4
2. BYEV1V4V3
3. <%= @seed11.name %> <%= @seed11.season_win %>-<%= @seed11.season_loss %> <%= School.find(@seed11.school_id).name %>V4V1BYE
4. <%= @seed8.name %> <%= @seed8.season_win %>-<%= @seed8.season_loss %> <%= School.find(@seed8.school_id).name %>V3BYEV1
+
+
+

Pool 2

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameR1R2R3
5. <%= @seed2.name %> <%= @seed2.season_win %>-<%= @seed2.season_loss %> <%= School.find(@seed2.school_id).name %>BYEBYEV8
6. BYEV6V8V7
7. BYEV8V5BYE
8. <%= @seed7.name %> <%= @seed7.season_win %>-<%= @seed7.season_loss %> <%= School.find(@seed7.school_id).name %>BYEBYEV5
+

Pool 3

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameR1R2R3
9. <%= @seed3.name %> <%= @seed3.season_win %>-<%= @seed3.season_loss %> <%= School.find(@seed3.school_id).name %>BYEV11V12
10. BYEV9V12V11
11. <%= @seed10.name %> <%= @seed10.season_win %>-<%= @seed10.season_loss %> <%= School.find(@seed10.school_id).name %>V12V9BYE
12. <%= @seed6.name %> <%= @seed6.season_win %>-<%= @seed6.season_loss %> <%= School.find(@seed6.school_id).name %>V11BYEV9
+
+
+

Pool 4

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameR1R2R3
13. <%= @seed4.name %> <%= @seed4.season_win %>-<%= @seed4.season_loss %> <%= School.find(@seed4.school_id).name %>BYEV15V16
14. BYEV13V16V15
15. <%= @seed9.name %> <%= @seed9.season_win %>-<%= @seed9.season_loss %> <%= School.find(@seed9.school_id).name %>V16V13BYE
16. <%= @seed5.name %> <%= @seed5.season_win %>-<%= @seed5.season_loss %> <%= School.find(@seed5.school_id).name %>V15BYEV13
+
+
\ No newline at end of file diff --git a/app/views/static_pages/brackets.html.erb b/app/views/static_pages/brackets.html.erb index a5498c2..618e169 100644 --- a/app/views/static_pages/brackets.html.erb +++ b/app/views/static_pages/brackets.html.erb @@ -30,4 +30,6 @@ <%= render 'man13' %> <% elsif @bracket_size == 12 %> <%= render 'man12' %> +<% elsif @bracket_size == 11 %> + <%= render 'man11' %> <% end %> \ No newline at end of file