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">
<div class="govuk-summary-list__row"> <dt class="govuk-summary-list__key">
<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%>
<%= question_info["check_answer_label"].to_s.present? ? question_info["check_answer_label"].to_s : question_info["header"].to_s%> <dt>
<dt> <dd class="govuk-summary-list__value">
<dd class="govuk-summary-list__value"> <%= form.get_answer_label(@case_log, question_title) %>
<%= form.get_answer_label(@case_log, question_title) %> </dd>
</dd> <dd class="govuk-summary-list__actions">
<dd class="govuk-summary-list__actions"> <%= create_update_answer_link(question_title, question_info, @case_log, form) %>
<%= create_update_answer_link(question_title, question_info, @case_log, form) %> </dd>
</dd> </div>
</div>
</dl>

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

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

Loading…
Cancel
Save