mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-03-25 01:14:43 +00:00
Made two pool for 7-10 people
This commit is contained in:
@@ -52,6 +52,7 @@ class StaticPagesController < ApplicationController
|
||||
end
|
||||
if @tournament
|
||||
@weights = Weight.where(tournament_id: @tournament.id)
|
||||
@weights = @weights.sort_by{|x|[x.max]}
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -22,9 +22,9 @@ class Weight < ActiveRecord::Base
|
||||
@wrestlers = Wrestler.where(weight_id: self.id)
|
||||
if @wrestlers.size <= 6
|
||||
self.pools = 1
|
||||
elsif (@wrestlers.size > 6) && (@wrestlers.size <= 8)
|
||||
elsif (@wrestlers.size > 6) && (@wrestlers.size <= 10)
|
||||
self.pools = 2
|
||||
elsif (@wrestlers.size > 8) && (@wrestlers.size <= 16)
|
||||
elsif (@wrestlers.size > 10) && (@wrestlers.size <= 16)
|
||||
self.pools = 4
|
||||
end
|
||||
end
|
||||
|
||||
@@ -49,7 +49,9 @@
|
||||
<tr>
|
||||
<td><%= wrestler.name %></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.criteria %> Win <%= wrestler.seasonWinPercentage %>%</td>
|
||||
<td><% if wrestler.extra? == true %>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<% @poolOneWrestlers.each do |w| %>
|
||||
<tr>
|
||||
<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(3) %></td>
|
||||
</tr>
|
||||
@@ -35,7 +35,7 @@
|
||||
<% @poolTwoWrestlers.each do |w| %>
|
||||
<tr>
|
||||
<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(3) %></td>
|
||||
</tr>
|
||||
|
||||
@@ -6,15 +6,17 @@
|
||||
<th>R1</th>
|
||||
<th>R2</th>
|
||||
<th>R3</th>
|
||||
<th>R4</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @poolOneWrestlers.each do |w| %>
|
||||
<tr>
|
||||
<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(3) %></td>
|
||||
<td><%= w.boutByRound(4) %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
@@ -34,7 +36,7 @@
|
||||
<% @poolTwoWrestlers.each do |w| %>
|
||||
<tr>
|
||||
<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(3) %></td>
|
||||
</tr>
|
||||
|
||||
@@ -28,7 +28,13 @@
|
||||
<tr>
|
||||
<td><%= wrestler.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.criteria %> Win <%= wrestler.seasonWinPercentage %>%</td>
|
||||
<td><% if wrestler.extra? == true %>
|
||||
@@ -49,3 +55,5 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ Wrestling::Application.routes.draw do
|
||||
get 'static_pages/results'
|
||||
get 'static_pages/team_scores'
|
||||
|
||||
|
||||
# Example of regular route:
|
||||
# get 'products/:id' => 'catalog#view'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user