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.
77 lines
3.0 KiB
77 lines
3.0 KiB
<% content_for :title, @page.header.presence || @page.questions.first.header.html_safe %> |
|
|
|
<% content_for :before_content do %> |
|
<%= page_back_link(log: @log, page: @page, user: current_user, referrer: params[:referrer]) %> |
|
<% end %> |
|
|
|
<div data-controller="govukfrontend"></div> |
|
<%= form_with model: @log, url: request.original_url, method: "post", local: true do |f| %> |
|
<div class="govuk-grid-row"> |
|
<div class="govuk-grid-column-two-thirds-from-desktop"> |
|
<% remove_other_page_errors(@log, @page) %> |
|
<%= f.govuk_error_summary %> |
|
|
|
<% if @page.header.present? || @page.header_partial.present? %> |
|
<h1 class="govuk-heading-l"> |
|
<% if !@page.hide_subsection_label %> |
|
<span class="govuk-caption-l"><%= @subsection.label %></span> |
|
<% end %> |
|
<% if @page.header_partial.present? %> |
|
<%= render partial: "form/headers/#{@page.header_partial}", locals: { log: @log } %> |
|
<% else %> |
|
<%= @page.header %> |
|
<% end %> |
|
</h1> |
|
<% end %> |
|
|
|
<% if @page.description.present? %> |
|
<p class="govuk-body govuk-body-m"><%= @page.description.html_safe %></p> |
|
<% end %> |
|
|
|
<% @page.non_conditional_questions.map do |question| %> |
|
<div id="<%= question.id %>_div" <%= display_question_key_div(@page, question) %>> |
|
<% if question.read_only? %> |
|
<%= govuk_section_break(visible: true, size: "m") %> |
|
<% end %> |
|
<% if question.type == "interruption_screen" %> |
|
<%= render partial: "form/#{question.type}_question", locals: { |
|
question:, |
|
caption_text: @subsection.label, |
|
page_header: @page.header, |
|
lettings_log: @log, |
|
title_text: @page.title_text, |
|
informative_text: @page.informative_text, |
|
form: @form, |
|
f:, |
|
conditional: false, |
|
} %> |
|
<% else %> |
|
<%= render partial: "form/#{question.type}_question", locals: { |
|
question:, |
|
caption_text: @page.header_partial.present? ? nil : @subsection.label, |
|
page_header: @page.header, |
|
lettings_log: @log, |
|
f:, |
|
conditional: false, |
|
} %> |
|
<% end %> |
|
</div> |
|
<% end %> |
|
|
|
<%= f.hidden_field :page, value: @page.id %> |
|
<%= f.hidden_field :interruption_page_id, value: @interruption_page_id %> |
|
<%= f.hidden_field :interruption_page_referrer_type, value: @interruption_page_referrer_type %> |
|
|
|
<div class="govuk-button-group"> |
|
<% if !@page.interruption_screen? && if request.query_parameters["referrer"] != "check_answers" %> |
|
<%= f.govuk_submit "Save and continue" %> |
|
<%= page_skip_link(page: @page, log: @log, user: current_user) %> |
|
<% else %> |
|
<%= f.govuk_submit "Save changes" %> |
|
<%= page_cancel_link(log: @log, page: @page) %> |
|
<% end %> |
|
<% end %> |
|
</div> |
|
</div> |
|
</div> |
|
<% end %>
|
|
|