1
0
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:
2019-01-30 14:16:26 +00:00
parent dea5ee83f0
commit 972c5af093
3 changed files with 7 additions and 4 deletions

View File

@@ -13,7 +13,7 @@ class TournamentsController < ApplicationController
@wrestler = Wrestler.find(params[:wrestler][:originalId])
respond_to do |format|
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 }
end
end
@@ -149,7 +149,8 @@ class TournamentsController < ApplicationController
def all_brackets
@schools = @tournament.schools
@schools = @schools.sort_by{|s| s.page_score_string}.reverse!
end
def bracket

View File

@@ -71,6 +71,7 @@ li:first-child,li:last-child {
</style>
<div id="exportable">
<%= render :file => 'tournaments/team_scores' %>
<% @tournament.weights.sort_by{|w| w.max}.each do |w| %>
<table class='pagebreak'>
<h5><strong><%= @tournament.name %> - <%= w.max %> lbs Bracket</strong></h5>

View File

@@ -1,7 +1,8 @@
<% cache ["#{@tournament.id}_team_scores", @tournament] do %>
<table class="pagebreak table table-striped table-bordered">
<h3>Team Scores</h3>
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>Name</th>
@@ -12,7 +13,7 @@
<tbody>
<% @schools.each do |school| %>
<tr>
<td><%= school.name %> (<%= school.abbreviation %>)</td>
<td><%= @schools.index(school) + 1 %>. <%= school.name %> (<%= school.abbreviation %>)</td>
<td><%= school.page_score_string %></td>
</tr>
<% end %>