Submit social housing lettings and sales data (CORE)
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.
 
 
 
 

15 lines
891 B

<h1>2021/2022 form</h1>
<%= form_with do |f| %>
<% @form.all_subsections.each do |subsection_name, subsection_content| %>
<p class="govuk-heading-s print-form-heading"><%= 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} ? "one-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, outer_grid: large_answers } %>
</div>
<% end %>
</div>
<% end %>
<% end %>