<p class="govuk-body">The following groups of cells might have conflicting data. Check the answers and fix any incorrect data.<br><br>If the answers are correct, fix the critical errors and reupload the file. You'll need to confirm that the following data is correct when the file only contains potential errors.</p>
<p class="govuk-body">The following groups of cells might have conflicting data. Check the answers and fix any incorrect data.<br><br>If the answers are correct, fix the critical errors and reupload the file. You'll need to confirm that the following data is correct when the file only contains potential errors.</p>
<%= govuk_table do |table| %>
<%= govuk_table(html_attributes: { class: "no-bottom-border" }) do |table| %>
<%= table.with_head do |head| %>
<%= table.with_head do |head| %>
<% head.with_row do |row| %>
<% head.with_row do |row| %>
<% row.with_cell(header: true, text: "Cell") %>
<% row.with_cell(header: true, text: "Cell") %>
@ -50,16 +50,16 @@
<% end %>
<% end %>
<%= table.with_body do |body| %>
<%= table.with_body do |body| %>
<% potential_errors.group_by(&:error).each do |error_message, errors| %>
<% potential_errors.group_by(&:error).each_with_index do |(error_message, errors), group_index| %>
flash[:notice]="The #{@collection_resource.log_type}#{text_year_range_format(@collection_resource.year)}#{@collection_resource.short_display_name.downcase} has been updated."
"The #{@collection_resource.log_type}#{text_year_range_format(@collection_resource.year)}#{@collection_resource.short_display_name} is now available to users."
else
"The #{@collection_resource.log_type}#{text_year_range_format(@collection_resource.year)}#{@collection_resource.short_display_name} has been uploaded."
flash[:notice]="The #{@collection_resource.log_type}#{text_year_range_format(@collection_resource.year)}#{@collection_resource.short_display_name.downcase} has been deleted."
hint: { text: safe_join(["This will be used in the download link on the homepage. Do not include the log type or collection year.",
content_tag(:br),
"For example, if you enter “bulk upload change log”, the download link will say “Download the #{@collection_resource.log_type} bulk upload change log (#{text_year_range_format(@collection_resource.year)})”."]) } %>
<h1 class="govuk-heading-l">Add a new collection resource</h1>
<p class="govuk-body">
This file will be available for all users to download.
</p>
<%= f.govuk_file_field :file,
label: { text: "Upload file", size: "m" } %>
<%= f.govuk_text_field :short_display_name,
label: { text: "Resource type", size: "m" },
hint: { text: safe_join(["This will be used in the download link on the homepage. Do not include the log type or collection year.",
content_tag(:br),
"For example, if you enter “bulk upload change log”, the download link will say “Download the #{@collection_resource.log_type} bulk upload change log (#{text_year_range_format(@collection_resource.year)})”."]) } %>
error_uploading:There was an error uploading this file.
error_uploading:There was an error uploading this file.
blank:Select which file to upload.
blank:Select which file to upload.
above_100_mb:The file is above 100MB.
above_100_mb:File must be 100MB or less.
must_be_pdf:The paper form must be a PDF.
must_be_pdf:The paper form must be a PDF.
must_be_xlsx:The %{resource} must be a Microsoft Excel file.
must_be_xlsx:The %{resource} must be a Microsoft Excel file.
@ -212,9 +212,12 @@ en:
file:
file:
error_uploading:There was an error uploading this file.
error_uploading:There was an error uploading this file.
blank:Select which file to upload.
blank:Select which file to upload.
above_100_mb:The file is above 100MB.
above_100_mb:File must be 100MB or less.
must_be_pdf:The paper form must be a PDF.
must_be_pdf:The paper form must be a PDF.
must_be_xlsx:The %{resource} must be a Microsoft Excel file.
must_be_xlsx:The %{resource} must be a Microsoft Excel file.
short_display_name:
blank:"You must answer resource type."
notification:
notification:
logs_deleted:
logs_deleted:
one:"%{count} log has been deleted."
one:"%{count} log has been deleted."
@ -281,7 +284,7 @@ en:
intermediate_rent_product_name:
intermediate_rent_product_name:
blank:"Enter name of other intermediate rent product."
blank:"Enter name of other intermediate rent product."
saledate:
saledate:
year_not_two_digits:"Sale completion year must be 2 digits."
year_not_two_or_four_digits:"Sale completion year must be 2 or 4 digits."
type:
type:
percentage_bought_must_be_at_least_threshold:"The minimum increase in equity while staircasing is %{threshold}% for this shared ownership type."
percentage_bought_must_be_at_least_threshold:"The minimum increase in equity while staircasing is %{threshold}% for this shared ownership type."
@ -294,7 +297,7 @@ en:
before_scheme_end_date:"The tenancy start date must be before the end date for this supported housing scheme."
before_scheme_end_date:"The tenancy start date must be before the end date for this supported housing scheme."
after_void_date:"Enter a tenancy start date that is after the void date."
after_void_date:"Enter a tenancy start date that is after the void date."
after_major_repair_date:"Enter a tenancy start date that is after the major repair date."
after_major_repair_date:"Enter a tenancy start date that is after the major repair date."
year_not_two_digits:"Tenancy start year must be 2 digits."
year_not_two_or_four_digits:"Tenancy start year must be 2 or 4 digits."
ten_years_after_void_date:"Enter a tenancy start date that is no more than 10 years after the void date."
ten_years_after_void_date:"Enter a tenancy start date that is no more than 10 years after the void date."
ten_years_after_mrc_date:"Enter a tenancy start date that is no more than 10 years after the major repairs completion date."
ten_years_after_mrc_date:"Enter a tenancy start date that is no more than 10 years after the major repairs completion date."
invalid_merged_organisations_start_date:
invalid_merged_organisations_start_date:
@ -382,12 +385,6 @@ en:
one_bedroom_bedsit:"A bedsit can only have one bedroom."
one_bedroom_bedsit:"A bedsit can only have one bedroom."
one_seven_bedroom_shared:"A shared house must have 1 to 7 bedrooms."
one_seven_bedroom_shared:"A shared house must have 1 to 7 bedrooms."
one_three_bedroom_single_tenant_shared:"A shared house with fewer than two tenants must have 1 to 3 bedrooms."
one_three_bedroom_single_tenant_shared:"A shared house with fewer than two tenants must have 1 to 3 bedrooms."
beds:
bedsits_have_max_one_bedroom:"Number of bedrooms must be 1 if the property is a bedsit."
proptype:
bedsits_have_max_one_bedroom:"Answer cannot be 'Bedsit' if the property has 2 or more bedrooms."
postcode:
must_match_previous:"%{buyer_possessive} last accommodation and discounted ownership postcodes must match."
financial:
financial:
tshortfall:
tshortfall:
@ -501,11 +498,8 @@ en:
retired_female:"A female tenant who is retired must be 60 or over."
retired_female:"A female tenant who is retired must be 60 or over."
retired_over_70:"Answer cannot be over 70 as person %{person_num} has economic status that is not ‘retired’."
retired_over_70:"Answer cannot be over 70 as person %{person_num} has economic status that is not ‘retired’."
child_under_16_relat_lettings:"Answer cannot be under 16 as person %{person_num}'s relationship to the lead tenant is ‘partner’."
child_under_16_relat_lettings:"Answer cannot be under 16 as person %{person_num}'s relationship to the lead tenant is ‘partner’."
child_under_16_relat_sales:"Answer cannot be under 16 as person %{person_num}'s relationship to buyer 1 is ‘partner’."
child_under_16_ecstat:"Answer cannot be under 16 as person %{person_num}’s working situation is not ‘child under 16’, ‘other’ or ‘prefers not to say’."
child_under_16_ecstat:"Answer cannot be under 16 as person %{person_num}’s working situation is not ‘child under 16’, ‘other’ or ‘prefers not to say’."
child_over_16:"Answer cannot be over 16 as person’s %{person_num} working situation is ‘child under 16‘."
child_over_16:"Answer cannot be over 16 as person’s %{person_num} working situation is ‘child under 16‘."
child_over_20:"Answer cannot be 20 or over as the relationship is ‘child’."
child_12_years_younger:"A child must be at least 12 years younger than their parent."
not_student_16_19:"Answer cannot be between 16 and 19 as person %{person_num} is a child of the lead tenant but is not a full-time student."
not_student_16_19:"Answer cannot be between 16 and 19 as person %{person_num} is a child of the lead tenant but is not a full-time student."
student_16_19:
student_16_19:
cannot_be_16_19:
cannot_be_16_19:
@ -528,12 +522,8 @@ en:
retired_female:"Answer cannot be ‘retired’ as the female tenant is under 60."
retired_female:"Answer cannot be ‘retired’ as the female tenant is under 60."
not_child_16_19:
not_child_16_19:
cannot_be_student:"Person cannot be a student if they are aged 16-19 but are not a child."
cannot_be_student:"Person cannot be a student if they are aged 16-19 but are not a child."
buyer_cannot_be_child:"Buyer %{buyer_index} cannot have a working situation of child under 16."
buyer_cannot_be_over_16_and_child:"Buyer %{buyer_index}'s age cannot be 16 or over if their working situation is child under 16."
relat:
relat:
child_under_16_sales:"Answer cannot be ‘partner’ as you told us person %{person_num}'s age is under 16."
child_under_16_lettings:"Answer cannot be ‘partner’ as you told us person %{person_num}'s age is under 16."
child_under_16_lettings:"Answer cannot be ‘partner’ as you told us person %{person_num}'s age is under 16."
child_over_20:"Answer cannot be ‘child’ if the person's age is 20 or over."
one_partner:"Number of partners cannot be greater than 1."
one_partner:"Number of partners cannot be greater than 1."
not_student_16_19:"Answer cannot be ‘child’ as you told us the person %{person_num} is between 16 and 19 and is not a full-time student."
not_student_16_19:"Answer cannot be ‘child’ as you told us the person %{person_num} is between 16 and 19 and is not a full-time student."
student_16_19:
student_16_19:
@ -556,7 +546,6 @@ en:
internal_transfer:"Answer cannot be %{prevten} as this tenancy is an internal transfer."
internal_transfer:"Answer cannot be %{prevten} as this tenancy is an internal transfer."
la_general_needs:
la_general_needs:
internal_transfer:"Answer cannot be a fixed-term or lifetime local authority general needs tenancy as it’s an internal transfer and a private registered provider is on the tenancy agreement."
internal_transfer:"Answer cannot be a fixed-term or lifetime local authority general needs tenancy as it’s an internal transfer and a private registered provider is on the tenancy agreement."
invalid_for_discounted_sale:"Buyer 1’s previous tenure should be “local authority tenant” or “private registered provider or housing association tenant” for discounted sales."
referral:
referral:
secure_tenancy:"Answer must be internal transfer as this is a secure tenancy."
secure_tenancy:"Answer must be internal transfer as this is a secure tenancy."
rsnvac_non_temp:"Answer cannot be this source of referral as this is a re-let to tenant who occupied the same property as temporary accommodation."
rsnvac_non_temp:"Answer cannot be this source of referral as this is a re-let to tenant who occupied the same property as temporary accommodation."
@ -596,9 +585,6 @@ en:
no_choices:"You cannot answer this question as you told us nobody in the household has a physical or mental health condition (or other illness) expected to last 12 months or more."
no_choices:"You cannot answer this question as you told us nobody in the household has a physical or mental health condition (or other illness) expected to last 12 months or more."
postcode:
postcode:
discounted_ownership:"Last settled accommodation and discounted ownership property postcodes must match."
discounted_ownership:"Last settled accommodation and discounted ownership property postcodes must match."
buylivein:
buyers_will_live_in_property_values_inconsistent_setup:"You have already told us that both buyer 1 and buyer 2 will not live in the property."
buyers_will_live_in_property_values_inconsistent:"You have already told us that the buyers will live in the property. Either buyer 1 or buyer 2 must live in the property."
buyers_will_live_in_property_values_inconsistent:"You have already told us that both buyer 1 and buyer 2 will not live in the property."
buy1livein:
buyers_will_live_in_property_values_inconsistent:"You have already told us that the buyers will live in the property. Either buyer 1 or buyer 2 must live in the property."
buy2livein:
buyers_will_live_in_property_values_inconsistent:"You have already told us that the buyers will live in the property. Either buyer 1 or buyer 2 must live in the property."
ownershipsch:
prevten_invalid_for_discounted_sale:"Buyer 1’s previous tenure should be “local authority tenant” or “private registered provider or housing association tenant” for discounted sales."
prevten:
prevten_invalid_for_discounted_sale:"Buyer 1’s previous tenure should be “local authority tenant” or “private registered provider or housing association tenant” for discounted sales."
age1:
child_12_years_younger:"A child must be at least 12 years younger than their parent."
ecstat1:
buyer_cannot_be_child:"Buyer 1 cannot have a working situation of child under 16."
ecstat2:
buyer_cannot_be_child:"Buyer 2 cannot have a working situation of child under 16."
age:
child_12_years_younger:"A child must be at least 12 years younger than their parent."
child_under_16:"Answer cannot be under 16 as person %{person_num}'s relationship to buyer 1 is ‘partner’."
child_under_16_ecstat:"Answer cannot be under 16 as person %{person_num}’s working situation is not ‘child under 16’, ‘other’ or ‘prefers not to say’."
child_over_16:"Answer cannot be over 16 as person’s %{person_num} working situation is ‘child under 16‘."
child_over_20:"Answer cannot be 20 or over as the relationship is ‘child’."
student_16_19:
cannot_be_16_19:
child_not_student:"Person cannot be aged 16-19 if they have relationship ‘child’ but are not a student."
must_be_16_19:"Person must be aged 16-19 if they are a student and have relationship ‘child’."
relat:
one_partner:"Number of partners cannot be greater than 1."
child_12_years_younger:"A child must be at least 12 years younger than their parent."
child_under_16:"Answer cannot be ‘partner’ as you told us person %{person_num}'s age is under 16."
child_over_20:"Answer cannot be ‘child’ if the person's age is 20 or over."
student_16_19:
cannot_be_child:
student_not_16_19:"Answer cannot be ‘child’ if the person is a student but not aged 16-19."
16_19_not_student:"Answer cannot be ‘child’ if the person is aged 16-19 but not a student."
ecstat:
child_under_16:"Person %{person_num}’s working situation must be ‘child under 16’, ‘other’ or ‘prefers not to say’ as you told us they’re under 16."
child_over_16:"Answer cannot be ‘child under 16’ as you told us the person %{person_num} is older than 16."
student_16_19:
must_be_student:"Person must be a student if they are aged 16-19 and have relationship ‘child’."
cannot_be_student:
child_not_16_19:"Person cannot be a student if they are not aged 16-19 but have relationship ‘child’."
buyer_cannot_be_over_16_and_child:"Buyer %{buyer_index}'s age cannot be 16 or over if their working situation is child under 16."
@ -94,9 +94,9 @@ RSpec.describe CollectionResourcesHelper do
context"and next year resources were manually released"do
context"and next year resources were manually released"do
beforedo
beforedo
CollectionResource.create!(year:2025,resource_type:"paper_form",display_name:"lettings log for tenants (2025 to 2026)",download_filename:"file.pdf",mandatory:true,released_to_user:true)
create(:collection_resource,year:2025,resource_type:"paper_form",display_name:"lettings log for tenants (2025 to 2026)",download_filename:"file.pdf",mandatory:true,released_to_user:true)
CollectionResource.create!(year:2025,resource_type:"bulk_upload_template",display_name:"bulk upload template (2025 to 2026)",download_filename:"file.xlsx",mandatory:true,released_to_user:true)
create(:collection_resource,year:2025,resource_type:"bulk_upload_template",display_name:"bulk upload template (2025 to 2026)",download_filename:"file.xlsx",mandatory:true,released_to_user:true)
CollectionResource.create!(year:2025,resource_type:"bulk_upload_specification",display_name:"sales log for tenants (2025 to 2026)",download_filename:"file.xlsx",mandatory:true,released_to_user:true)
create(:collection_resource,year:2025,resource_type:"bulk_upload_specification",display_name:"sales log for tenants (2025 to 2026)",download_filename:"file.xlsx",mandatory:true,released_to_user:true)
end
end
it"reutrns current and next years"do
it"reutrns current and next years"do
@ -199,9 +199,9 @@ RSpec.describe CollectionResourcesHelper do
context"and the resources have been manually released"do
context"and the resources have been manually released"do
beforedo
beforedo
CollectionResource.create!(year:2025,resource_type:"paper_form",display_name:"lettings log for tenants (2025 to 2026)",download_filename:"file.pdf",mandatory:true,released_to_user:true)
create(:collection_resource,year:2025,resource_type:"paper_form",display_name:"lettings log for tenants (2025 to 2026)",download_filename:"file.pdf",mandatory:true,released_to_user:true)
CollectionResource.create!(year:2025,resource_type:"bulk_upload_template",display_name:"bulk upload template (2025 to 2026)",download_filename:"file.xlsx",mandatory:true,released_to_user:true)
create(:collection_resource,year:2025,resource_type:"bulk_upload_template",display_name:"bulk upload template (2025 to 2026)",download_filename:"file.xlsx",mandatory:true,released_to_user:true)
CollectionResource.create!(year:2025,resource_type:"bulk_upload_specification",display_name:"sales log for tenants (2025 to 2026)",download_filename:"file.xlsx",mandatory:true,released_to_user:true)
create(:collection_resource,year:2025,resource_type:"bulk_upload_specification",display_name:"sales log for tenants (2025 to 2026)",download_filename:"file.xlsx",mandatory:true,released_to_user:true)