Browse Source

WIP

CLDC-559-printed-form
Kat 3 years ago
parent
commit
17ec9841df
  1. 16
      app/javascript/stylesheets/print.scss
  2. 4
      app/views/form/print/_checkbox_question.html.erb
  3. 2
      app/views/form/print/_date_question.html.erb
  4. 4
      app/views/form/print/_numeric_question.html.erb
  5. 4
      app/views/form/print/_radio_question.html.erb
  6. 4
      app/views/form/print/_select_question.html.erb
  7. 12
      app/views/form/print/_text_question.html.erb

16
app/javascript/stylesheets/print.scss

@ -1,13 +1,9 @@
.cell { .cell {
background-color: lightgrey; background-color: gainsboro;
}
.question_cell {
grid-column: 1;
} }
.grid-row { .grid-row {
border: 0.5px solid rgba(0, 0, 0, 0.8); border: 1px solid gray;
} }
.two-grid { .two-grid {
@ -15,22 +11,23 @@
grid-template-columns: auto auto; grid-template-columns: auto auto;
font-size: 10px; font-size: 10px;
grid-auto-columns: 1fr 200px; grid-auto-columns: 1fr 200px;
} }
.three-grid { .three-grid {
display: grid; display: grid;
grid-template-columns: auto auto auto; grid-template-columns: auto auto auto;
font-size: 10px; font-size: 10px;
grid-auto-columns: 1fr 200px; grid-auto-columns: 1fr 200px;
} }
.print-header { .print-header {
size: 12px; size: 12px;
} }
.govuk-body{
font-size: 10px;
margin-bottom: 0;
}
@media print { @media print {
body { body {
-webkit-print-color-adjust: exact; -webkit-print-color-adjust: exact;
@ -38,5 +35,4 @@
.cell { .cell {
background-color: lightgrey; background-color: lightgrey;
} }
} }

4
app/views/form/print/_checkbox_question.html.erb

@ -1,9 +1,9 @@
<div class="cell"> <div class="cell govuk-body">
<strong class="cell question_cell"> <strong class="cell question_cell">
<%= question["header"].html_safe.present? ? question["header"].html_safe : "missing question header"%> <%= question["header"].html_safe.present? ? question["header"].html_safe : "missing question header"%>
</strong> </strong>
</div> </div>
<div> <div class="govuk-body">
<% question["answer_options"].each do |index, answer_option| %> <% question["answer_options"].each do |index, answer_option| %>
<input type="checkbox"/> <input type="checkbox"/>
<label><%=answer_option %></label> <label><%=answer_option %></label>

2
app/views/form/print/_date_question.html.erb

@ -1,4 +1,4 @@
<div class="cell"> <div class="cell govuk-body">
<strong class="cell question_cell"> <strong class="cell question_cell">
<%= question["header"].html_safe.present? ? question["header"].html_safe : "missing question header"%> <%= question["header"].html_safe.present? ? question["header"].html_safe : "missing question header"%>
</strong> </strong>

4
app/views/form/print/_numeric_question.html.erb

@ -1,8 +1,8 @@
<div class="cell"> <div class="cell govuk-body">
<strong class="cell question_cell"> <strong class="cell question_cell">
<%= question["header"].html_safe.present? ? question["header"].html_safe : "missing question header"%> <%= question["header"].html_safe.present? ? question["header"].html_safe : "missing question header"%>
</strong> </strong>
</div> </div>
<div class="cell_answer"> <div class="cell_answer">
<div></div> <br/>
</div> </div>

4
app/views/form/print/_radio_question.html.erb

@ -1,9 +1,9 @@
<div class="cell"> <div class="cell govuk-body">
<strong class="cell question_cell"> <strong class="cell question_cell">
<%= question["header"].html_safe.present? ? question["header"].html_safe : "missing question header"%> <%= question["header"].html_safe.present? ? question["header"].html_safe : "missing question header"%>
</strong> </strong>
</div> </div>
<div class="grid"> <div class="two-grid govuk-body">
<div> <div>
<% question["answer_options"].each do |index, answer_option| %> <% question["answer_options"].each do |index, answer_option| %>
<% if index.to_i.even? %> <% if index.to_i.even? %>

4
app/views/form/print/_select_question.html.erb

@ -1,9 +1,9 @@
<div class="cell"> <div class="cell govuk-body">
<strong class="cell question_cell"> <strong class="cell question_cell">
<%= question["header"].html_safe.present? ? question["header"].html_safe : "missing question header"%> <%= question["header"].html_safe.present? ? question["header"].html_safe : "missing question header"%>
</strong> </strong>
</div> </div>
<div> <div class="govuk-body">
<% question["answer_options"].each do |index, answer_option| %> <% question["answer_options"].each do |index, answer_option| %>
<input type="checkbox"/> <input type="checkbox"/>
<label><%=answer_option %></label> <label><%=answer_option %></label>

12
app/views/form/print/_text_question.html.erb

@ -1,7 +1,11 @@
<strong class="cell"> <div class="cell govuk-body">
<%= question["header"].html_safe.present? ? question["header"].html_safe : "missing question header"%><br/> <strong class="cell">
</strong> <%= question["header"].html_safe.present? ? question["header"].html_safe : "missing question header"%><br/>
</strong>
</div>
<div> <div>
<div class="cell_answer_too"></div> <div class="cell_answer">
<br/>
</div>
</div> </div>

Loading…
Cancel
Save