diff --git a/app/controllers/tournaments_controller.rb b/app/controllers/tournaments_controller.rb
index 422b09d..8d18bac 100644
--- a/app/controllers/tournaments_controller.rb
+++ b/app/controllers/tournaments_controller.rb
@@ -1,5 +1,5 @@
class TournamentsController < ApplicationController
- before_action :set_tournament, only: [:swap,: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_action :set_tournament, only: [:bout_sheets,:swap,: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_action :check_access_manage, only: [:swap,: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_action :check_access_destroy, only: [:destroy,:delegate,:remove_delegate]
before_action :check_tournament_errors, only: [:generate_matches]
@@ -186,6 +186,17 @@ class TournamentsController < ApplicationController
@mats = @tournament.mats.includes(:matches)
end
+ def bout_sheets
+ if params[:round]
+ round = params[:round]
+ if round != "All"
+ @matches = @tournament.matches.where("round = ?",round).sort_by{|match| match.bout_number}
+ else
+ @matches = @tournament.matches.sort_by{|match| match.bout_number}
+ end
+ end
+ end
+
def index
if params[:search]
@tournaments = Tournament.search(params[:search]).order("created_at DESC")
diff --git a/app/views/layouts/_lsidebar.html.erb b/app/views/layouts/_lsidebar.html.erb
index 4c04823..2ae9f1b 100644
--- a/app/views/layouts/_lsidebar.html.erb
+++ b/app/views/layouts/_lsidebar.html.erb
@@ -20,7 +20,13 @@
Pages
<%= link_to "Weigh In Page" , "/tournaments/#{@tournament.id}/weigh_in" %>
<%= link_to "All Matches" , "/tournaments/#{@tournament.id}/matches" %>
-
<%= link_to "Full Screen Bout Board" , "/tournaments/#{@tournament.id}/up_matches?print=true" %>
+
<%= link_to "Full Screen Bout Board" , "/tournaments/#{@tournament.id}/up_matches?print=true" , target: :_blank %>
+
Bout Sheets:
| Circle Winner | +
+ <%= match.w1_name %> +<%= if w1 then w1.school.name end %> + |
+
+ <%= match.w2_name %> +<%= if w2 then w2.school.name end %> + |
+
|---|---|---|
| + | red / green (circle one) | +red / green (circle one) | +
| Period 1 | +||
| Choice | +top / bottom / neutral / defer (circle one) | +top / bottom / neutral / defer (circle one) | +
| Period 2 | +||
| Choice | +top / bottom / neutral / defer (circle one) | +top / bottom / neutral / defer (circle one) | +
| Period 3 | +||
| Overtime 1 | +||
| Choice | +top / bottom / neutral / defer (circle one) | +top / bottom / neutral / defer (circle one) | +
| Overtime 2 | +||
| Choice | +top / bottom / neutral / defer (circle one) | +top / bottom / neutral / defer (circle one) | +
| Overtime 3 | +||
| Choice | +top / bottom / neutral / defer (circle one) | +top / bottom / neutral / defer (circle one) | +
| Overtime 4 | +||
| Final Score (or pin time, default, disqualified, etc) | +