mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-03-25 01:14:43 +00:00
Put number next to school on team scores page and included team scores into all brackets
This commit is contained in:
@@ -13,7 +13,7 @@ class TournamentsController < ApplicationController
|
|||||||
@wrestler = Wrestler.find(params[:wrestler][:originalId])
|
@wrestler = Wrestler.find(params[:wrestler][:originalId])
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if SwapWrestlers.new.swap_wrestlers_bracket_lines(params[:wrestler][:originalId], params[:wrestler][:swapId])
|
if SwapWrestlers.new.swap_wrestlers_bracket_lines(params[:wrestler][:originalId], params[:wrestler][:swapId])
|
||||||
format.html { redirect_to "/tournaments/#{@wrestler.tournament.id}/brackets/#{@wrestler.weight.id}", notice: 'Wrestler was successfully swaped.' }
|
format.html { redirect_to "/tournaments/#{@wrestler.tournament.id}/brackets/#{@wrestler.weight.id}", notice: 'Wrestlers successfully swapped.' }
|
||||||
format.json { render action: 'show', status: :created, location: @wrestler }
|
format.json { render action: 'show', status: :created, location: @wrestler }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -149,7 +149,8 @@ class TournamentsController < ApplicationController
|
|||||||
|
|
||||||
|
|
||||||
def all_brackets
|
def all_brackets
|
||||||
|
@schools = @tournament.schools
|
||||||
|
@schools = @schools.sort_by{|s| s.page_score_string}.reverse!
|
||||||
end
|
end
|
||||||
|
|
||||||
def bracket
|
def bracket
|
||||||
|
|||||||
@@ -71,6 +71,7 @@ li:first-child,li:last-child {
|
|||||||
</style>
|
</style>
|
||||||
|
|
||||||
<div id="exportable">
|
<div id="exportable">
|
||||||
|
<%= render :file => 'tournaments/team_scores' %>
|
||||||
<% @tournament.weights.sort_by{|w| w.max}.each do |w| %>
|
<% @tournament.weights.sort_by{|w| w.max}.each do |w| %>
|
||||||
<table class='pagebreak'>
|
<table class='pagebreak'>
|
||||||
<h5><strong><%= @tournament.name %> - <%= w.max %> lbs Bracket</strong></h5>
|
<h5><strong><%= @tournament.name %> - <%= w.max %> lbs Bracket</strong></h5>
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
|
|
||||||
<% cache ["#{@tournament.id}_team_scores", @tournament] do %>
|
<% cache ["#{@tournament.id}_team_scores", @tournament] do %>
|
||||||
|
|
||||||
|
<table class="pagebreak table table-striped table-bordered">
|
||||||
<h3>Team Scores</h3>
|
<h3>Team Scores</h3>
|
||||||
<table class="table table-striped table-bordered">
|
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
@@ -12,7 +13,7 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
<% @schools.each do |school| %>
|
<% @schools.each do |school| %>
|
||||||
<tr>
|
<tr>
|
||||||
<td><%= school.name %> (<%= school.abbreviation %>)</td>
|
<td><%= @schools.index(school) + 1 %>. <%= school.name %> (<%= school.abbreviation %>)</td>
|
||||||
<td><%= school.page_score_string %></td>
|
<td><%= school.page_score_string %></td>
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
Reference in New Issue
Block a user