Skip to content

Commit

Permalink
AP-5434: Make changes flagged in code review
Browse files Browse the repository at this point in the history
  • Loading branch information
agoldstone93 committed Nov 7, 2024
1 parent 242ab3f commit 29f4827
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 17 deletions.
4 changes: 0 additions & 4 deletions app/assets/stylesheets/check-your-answers.scss
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,3 @@
.print-no-break>.govuk-body {
word-wrap: break-word;
}

.govuk-summary-card {
break-inside: avoid;
}
6 changes: 5 additions & 1 deletion app/assets/stylesheets/summary-card.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
.bold-border-top {
border-top: 2px solid #000000
border-top: 2px solid govuk-colour("black");
}

.govuk-summary-card {
break-inside: avoid;
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
card: { title: @proceeding.meaning },
rows:,
actions: false,
classes: "govuk-!-margin-bottom-9",
) %>
<% else %>
<h3 class="govuk-heading-s">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
</div>
</div>

<%= govuk_summary_list(card: { title: t(".section_proceeding.heading") }, actions: false, classes: "govuk-!-margin-bottom-9") do |summary_list| %>
<%= govuk_summary_list(card: { title: t(".section_proceeding.heading") }, actions: false) do |summary_list| %>
<%= @source_application.proceedings_by_name.each_with_index do |proceeding, i| %>
<%= summary_list.with_row(classes: "app-check-your-answers__#{proceeding.name}_proceeding") do |row| %>
<%= row.with_key(text: "#{t('.proceeding')} #{i + 1}", classes: "govuk-!-width-one-half") %>
Expand Down
1 change: 0 additions & 1 deletion app/views/providers/merits_reports/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
<h2 class="govuk-heading-m"><%= t(".previous_legal_aid") %></h2>

