Browse Source

Make form pages 2/3 width

pull/89/head
baarkerlounger 4 years ago
parent
commit
bb5a081a98
  1. 41
      app/views/form/page.html.erb

41
app/views/form/page.html.erb

@ -3,25 +3,28 @@
<% end %>
<%= turbo_frame_tag "case_log_form", target: "_top" do %>
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<% if page_info["header"].present? %>
<h1 class="govuk-heading-xl">
<%= page_info["header"] %>
</h1>
<% end %>
<%= form_with model: @case_log, method: "submit_form", builder: GOVUKDesignSystemFormBuilder::FormBuilder do |f| %>
<%= f.govuk_error_summary %>
<% page_info["questions"].map do |question_key, question| %>
<div id=<%= question_key + "_div " %><%= display_question_key_div(page_info, question_key) %> >
<%= render partial: "form/#{question["type"]}_question", locals: { question_key: question_key.to_sym, question: question, f: f } %>
</div>
<% end %>
<% if page_info["header"].present? %>
<h1 class="govuk-heading-xl">
<%= page_info["header"] %>
</h1>
<% end %>
<%= form_with model: @case_log, method: "submit_form", builder: GOVUKDesignSystemFormBuilder::FormBuilder do |f| %>
<%= f.govuk_error_summary %>
<% page_info["questions"].map do |question_key, question| %>
<div id=<%= question_key + "_div " %><%= display_question_key_div(page_info, question_key) %> >
<%= render partial: "form/#{question["type"]}_question", locals: { question_key: question_key.to_sym, question: question, f: f } %>
</div>
<% end %>
<% if page_info["soft_validations"]&.keys&.first %>
<%= render partial: "form/validation_override_question", locals: { f: f, page_key: page_key, page_info: page_info } %>
<% end %>
<% if page_info["soft_validations"]&.keys&.first %>
<%= render partial: "form/validation_override_question", locals: { f: f, page_key: page_key, page_info: page_info } %>
<% end %>
<%= f.hidden_field :page, value: page_key %>
<%= f.govuk_submit "Save and continue" %>
<% end %>
<%= f.hidden_field :page, value: page_key %>
<%= f.govuk_submit "Save and continue" %>
<% end %>
</div>
</div>
<% end %>

Loading…
Cancel
Save