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 {
background-color: lightgrey;
}
.question_cell {
grid-column: 1;
background-color: gainsboro;
}
.grid-row {
border: 0.5px solid rgba(0, 0, 0, 0.8);
border: 1px solid gray;
}
.two-grid {
@ -15,22 +11,23 @@
grid-template-columns: auto auto;
font-size: 10px;
grid-auto-columns: 1fr 200px;
}
.three-grid {
display: grid;
grid-template-columns: auto auto auto;
font-size: 10px;
grid-auto-columns: 1fr 200px;
}
.print-header {
size: 12px;
}
.govuk-body{
font-size: 10px;
margin-bottom: 0;
}
@media print {
body {
-webkit-print-color-adjust: exact;
@ -38,5 +35,4 @@
.cell {
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">
<%= question["header"].html_safe.present? ? question["header"].html_safe : "missing question header"%>
</strong>
</div>
<div>
<div class="govuk-body">
<% question["answer_options"].each do |index, answer_option| %>
<input type="checkbox"/>
<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">
<%= question["header"].html_safe.present? ? question["header"].html_safe : "missing question header"%>
</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">
<%= question["header"].html_safe.present? ? question["header"].html_safe : "missing question header"%>
</strong>
</div>
<div class="cell_answer">
<div></div>
<br/>
</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">
<%= question["header"].html_safe.present? ? question["header"].html_safe : "missing question header"%>
</strong>
</div>
<div class="grid">
<div class="two-grid govuk-body">
<div>
<% question["answer_options"].each do |index, answer_option| %>
<% 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">
<%= question["header"].html_safe.present? ? question["header"].html_safe : "missing question header"%>
</strong>
</div>
<div>
<div class="govuk-body">
<% question["answer_options"].each do |index, answer_option| %>
<input type="checkbox"/>
<label><%=answer_option %></label>

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

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

Loading…
Cancel
Save