You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
842 B
16 lines
842 B
3 years ago
|
<h1>Print the form</h1>
|
||
|
|
||
|
<%= form_with do |f| %>
|
||
|
<% @form.all_subsections.each do |subsection_name, subsection_content| %>
|
||
|
<p class="print-header"><%= subsection_content["label"] %></p>
|
||
|
<% 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" %>
|
||
|
<div class="<%= large_answers %>">
|
||
|
<% @form.questions_for_subsection(subsection_name).each_with_index do |question, index| %>
|
||
|
<div class="grid-row">
|
||
|
<%= render partial: "form/print/#{question[1]["print_type"] || question[1]["type"]}_question", locals: { question_key: question[0].to_sym, question: question[1], index: index, f: f } %>
|
||
|
</div>
|
||
|
<% end %>
|
||
|
</div>
|
||
|
<% end %>
|
||
|
<% end %>
|