From 8097f24c7d32b5b289e733800f609c01f25a76f1 Mon Sep 17 00:00:00 2001 From: Kat Date: Tue, 23 Nov 2021 08:30:55 +0000 Subject: [PATCH] WIP --- app/javascript/stylesheets/print.scss | 7 ++++-- app/views/form/print.html.erb | 4 ++-- .../form/print/_checkbox_question.html.erb | 22 ++++++++++++++----- app/views/layouts/_footer.html.erb | 2 +- app/views/layouts/application.html.erb | 2 +- 5 files changed, 26 insertions(+), 11 deletions(-) diff --git a/app/javascript/stylesheets/print.scss b/app/javascript/stylesheets/print.scss index faa4aace7..633d650df 100644 --- a/app/javascript/stylesheets/print.scss +++ b/app/javascript/stylesheets/print.scss @@ -20,8 +20,10 @@ grid-auto-columns: 1fr 200px; } -.print-header { - size: 12px; +.govuk-heading-s { + font-size: small; + margin-bottom: 0; + margin-top: 5px; } .govuk-body{ @@ -35,4 +37,5 @@ .cell { background-color: lightgrey; } + .noprint {display:none;} } diff --git a/app/views/form/print.html.erb b/app/views/form/print.html.erb index 7d83b0cd0..b722de18f 100644 --- a/app/views/form/print.html.erb +++ b/app/views/form/print.html.erb @@ -1,8 +1,8 @@ -

Print the form

+

2021/2022 form

<%= form_with do |f| %> <% @form.all_subsections.each do |subsection_name, subsection_content| %> - +

<%= 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} ? "two-grid" : "three-grid" %>
<% @form.questions_for_subsection(subsection_name).each_with_index do |question, index| %> diff --git a/app/views/form/print/_checkbox_question.html.erb b/app/views/form/print/_checkbox_question.html.erb index 55deda8ef..fb5765d73 100644 --- a/app/views/form/print/_checkbox_question.html.erb +++ b/app/views/form/print/_checkbox_question.html.erb @@ -3,9 +3,21 @@ <%= question["header"].html_safe.present? ? question["header"].html_safe : "missing question header"%>
-
- <% question["answer_options"].each do |index, answer_option| %> - - - <%end %> +
+
+ <% question["answer_options"].each do |index, answer_option| %> + <% if index.to_i.even? %> + +
+ <% end %> + <%end %> +
+
+ <% question["answer_options"].each do |index, answer_option| %> + <% if !index.to_i.even? %> + +
+ <% end %> + <%end %> +
diff --git a/app/views/layouts/_footer.html.erb b/app/views/layouts/_footer.html.erb index 5e0da8f33..040222999 100644 --- a/app/views/layouts/_footer.html.erb +++ b/app/views/layouts/_footer.html.erb @@ -1,4 +1,4 @@ -
+