<% content_for :title, "#{subsection.id.humanize} - Check your answers" %> <% content_for :breadcrumbs, govuk_breadcrumbs(breadcrumbs: { "Logs" => "/logs", "Log #{@lettings_log.id}" => "/logs/#{@lettings_log.id}", subsection.label => "", }) %>

<%= subsection.label %> Check your answers

<% if subsection.id == "setup" && subsection.status(@lettings_log) == :completed %> <%= govuk_inset_text(text: "Changing these answers might remove answers you’ve already given in other sections.") %> <% end %> <%= display_answered_questions_summary(subsection, @lettings_log, current_user) %> <% if any_questions_have_summary_card_number?(subsection, @lettings_log) %> <% subsection.applicable_questions(@lettings_log).group_by(&:check_answers_card_number).values.each do |question_group| %> <%= render CheckAnswersSummaryListCardComponent.new(questions: question_group, lettings_log: @lettings_log, user: current_user) %> <% end %> <% else %> <%= render partial: "form/check_answers_summary_list", locals: { subsection:, lettings_log: @lettings_log, } %> <% end %> <%= form_with model: @lettings_log, method: "get" do |f| %> <%= f.govuk_submit "Save and return to log" do %> <% next_incomplete_section_redirect_path = @lettings_log.form.next_incomplete_section_redirect_path(subsection, @lettings_log) %> <% if @lettings_log.status == "in_progress" && next_incomplete_section_redirect_path != "error" %> <%= govuk_button_link_to "Save and go to next incomplete section", "/logs/#{@lettings_log.id}/#{next_incomplete_section_redirect_path}", secondary: true %> <% end %> <% end %> <% end %>