diff --git a/app/views/external_users/claims/_summary_claims_content.html.haml b/app/views/external_users/claims/_summary_claims_content.html.haml deleted file mode 100644 index 9033d45763..0000000000 --- a/app/views/external_users/claims/_summary_claims_content.html.haml +++ /dev/null @@ -1,3 +0,0 @@ -- claim.summary_sections.each do |section, associated_step| - - if claim.accessible_step?(associated_step) && section.to_s != 'additional_information' - = render partial: "external_users/claims/#{section}/summary", locals: { claim: claim, step: associated_step, section: section, editable: claim.editable_step?(associated_step) } diff --git a/app/views/external_users/claims/summary.html.haml b/app/views/external_users/claims/summary.html.haml index 1cc0fdfab1..f79ed50ed9 100644 --- a/app/views/external_users/claims/summary.html.haml +++ b/app/views/external_users/claims/summary.html.haml @@ -39,4 +39,4 @@ .govuk-grid-row .govuk-grid-column-full - = render partial: 'external_users/claims/summary_claims_content', locals: { claim: claim } + = render partial: 'shared/summary/summary_claims_content', locals: { claim: claim } diff --git a/app/views/shared/_claim.html.haml b/app/views/shared/_claim.html.haml index bbca000b72..8d357f2b95 100644 --- a/app/views/shared/_claim.html.haml +++ b/app/views/shared/_claim.html.haml @@ -93,4 +93,4 @@ = t('.no_defendant') - unless claim.fixed_fee_case? - = render partial: 'external_users/claims/offence_details/summary', locals: { claim: claim } + = render partial: 'shared/summary/offence_details/summary', locals: { claim: claim } diff --git a/app/views/shared/_summary_agfs.html.haml b/app/views/shared/_summary_agfs.html.haml index 580dd21e94..2d8dbe31e9 100644 --- a/app/views/shared/_summary_agfs.html.haml +++ b/app/views/shared/_summary_agfs.html.haml @@ -123,4 +123,4 @@ %p.govuk-body = t('shared.summary.no_values.expenses') - else - = render partial: 'shared/summary/expenses', locals: { claim: claim } + = render partial: 'shared/summary/expenses/summary', locals: { claim: claim } diff --git a/app/views/shared/_summary_lgfs.html.haml b/app/views/shared/_summary_lgfs.html.haml index 73bd4beeed..ac83d3066d 100644 --- a/app/views/shared/_summary_lgfs.html.haml +++ b/app/views/shared/_summary_lgfs.html.haml @@ -107,7 +107,7 @@ %p.govuk-body = t('shared.summary.no_values.expenses') - else - = render partial: 'shared/summary/expenses', locals: { claim: claim } + = render partial: 'shared/summary/expenses/summary', locals: { claim: claim } - if claim.can_have_disbursements? - if claim.disbursements.empty? diff --git a/app/views/shared/summary/_summary_claims_content.html.haml b/app/views/shared/summary/_summary_claims_content.html.haml new file mode 100644 index 0000000000..8200527dd3 --- /dev/null +++ b/app/views/shared/summary/_summary_claims_content.html.haml @@ -0,0 +1,3 @@ +- claim.summary_sections.each do |section, associated_step| + - if claim.accessible_step?(associated_step) && section.to_s != 'additional_information' + = render partial: "shared/summary/#{section}/summary", locals: { claim: claim, step: associated_step, section: section, editable: claim.editable_step?(associated_step) } diff --git a/app/views/external_users/claims/additional_information/_summary.html.haml b/app/views/shared/summary/additional_information/_summary.html.haml similarity index 100% rename from app/views/external_users/claims/additional_information/_summary.html.haml rename to app/views/shared/summary/additional_information/_summary.html.haml diff --git a/app/views/external_users/claims/basic_fees/_summary.html.haml b/app/views/shared/summary/basic_fees/_summary.html.haml similarity index 100% rename from app/views/external_users/claims/basic_fees/_summary.html.haml rename to app/views/shared/summary/basic_fees/_summary.html.haml diff --git a/app/views/external_users/claims/case_details/_summary.html.haml b/app/views/shared/summary/case_details/_summary.html.haml similarity index 88% rename from app/views/external_users/claims/case_details/_summary.html.haml rename to app/views/shared/summary/case_details/_summary.html.haml index 1800745f38..9d66763ec0 100644 --- a/app/views/external_users/claims/case_details/_summary.html.haml +++ b/app/views/shared/summary/case_details/_summary.html.haml @@ -1,14 +1,14 @@ -- claim_fields = %i[external_users claims case_details fields] -- cracked_trial_fields = %i[external_users claims case_details cracked_trial_fields] -- trial_detail_fields = %i[external_users claims case_details trial_detail_fields] -- retrial_detail_fields = %i[external_users claims case_details retrial_detail_fields] +- claim_fields = %i[shared summary case_details fields] +- cracked_trial_fields = %i[shared summary case_details cracked_trial_fields] +- trial_detail_fields = %i[shared summary case_details trial_detail_fields] +- retrial_detail_fields = %i[shared summary case_details retrial_detail_fields] #case-details-section.app-summary-section %h2.govuk-heading-l - = t('external_users.claims.case_details.summary.header') + = t('shared.summary.case_details.summary.header') - if local_assigns[:editable] - = govuk_link_to t('common.change_html', context: t('external_users.claims.case_details.summary.header')), edit_polymorphic_path(claim, step: :case_details, referrer: :summary), class: 'link-change' + = govuk_link_to t('common.change_html', context: t('shared.summary.case_details.summary.header')), edit_polymorphic_path(claim, step: :case_details, referrer: :summary), class: 'link-change' - if claim.mandatory_case_details? = govuk_summary_list do @@ -41,7 +41,7 @@ = govuk_summary_list_row_collection( t('case_type', scope: claim_fields) ) { claim.case_type&.name } - if claim.requires_case_concluded_date? - = govuk_summary_list_row_collection( t('external_users.claims.case_details.case_concluded_date.case_concluded_at') ) { claim.case_concluded_at } + = govuk_summary_list_row_collection( t('shared.summary.case_details.case_concluded_date.case_concluded_at') ) { claim.case_concluded_at } - if claim&.case_type && claim.requires_cracked_dates? = govuk_summary_list_row_collection( t('trial_fixed_notice_at', scope: cracked_trial_fields) ) do diff --git a/app/views/external_users/claims/defendants/_summary.html.haml b/app/views/shared/summary/defendants/_summary.html.haml similarity index 100% rename from app/views/external_users/claims/defendants/_summary.html.haml rename to app/views/shared/summary/defendants/_summary.html.haml diff --git a/app/views/external_users/claims/disbursements/_summary.html.haml b/app/views/shared/summary/disbursements/_summary.html.haml similarity index 100% rename from app/views/external_users/claims/disbursements/_summary.html.haml rename to app/views/shared/summary/disbursements/_summary.html.haml diff --git a/app/views/shared/summary/_expenses.html.haml b/app/views/shared/summary/expenses/_expenses.html.haml similarity index 100% rename from app/views/shared/summary/_expenses.html.haml rename to app/views/shared/summary/expenses/_expenses.html.haml diff --git a/app/views/external_users/claims/expenses/_summary.html.haml b/app/views/shared/summary/expenses/_summary.html.haml similarity index 100% rename from app/views/external_users/claims/expenses/_summary.html.haml rename to app/views/shared/summary/expenses/_summary.html.haml diff --git a/app/views/external_users/claims/fixed_fees/_summary.html.haml b/app/views/shared/summary/fixed_fees/_summary.html.haml similarity index 100% rename from app/views/external_users/claims/fixed_fees/_summary.html.haml rename to app/views/shared/summary/fixed_fees/_summary.html.haml diff --git a/app/views/external_users/claims/graduated_fees/_summary.html.haml b/app/views/shared/summary/graduated_fees/_summary.html.haml similarity index 100% rename from app/views/external_users/claims/graduated_fees/_summary.html.haml rename to app/views/shared/summary/graduated_fees/_summary.html.haml diff --git a/app/views/external_users/claims/hardship_fee/_summary.html.haml b/app/views/shared/summary/hardship_fee/_summary.html.haml similarity index 100% rename from app/views/external_users/claims/hardship_fee/_summary.html.haml rename to app/views/shared/summary/hardship_fee/_summary.html.haml diff --git a/app/views/external_users/claims/interim_claim_info/_summary.html.haml b/app/views/shared/summary/interim_claim_info/_summary.html.haml similarity index 100% rename from app/views/external_users/claims/interim_claim_info/_summary.html.haml rename to app/views/shared/summary/interim_claim_info/_summary.html.haml diff --git a/app/views/external_users/claims/interim_fee/_summary.html.haml b/app/views/shared/summary/interim_fee/_summary.html.haml similarity index 100% rename from app/views/external_users/claims/interim_fee/_summary.html.haml rename to app/views/shared/summary/interim_fee/_summary.html.haml diff --git a/app/views/external_users/claims/misc_fees/_summary.html.haml b/app/views/shared/summary/misc_fees/_summary.html.haml similarity index 67% rename from app/views/external_users/claims/misc_fees/_summary.html.haml rename to app/views/shared/summary/misc_fees/_summary.html.haml index 22cb5fcda3..ed6f8cfb27 100644 --- a/app/views/external_users/claims/misc_fees/_summary.html.haml +++ b/app/views/shared/summary/misc_fees/_summary.html.haml @@ -2,4 +2,4 @@ = render partial: 'summary_fees', locals: misc_fees_summary_locals(claim, editable: editable, section: section) - if claim.requires_interim_claim_info? - = render partial: 'external_users/claims/interim_claim_info/summary', locals: { claim: claim } + = render partial: 'shared/summary/interim_claim_info/summary', locals: { claim: claim } diff --git a/app/views/external_users/claims/offence_details/_summary.html.haml b/app/views/shared/summary/offence_details/_summary.html.haml similarity index 100% rename from app/views/external_users/claims/offence_details/_summary.html.haml rename to app/views/shared/summary/offence_details/_summary.html.haml diff --git a/app/views/external_users/claims/supporting_evidence/_summary.html.haml b/app/views/shared/summary/supporting_evidence/_summary.html.haml similarity index 100% rename from app/views/external_users/claims/supporting_evidence/_summary.html.haml rename to app/views/shared/summary/supporting_evidence/_summary.html.haml diff --git a/app/views/external_users/claims/transfer_detail/_summary.html.haml b/app/views/shared/summary/transfer_detail/_summary.html.haml similarity index 100% rename from app/views/external_users/claims/transfer_detail/_summary.html.haml rename to app/views/shared/summary/transfer_detail/_summary.html.haml diff --git a/app/views/external_users/claims/transfer_fee/_summary.html.haml b/app/views/shared/summary/transfer_fee/_summary.html.haml similarity index 100% rename from app/views/external_users/claims/transfer_fee/_summary.html.haml rename to app/views/shared/summary/transfer_fee/_summary.html.haml diff --git a/app/views/external_users/claims/warrant_fee/_summary.html.haml b/app/views/shared/summary/warrant_fee/_summary.html.haml similarity index 100% rename from app/views/external_users/claims/warrant_fee/_summary.html.haml rename to app/views/shared/summary/warrant_fee/_summary.html.haml diff --git a/config/locales/en.yml b/config/locales/en.yml index 64b3f41b4f..561ba470f3 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -2052,7 +2052,6 @@ en: reason_for_refusal: Choose reason for refusal reason_for_rejection: Choose reason for rejection claimed_by: Claimed by - reason_text: Reason text reason_hint: These reasons will be displayed to providers update_the_claim_status: Update the claim status reason_text: Reason text @@ -2182,13 +2181,61 @@ en: retrial_started_at: Retrial started at first_day_of_trial: First day of trial actual_trial_length: *actual_trial_length + case_details: + case_concluded_date: + case_concluded_at: 'Date case concluded' + cracked_trial_fields: + trial_cracked_at: 'Case cracked on' + case_cracked: 'Case cracked in' + trial_fixed_notice_at: 'Notice of 1st fixed/warned issued' + trial_fixed_at: '1st fixed/warned trial' + trial_cracked_at_third: + default: Case cracked in + hardship: If the case cracked today, which third would it be? + fields: + case_number: "Case number" + case_stage: *case_stage + case_type: "Case type" + main_hearing_date: "Main hearing date" + summary: + header: Case Details + answer_yes: *global_yes + answer_no: *global_no + trial_detail_fields: + first_day_of_trial: 'First day of trial' + estimated_trial_length: 'Estimated trial length' + actual_trial_length: *actual_trial_length + trial_concluded_at: 'Trial concluded on' + retrial_detail_fields: + retrial_started_at: 'First day of retrial' + retrial_estimated_length: 'Estimated retrial length' + retrial_actual_length: 'Actual retrial length' + retrial_concluded_at: 'Retrial concluded on' + retrial_reduction: 'Apply reduced rate to retrial?' + defendants: + summary: + answer_no: *global_no + answer_yes: *global_yes + common: + defendant_index: Defendant %{index} + fields: + case_number: "Case Number" + trial_detail_fields: + first_day_of_trial: 'First day of trial' + retrial_detail_fields: + retrial_started_at: 'First day of retrial' + retrial_reduction: 'Apply reduced rate to retrial?' + case_concluded_date: + case_concluded_at: 'Date case concluded' mileage_rate: Cost per mile expense: Expense %{index} expenses: caption: &expenses_caption 'Expenses: A detailed list by Type including amount, distance and location where applicable' - travel_expense_additional_information: Additional information travel_expenses: Travel expenses travel_details: Travel details + expenses: + travel_expense_additional_information: Additional information + travel_expenses: Travel expenses index: calculated_distance: Calculated distance caption: *expenses_caption @@ -2231,6 +2278,9 @@ en: net_amount: *net_amount reason: Reason for travel vat: *vat_amount + summary: + additional_information: Additional information + caption: 'Expenses: This section contains details of all expenses that have been claimed.' fee: Fee fee_index: Fee %{index} fees: @@ -2278,6 +2328,8 @@ en: net_amount: *net_amount vat_amount: *vat_amount total: "Total" + summary: + caption: 'Disbursements: This section contains details of all disbursements that have been claimed.' warrant_fee: date_issued: "Warrant issued" date_executed: "Warrant executed" diff --git a/spec/views/external_users/claims/case_details/_summary.html.haml_spec.rb b/spec/views/case_workers/claims/case_details/_summary.html.haml_spec.rb similarity index 98% rename from spec/views/external_users/claims/case_details/_summary.html.haml_spec.rb rename to spec/views/case_workers/claims/case_details/_summary.html.haml_spec.rb index bf0ec17516..2402deab2e 100644 --- a/spec/views/external_users/claims/case_details/_summary.html.haml_spec.rb +++ b/spec/views/case_workers/claims/case_details/_summary.html.haml_spec.rb @@ -22,8 +22,8 @@ end end -RSpec.describe 'external_users/claims/case_details/summary.html.haml' do - subject(:summary) { 'external_users/claims/case_details/summary' } +RSpec.describe 'shared/summary/case_details/summary.html.haml' do + subject(:summary) { 'shared/summary/case_details/summary' } let(:page) { Capybara::Node::Simple.new(rendered) } let(:date_format) { '%d/%m/%Y' }