Browse Source

Check answers should be a single summary list (#100)

pull/81/head
Daniel Baark 3 years ago committed by GitHub
parent
commit
f947b0f74e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 24
      app/views/form/_check_answers_table.html.erb
  2. 8
      app/views/form/check_answers.html.erb

24
app/views/form/_check_answers_table.html.erb

@ -1,13 +1,11 @@
<dl class="govuk-summary-list govuk-!-margin-bottom-9">
<div class="govuk-summary-list__row">
<dt class="govuk-summary-list__key">
<%= question_info["check_answer_label"].to_s.present? ? question_info["check_answer_label"].to_s : question_info["header"].to_s%>
<dt>
<dd class="govuk-summary-list__value">
<%= form.get_answer_label(@case_log, question_title) %>
</dd>
<dd class="govuk-summary-list__actions">
<%= create_update_answer_link(question_title, question_info, @case_log, form) %>
</dd>
</div>
</dl>
<div class="govuk-summary-list__row">
<dt class="govuk-summary-list__key">
<%= question_info["check_answer_label"].to_s.present? ? question_info["check_answer_label"].to_s : question_info["header"].to_s%>
<dt>
<dd class="govuk-summary-list__value">
<%= form.get_answer_label(@case_log, question_title) %>
</dd>
<dd class="govuk-summary-list__actions">
<%= create_update_answer_link(question_title, question_info, @case_log, form) %>
</dd>
</div>

8
app/views/form/check_answers.html.erb

@ -3,9 +3,11 @@
<div class="govuk-grid-column-three-quarters-from-desktop">
<h1 class="govuk-heading-l">Check the answers you gave for <%= subsection.humanize(capitalize: false) %></h1>
<%= display_answered_questions_summary(subsection, @case_log, form) %>
<% total_questions(subsection, @case_log, form).each do |question_title, question_info| %>
<%= render partial: 'form/check_answers_table', locals: { question_title: question_title, question_info: question_info, case_log: @case_log, form: form } %>
<% end %>
<dl class="govuk-summary-list govuk-!-margin-bottom-9">
<% total_questions(subsection, @case_log, form).each do |question_title, question_info| %>
<%= render partial: 'form/check_answers_table', locals: { question_title: question_title, question_info: question_info, case_log: @case_log, form: form } %>
<% end %>
</dl>
<%= form_with model: @case_log, method: "get", builder: GOVUKDesignSystemFormBuilder::FormBuilder do |f| %>
<%= f.govuk_submit "Save and continue" %>
<% end %>

Loading…
Cancel
Save