<%= govuk_summary_list(card: { title: t(".previous_legal_aid") },
classes: "govuk-!-margin-bottom-9",
html_attributes: { id: "previous-legal-aid-question" }) do |summary_list| %>
<%= summary_list.with_row(html_attributes: { id: "app-check-your-answers__applied_previously" }) do |row| %>
<%= row.with_key(text: t(".has_applied_before"), classes: "govuk-!-width-one-half") %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/shared/check_answers/_client_details.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<%= govuk_summary_list(card: { title: "Client details" },
<%= govuk_summary_list(card: { title: t(".heading") },
html_attributes: { id: "client-details-questions" },
actions: !read_only) do |summary_list| %>
<% if :first_name.in?(attributes) %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/shared/check_answers/_dependants.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
</div>

<%= govuk_summary_list(
card: { title: "Dependant #{index + 1}: #{dependant.name}" },
card: { title: t(".dependant_name", position: index + 1, name: dependant.name) },
actions: false,
html_attributes: { id: "app-check-your-answers__dependants_#{index + 1}_items" },
) do |summary_list| %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/shared/check_answers/_emergency_costs.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<%= govuk_summary_list(card: { title: "Emergency cost limit" }, actions: false) do |summary_list| %>
<%= govuk_summary_list(card: { title: t(".heading") }, actions: false) do |summary_list| %>
<%= summary_list.with_row(html_attributes: { id: "app-check-your-answers__emergency_cost_override" }) do |row| %>
<%= row.with_key(text: t(".request_higher_limit"), classes: "govuk-!-width-one-half") %>
<%= row.with_value { yes_no(@legal_aid_application.emergency_cost_override) } %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/shared/check_answers/_partner_details.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<% read_only = false unless local_assigns.key?(:read_only)
heading_class = local_assigns.key?(:heading) ? local_assigns[:heading] : "govuk-heading-m" %>
<h2 class="<%= heading_class %>"><%= t ".section_heading" %></h2>
<%= govuk_summary_list(card: { title: "Partner's details" },
<%= govuk_summary_list(card: { title: t(".section_heading") },
html_attributes: { id: "partner-details-questions" },
actions: !read_only) do |summary_list| %>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<%= govuk_summary_list(card: { title: "Proceedings" }, actions: false) do |summary_list| %>
<%= govuk_summary_list(card: { title: t(".heading") }, actions: false) do |summary_list| %>
<%= @legal_aid_application.proceedings_by_name.each_with_index do |proceeding, i| %>
<%= summary_list.with_row(classes: "app-check-your-answers__#{proceeding.name}_proceeding") do |row| %>
<%= row.with_key(text: "#{t('.proceeding')} #{i + 1}", classes: "govuk-!-width-one-half") %>
Expand Down
13 changes: 9 additions & 4 deletions app/views/shared/means_report/_outgoings_details.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<section>
<% partner = @legal_aid_application.applicant.has_partner_with_no_contrary_interest? %>
<%= govuk_summary_list(card: { title: heading },
actions: false,
html_attributes: { id: "outgoings-details-questions" }) do |summary_list| %>
Expand All @@ -10,17 +9,23 @@
end %>
<% end %>
<% outgoings_detail_items.each do |item| %>
<% if partner && !partner_exclude_items.include?(item.value_method) %>
<% if @legal_aid_application.applicant.has_partner_with_no_contrary_interest? && !partner_exclude_items.include?(item.value_method) %>
<% summary_list.with_row do |row|
row.with_key(text: t(".partner.#{item.name}"), classes: "govuk-!-width-one-half")
row.with_value { gds_number_to_currency(@cfe_result.__send__(item.value_method, partner: true)) }
end %>
<% end %>
<% end %>
<% result = partner ? @cfe_result.__send__(:total_monthly_outgoings) + @cfe_result.__send__(:total_monthly_outgoings, partner: true) : @cfe_result.__send__(:total_monthly_outgoings) %>

<% result = if @legal_aid_application.applicant.has_partner_with_no_contrary_interest?
@cfe_result.__send__(:total_monthly_outgoings) + @cfe_result.__send__(:total_monthly_outgoings, partner: true)
else
@cfe_result.__send__(:total_monthly_outgoings)
end %>

<% summary_list.with_row(classes: "bold-border-top") do |row|
row.with_key { t(".total_outgoings") }
row.with_value(text: gds_number_to_currency(gds_number_to_currency(@cfe_result.__send__(:total_monthly_outgoings))), html_attributes: { class: "govuk-!-font-weight-bold" })
row.with_value(text: gds_number_to_currency(gds_number_to_currency(result)), html_attributes: { class: "govuk-!-font-weight-bold" })
end %>
<% end %>
</section>
4 changes: 4 additions & 0 deletions config/locales/en/shared.yml
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,7 @@ en:
upper_limit_label: Capital upper limit
total: Total capital assessed
client_details:
heading: Client details
previous_application_reference: Previous application reference
has_applied_before: Has applied before?
correspondence_address_choice: Where to send client's mail
Expand Down Expand Up @@ -443,6 +444,7 @@ en:
nino: National Insurance number
has_partner: Does your client have a partner?
dependants:
dependant_name: "Dependant %{position}: %{name}"
has_dependants: Does %{individual} have any dependants?
add-new: Add dependant
delete: Delete dependant
Expand All @@ -453,6 +455,7 @@ en:
income: Do they receive any income?
assets: Do they have assets worth more than £8,000?
emergency_costs:
heading: Emergency cost limit
request_higher_limit: Higher cost limit requested
new_cost_limit: Amount requested
new_limit_reasons: Reason
Expand Down Expand Up @@ -614,6 +617,7 @@ en:
income_heading: Payments %{individual_with_determiner} receives in cash
outgoings_heading: Payments %{individual_with_determiner} makes in cash
proceedings_details:
heading: Proceedings
proceeding: Proceeding
section_proceeding:
client_involvement_type: Client involvement type
Expand Down

0 comments on commit 29f4827

Please sign in to comment.