* Stub some collection resource requests
* Rebase changes
* Add upload new resource page
* Allow adding custom collection resources
* Display and validate additional resources
* Allow downloading additional collection resources
* Allow updating additional resources
* Display additional resources on the homepage
* Add delete link to additional resources
* Update hint text
* Update tests
* Allow unauthenticated users to donwload additional collection resources
* Add some changes to copy and styling
* Add content type to the files
* Validate short display name at the same time as file
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."
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)})”."]) } %>
@ -94,9 +94,9 @@ RSpec.describe CollectionResourcesHelper do
context"and next year resources were manually released"do
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)
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)
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:"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:"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_specification",display_name:"sales log for tenants (2025 to 2026)",download_filename:"file.xlsx",mandatory:true,released_to_user:true)
end
it"reutrns current and next years"do
@ -199,9 +199,9 @@ RSpec.describe CollectionResourcesHelper do
context"and the resources have been manually released"do
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)
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)
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:"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:"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_specification",display_name:"sales log for tenants (2025 to 2026)",download_filename:"file.xlsx",mandatory:true,released_to_user:true)