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

Added printable weigh in sheet

This commit is contained in:
2016-01-21 12:48:50 +00:00
parent 911faceb7c
commit 6282693fe3
4 changed files with 46 additions and 2 deletions

View File

@@ -1,10 +1,15 @@
class TournamentsController < ApplicationController
before_action :set_tournament, only: [:error,:teampointadjust,:remove_teampointadjust,:remove_school_delegate,:remove_delegate,:school_delegate,:delegate,:matches,:weigh_in,:weigh_in_weight,:create_custom_weights,:show,:edit,:update,:destroy,:up_matches,:no_matches,:team_scores,:brackets,:generate_matches,:bracket,:all_brackets]
before_filter :check_access_manage, only: [:teampointadjust,:remove_teampointadjust,:remove_school_delegate,:school_delegate,:weigh_in,:weigh_in_weight,:create_custom_weights,:update,:edit,:generate_matches,:matches]
before_action :set_tournament, only: [:weigh_in_sheet,:error,:teampointadjust,:remove_teampointadjust,:remove_school_delegate,:remove_delegate,:school_delegate,:delegate,:matches,:weigh_in,:weigh_in_weight,:create_custom_weights,:show,:edit,:update,:destroy,:up_matches,:no_matches,:team_scores,:brackets,:generate_matches,:bracket,:all_brackets]
before_filter :check_access_manage, only: [:weigh_in_sheet,:teampointadjust,:remove_teampointadjust,:remove_school_delegate,:school_delegate,:weigh_in,:weigh_in_weight,:create_custom_weights,:update,:edit,:generate_matches,:matches]
before_filter :check_access_destroy, only: [:destroy,:delegate,:remove_delegate]
before_filter :check_tournament_errors, only: [:generate_matches]
before_filter :check_for_matches, only: [:up_matches,:bracket,:all_brackets]
def weigh_in_sheet
end
def remove_teampointadjust
if params[:teampointadjust]
@points = Teampointadjust.find(params[:teampointadjust])

View File

@@ -16,5 +16,8 @@
<%= f.submit 'Submit', :class=>"btn btn-success" %>
<% end %>
<% end %>
<br>
<br>
<%= link_to "Printable Weigh In Sheet" , "/tournaments/#{@tournament.id}/weigh_in_sheet?print=true" %>

View File

@@ -0,0 +1,35 @@
<style>
.pagebreak {
page-break-after: always;
border: none;
margin: 0px;
padding: 0px;
width: 7in; /* width: 7in; */
height: 9.5in; /* or height: 9.5in; */
font-size: 10px;
position: relative;
left: 1in;
height: 1in;
}
</style>
<% @tournament.schools.each do |school| %>
<table class="table table-striped table-bordered table-condensed pagebreak">
<h5><%= school.name %></h4>
<thead>
<tr>
<th>Name</th>
<th>Weight Class</th>
<th>Actual Weight</th>
</tr>
</thead>
<tbody>
<% school.wrestlers.sort_by{|w| w.weight.max}.each do |wrestler| %>
<tr>
<td><%= wrestler.name %></td>
<td><%= wrestler.weight.max %></td>
<td></td>
</tr>
<% end %>
</tbody>
</table>
<% end %>