diff --git a/app/controllers/case_logs_controller.rb b/app/controllers/case_logs_controller.rb index d721377ed..2fff84580 100644 --- a/app/controllers/case_logs_controller.rb +++ b/app/controllers/case_logs_controller.rb @@ -1,7 +1,7 @@ class CaseLogsController < ApplicationController - # skip_before_action :verify_authenticity_token, if: :json_api_request? - # before_action :authenticate, if: :json_api_request? - # before_action :authenticate_user!, unless: :json_api_request? + skip_before_action :verify_authenticity_token, if: :json_api_request? + before_action :authenticate, if: :json_api_request? + before_action :authenticate_user!, unless: :json_api_request? def index @completed_case_logs = CaseLog.completed diff --git a/app/javascript/stylesheets/print.scss b/app/javascript/stylesheets/print.scss index 31b110651..de2a45d66 100644 --- a/app/javascript/stylesheets/print.scss +++ b/app/javascript/stylesheets/print.scss @@ -34,7 +34,7 @@ grid-auto-columns: 1fr 200px; } -.govuk-heading-s { +.print-form-heading { font-size: small; margin-bottom: 0; margin-top: 5px; @@ -54,4 +54,12 @@ background-color: lightgrey; } .noprint {display:none;} + + .one-grid { + page-break-inside: avoid; + } + + .three-grid { + page-break-inside: avoid; + } } diff --git a/app/views/form/print.html.erb b/app/views/form/print.html.erb index 9f14a9753..226250235 100644 --- a/app/views/form/print.html.erb +++ b/app/views/form/print.html.erb @@ -2,7 +2,7 @@ <%= form_with do |f| %> <% @form.all_subsections.each do |subsection_name, subsection_content| %> -
<%= subsection_content["label"] %>
+<%= subsection_content["label"] %>
<% large_answers = @form.questions_for_subsection(subsection_name).any? {|key, info| info["type"]== 'checkbox' || info["type"]== 'radio' && info["answer_options"].keys.length > 4} ? "one-grid" : "three-grid" %>