1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-03-25 01:14:43 +00:00

Added 11 man bracket

This commit is contained in:
Jacob Cody Wimer
2014-01-31 18:33:58 -05:00
parent 931849f5d5
commit 1d024e0571
6 changed files with 167 additions and 1 deletions

View File

@@ -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

View File

@@ -316,6 +316,8 @@ class StaticPagesController < ApplicationController
end
end

View File

@@ -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

View File

@@ -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

View File

@@ -0,0 +1,155 @@
<h3>Pool 1</h3>
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>Name</th>
<th>R1</th>
<th>R2</th>
<th>R3</th>
</tr>
</thead>
<tbody>
<tr>
<td>1. <%= @seed1.name %> <%= @seed1.season_win %>-<%= @seed1.season_loss %> <%= School.find(@seed1.school_id).name %></td>
<td>BYE</td>
<td>V3</td>
<td>V4</td>
</tr>
<tr>
<td>2. BYE</td>
<td>V1</td>
<td>V4</td>
<td>V3</td>
</tr>
<tr>
<td>3. <%= @seed11.name %> <%= @seed11.season_win %>-<%= @seed11.season_loss %> <%= School.find(@seed11.school_id).name %></td>
<td>V4</td>
<td>V1</td>
<td>BYE</td>
</tr>
<tr>
<td>4. <%= @seed8.name %> <%= @seed8.season_win %>-<%= @seed8.season_loss %> <%= School.find(@seed8.school_id).name %></td>
<td>V3</td>
<td>BYE</td>
<td>V1</td>
</tr>
</tbody>
</table>
<br>
<br>
<h3>Pool 2</h3>
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>Name</th>
<th>R1</th>
<th>R2</th>
<th>R3</th>
</tr>
</thead>
<tbody>
<tr>
<td>5. <%= @seed2.name %> <%= @seed2.season_win %>-<%= @seed2.season_loss %> <%= School.find(@seed2.school_id).name %></td>
<td>BYE</td>
<td>BYE</td>
<td>V8</td>
</tr>
<tr>
<td>6. BYE</td>
<td>V6</td>
<td>V8</td>
<td>V7</td>
</tr>
<tr>
<td>7. BYE</td>
<td>V8</td>
<td>V5</td>
<td>BYE</td>
</tr>
<tr>
<td>8. <%= @seed7.name %> <%= @seed7.season_win %>-<%= @seed7.season_loss %> <%= School.find(@seed7.school_id).name %></td>
<td>BYE</td>
<td>BYE</td>
<td>V5</td>
</tr>
</tbody>
</table>
<h3>Pool 3</h3>
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>Name</th>
<th>R1</th>
<th>R2</th>
<th>R3</th>
</tr>
</thead>
<tbody>
<tr>
<td>9. <%= @seed3.name %> <%= @seed3.season_win %>-<%= @seed3.season_loss %> <%= School.find(@seed3.school_id).name %></td>
<td>BYE</td>
<td>V11</td>
<td>V12</td>
</tr>
<tr>
<td>10. BYE</td>
<td>V9</td>
<td>V12</td>
<td>V11</td>
</tr>
<tr>
<td>11. <%= @seed10.name %> <%= @seed10.season_win %>-<%= @seed10.season_loss %> <%= School.find(@seed10.school_id).name %></td>
<td>V12</td>
<td>V9</td>
<td>BYE</td>
</tr>
<tr>
<td>12. <%= @seed6.name %> <%= @seed6.season_win %>-<%= @seed6.season_loss %> <%= School.find(@seed6.school_id).name %></td>
<td>V11</td>
<td>BYE</td>
<td>V9</td>
</tr>
</tbody>
</table>
<br>
<br>
<h3>Pool 4</h3>
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>Name</th>
<th>R1</th>
<th>R2</th>
<th>R3</th>
</tr>
</thead>
<tbody>
<tr>
<td>13. <%= @seed4.name %> <%= @seed4.season_win %>-<%= @seed4.season_loss %> <%= School.find(@seed4.school_id).name %></td>
<td>BYE</td>
<td>V15</td>
<td>V16</td>
</tr>
<tr>
<td>14. BYE</td>
<td>V13</td>
<td>V16</td>
<td>V15</td>
</tr>
<tr>
<td>15. <%= @seed9.name %> <%= @seed9.season_win %>-<%= @seed9.season_loss %> <%= School.find(@seed9.school_id).name %></td>
<td>V16</td>
<td>V13</td>
<td>BYE</td>
</tr>
<tr>
<td>16. <%= @seed5.name %> <%= @seed5.season_win %>-<%= @seed5.season_loss %> <%= School.find(@seed5.school_id).name %></td>
<td>V15</td>
<td>BYE</td>
<td>V13</td>
</tr>
</tbody>
</table>
<br>
<br>

View File

@@ -30,4 +30,6 @@
<%= render 'man13' %>
<% elsif @bracket_size == 12 %>
<%= render 'man12' %>
<% elsif @bracket_size == 11 %>
<%= render 'man11' %>
<% end %>