Skip to content

Commit

Permalink
AP-5434: Update disregards info to use summary cards
Browse files Browse the repository at this point in the history
  • Loading branch information
agoldstone93 committed Nov 13, 2024
1 parent 731f50d commit d6c0621
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 27 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<h2 class="govuk-heading-m"><%= t(".heading") %></h2>
<%= govuk_summary_list(
card: { title: t(".heading") },
actions: false,
classes: "govuk-!-margin-bottom-9",
html_attributes: { id: "capital-disregards-questions" },
) do |summary_list| %>

Expand Down
24 changes: 11 additions & 13 deletions app/views/shared/check_answers/_assets.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -152,19 +152,17 @@
<% end %>

<%# savings and investments %>
<div class="govuk-!-padding-bottom-9">
<%= 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:,
) %>
</div>
<%= 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(
Expand Down
18 changes: 6 additions & 12 deletions app/views/shared/check_answers/_capital_disregard_details.html.erb
Original file line number Diff line number Diff line change
@@ -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 } %>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<h2 class="govuk-heading-m"><%= t(".heading#{individual}") %></h2>
<%= 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| %>

Expand Down

0 comments on commit d6c0621

Please sign in to comment.