1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-04-20 22:18:18 +00:00

Made two pool for 7-10 people

This commit is contained in:
2015-02-06 13:26:58 -05:00
parent 7032760360
commit 8caaf588fd
7 changed files with 22 additions and 8 deletions

View File

@@ -52,6 +52,7 @@ class StaticPagesController < ApplicationController
end end
if @tournament if @tournament
@weights = Weight.where(tournament_id: @tournament.id) @weights = Weight.where(tournament_id: @tournament.id)
@weights = @weights.sort_by{|x|[x.max]}
end end
end end

View File

@@ -22,9 +22,9 @@ class Weight < ActiveRecord::Base
@wrestlers = Wrestler.where(weight_id: self.id) @wrestlers = Wrestler.where(weight_id: self.id)
if @wrestlers.size <= 6 if @wrestlers.size <= 6
self.pools = 1 self.pools = 1
elsif (@wrestlers.size > 6) && (@wrestlers.size <= 8) elsif (@wrestlers.size > 6) && (@wrestlers.size <= 10)
self.pools = 2 self.pools = 2
elsif (@wrestlers.size > 8) && (@wrestlers.size <= 16) elsif (@wrestlers.size > 10) && (@wrestlers.size <= 16)
self.pools = 4 self.pools = 4
end end
end end

View File

@@ -49,7 +49,9 @@
<tr> <tr>
<td><%= wrestler.name %></td> <td><%= wrestler.name %></td>
<td><%= Weight.find(wrestler.weight_id).max %></td> <td><%= Weight.find(wrestler.weight_id).max %></td>
<td><%= wrestler.original_seed %></td> <td>
<%= wrestler.original_seed %>
</td>
<td><%= wrestler.season_win %>-<%= wrestler.season_loss %></td> <td><%= wrestler.season_win %>-<%= wrestler.season_loss %></td>
<td><%= wrestler.criteria %> Win <%= wrestler.seasonWinPercentage %>%</td> <td><%= wrestler.criteria %> Win <%= wrestler.seasonWinPercentage %>%</td>
<td><% if wrestler.extra? == true %> <td><% if wrestler.extra? == true %>

View File

@@ -12,7 +12,7 @@
<% @poolOneWrestlers.each do |w| %> <% @poolOneWrestlers.each do |w| %>
<tr> <tr>
<td><%= w.name %> <%= w.season_win %>-<%= w.season_loss %> <%= w.school.name %></td> <td><%= w.name %> <%= w.season_win %>-<%= w.season_loss %> <%= w.school.name %></td>
<td><%= w.boutByRound(1) %><br>Result</td> <td><%= w.boutByRound(1) %><br></td>
<td><%= w.boutByRound(2) %></td> <td><%= w.boutByRound(2) %></td>
<td><%= w.boutByRound(3) %></td> <td><%= w.boutByRound(3) %></td>
</tr> </tr>
@@ -35,7 +35,7 @@
<% @poolTwoWrestlers.each do |w| %> <% @poolTwoWrestlers.each do |w| %>
<tr> <tr>
<td><%= w.name %> <%= w.season_win %>-<%= w.season_loss %> <%= w.school.name %></td> <td><%= w.name %> <%= w.season_win %>-<%= w.season_loss %> <%= w.school.name %></td>
<td><%= w.boutByRound(1) %><br>Result</td> <td><%= w.boutByRound(1) %><br></td>
<td><%= w.boutByRound(2) %></td> <td><%= w.boutByRound(2) %></td>
<td><%= w.boutByRound(3) %></td> <td><%= w.boutByRound(3) %></td>
</tr> </tr>

View File

@@ -6,15 +6,17 @@
<th>R1</th> <th>R1</th>
<th>R2</th> <th>R2</th>
<th>R3</th> <th>R3</th>
<th>R4</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<% @poolOneWrestlers.each do |w| %> <% @poolOneWrestlers.each do |w| %>
<tr> <tr>
<td><%= w.name %> <%= w.season_win %>-<%= w.season_loss %> <%= w.school.name %></td> <td><%= w.name %> <%= w.season_win %>-<%= w.season_loss %> <%= w.school.name %></td>
<td><%= w.boutByRound(1) %><br>Result</td> <td><%= w.boutByRound(1) %><br></td>
<td><%= w.boutByRound(2) %></td> <td><%= w.boutByRound(2) %></td>
<td><%= w.boutByRound(3) %></td> <td><%= w.boutByRound(3) %></td>
<td><%= w.boutByRound(4) %></td>
</tr> </tr>
<% end %> <% end %>
</tbody> </tbody>
@@ -34,7 +36,7 @@
<% @poolTwoWrestlers.each do |w| %> <% @poolTwoWrestlers.each do |w| %>
<tr> <tr>
<td><%= w.name %> <%= w.season_win %>-<%= w.season_loss %> <%= w.school.name %></td> <td><%= w.name %> <%= w.season_win %>-<%= w.season_loss %> <%= w.school.name %></td>
<td><%= w.boutByRound(1) %><br>Result</td> <td><%= w.boutByRound(1) %><br></td>
<td><%= w.boutByRound(2) %></td> <td><%= w.boutByRound(2) %></td>
<td><%= w.boutByRound(3) %></td> <td><%= w.boutByRound(3) %></td>
</tr> </tr>

View File

@@ -28,7 +28,13 @@
<tr> <tr>
<td><%= wrestler.name %></td> <td><%= wrestler.name %></td>
<td><%= School.find(wrestler.school_id).name %></td> <td><%= School.find(wrestler.school_id).name %></td>
<td><%= wrestler.original_seed %></td> <td>
<% if user_signed_in? %>
<%= wrestler.original_seed %>
<% else %>
<%= wrestler.original_seed %>
<% end %>
</td>
<td><%= wrestler.season_win %>-<%= wrestler.season_loss %></td> <td><%= wrestler.season_win %>-<%= wrestler.season_loss %></td>
<td><%= wrestler.criteria %> Win <%= wrestler.seasonWinPercentage %>%</td> <td><%= wrestler.criteria %> Win <%= wrestler.seasonWinPercentage %>%</td>
<td><% if wrestler.extra? == true %> <td><% if wrestler.extra? == true %>
@@ -49,3 +55,5 @@

View File

@@ -30,6 +30,7 @@ Wrestling::Application.routes.draw do
get 'static_pages/results' get 'static_pages/results'
get 'static_pages/team_scores' get 'static_pages/team_scores'
# Example of regular route: # Example of regular route:
# get 'products/:id' => 'catalog#view' # get 'products/:id' => 'catalog#view'