From d6c06214458aa01544300f110f35c534e5dc9ae5 Mon Sep 17 00:00:00 2001 From: Adam Goldstone <13471320+agoldstone93@users.noreply.github.com> Date: Wed, 13 Nov 2024 14:56:48 +0000 Subject: [PATCH] AP-5434: Update disregards info to use summary cards --- .../_capital_disregards.html.erb | 2 +- .../shared/check_answers/_assets.html.erb | 24 +++++++++---------- .../_capital_disregard_details.html.erb | 18 +++++--------- .../_capital_disregards.html.erb | 2 +- 4 files changed, 19 insertions(+), 27 deletions(-) diff --git a/app/views/providers/means_reports/_capital_disregards.html.erb b/app/views/providers/means_reports/_capital_disregards.html.erb index b002fcde42..ec335ca7d3 100644 --- a/app/views/providers/means_reports/_capital_disregards.html.erb +++ b/app/views/providers/means_reports/_capital_disregards.html.erb @@ -1,7 +1,7 @@

<%= t(".heading") %>

<%= govuk_summary_list( + card: { title: t(".heading") }, actions: false, - classes: "govuk-!-margin-bottom-9", html_attributes: { id: "capital-disregards-questions" }, ) do |summary_list| %> diff --git a/app/views/shared/check_answers/_assets.html.erb b/app/views/shared/check_answers/_assets.html.erb index 712fc2832b..005bb50f4d 100644 --- a/app/views/shared/check_answers/_assets.html.erb +++ b/app/views/shared/check_answers/_assets.html.erb @@ -152,19 +152,17 @@ <% end %> <%# savings and investments %> -
- <%= render( - "shared/check_answers/one_link_section", - name: :savings_and_investments, - url: check_answer_url_for(journey_type, :savings_and_investments, @legal_aid_application), - question: t(".assets.savings_and_investments#{individual}"), - answer_hash: capital_assets_list( - @legal_aid_application, - locale_namespace: "shared.forms.revealing_checkbox.attribute.#{journey_type}.savings_and_investments.check_box_", - ), - read_only:, - ) %> -
+ <%= render( + "shared/check_answers/one_link_section", + name: :savings_and_investments, + url: check_answer_url_for(journey_type, :savings_and_investments, @legal_aid_application), + question: t(".assets.savings_and_investments#{individual}"), + answer_hash: capital_assets_list( + @legal_aid_application, + locale_namespace: "shared.forms.revealing_checkbox.attribute.#{journey_type}.savings_and_investments.check_box_", + ), + read_only:, + ) %> <%# other assets %> <%= render( diff --git a/app/views/shared/check_answers/_capital_disregard_details.html.erb b/app/views/shared/check_answers/_capital_disregard_details.html.erb index be32af5593..1b279ff569 100644 --- a/app/views/shared/check_answers/_capital_disregard_details.html.erb +++ b/app/views/shared/check_answers/_capital_disregard_details.html.erb @@ -1,22 +1,16 @@ <% capital_disregard_type = capital_disregard.mandatory? ? "mandatory" : "discretionary" %> <% capital_disregard_name = t("providers.means.capital_disregards.#{capital_disregard_type}.#{capital_disregard.name}") %> +<% action_link = govuk_link_to(t("generic.change"), + providers_legal_aid_application_means_capital_disregards_add_detail_path(@legal_aid_application, capital_disregard), + visually_hidden_suffix: capital_disregard_name, + id: "app-check-your-answers__capital_disregard_#{index}_change_link") %> <%= govuk_summary_list( - actions: !read_only, - classes: "govuk-!-margin-bottom-9", + card: { title: t(".#{capital_disregard_type}.heading", count: index + 1), actions: read_only ? [] : [action_link] }, + actions: false, html_attributes: { id: "#{capital_disregard_type}-capital-disregard-questions_#{index}" }, ) do |summary_list| %> - <%= summary_list.with_row(html_attributes: { id: "app-check-your-answers__capital_disregard_#{index}_change_link" }) do |row| %> - <%= row.with_key(text: t(".#{capital_disregard_type}.heading", count: index + 1), classes: "govuk-!-width-one-half govuk-heading-m") %> - <%= row.with_value(text: nil) %> - <%= row.with_action( - text: t("generic.change"), - href: providers_legal_aid_application_means_capital_disregards_add_detail_path(@legal_aid_application, capital_disregard), - visually_hidden_text: capital_disregard_name, - ) %> - <% end %> - <%= summary_list.with_row(html_attributes: { id: "app-check-your-answers__payment_type" }) do |row| %> <%= row.with_key(text: t(".questions.payment_type"), classes: "govuk-!-width-one-half") %> <%= row.with_value { capital_disregard_name } %> diff --git a/app/views/shared/check_answers/_capital_disregards.html.erb b/app/views/shared/check_answers/_capital_disregards.html.erb index 357944d36a..87d7e91ad9 100644 --- a/app/views/shared/check_answers/_capital_disregards.html.erb +++ b/app/views/shared/check_answers/_capital_disregards.html.erb @@ -1,7 +1,7 @@

<%= t(".heading#{individual}") %>

<%= govuk_summary_list( + card: { title: t(".heading#{individual}") }, actions: !read_only, - classes: "govuk-!-margin-bottom-9", html_attributes: { id: "capital-disregards-questions" }, ) do |summary_list| %>