diff --git a/app/controllers/bulk_upload_lettings_logs_controller.rb b/app/controllers/bulk_upload_lettings_logs_controller.rb index ec5975432..40f898012 100644 --- a/app/controllers/bulk_upload_lettings_logs_controller.rb +++ b/app/controllers/bulk_upload_lettings_logs_controller.rb @@ -21,11 +21,6 @@ class BulkUploadLettingsLogsController < ApplicationController end end - def guidance - @form = Forms::BulkUploadLettings::PrepareYourFile.new - render "bulk_upload_shared/guidance" - end - private def current_year @@ -44,6 +39,8 @@ private Forms::BulkUploadLettings::Year.new(form_params) when "prepare-your-file" Forms::BulkUploadLettings::PrepareYourFile.new(form_params) + when "guidance" + Forms::BulkUploadLettings::Guidance.new(form_params) when "needstype" Forms::BulkUploadLettings::Needstype.new(form_params) when "upload-your-file" diff --git a/app/controllers/bulk_upload_sales_logs_controller.rb b/app/controllers/bulk_upload_sales_logs_controller.rb index 2b3432399..85be7e96d 100644 --- a/app/controllers/bulk_upload_sales_logs_controller.rb +++ b/app/controllers/bulk_upload_sales_logs_controller.rb @@ -21,11 +21,6 @@ class BulkUploadSalesLogsController < ApplicationController end end - def guidance - @form = Forms::BulkUploadSales::PrepareYourFile.new - render "bulk_upload_shared/guidance" - end - private def current_year @@ -42,6 +37,8 @@ private Forms::BulkUploadSales::Year.new(form_params) when "prepare-your-file" Forms::BulkUploadSales::PrepareYourFile.new(form_params) + when "guidance" + Forms::BulkUploadSales::Guidance.new(form_params) when "upload-your-file" Forms::BulkUploadSales::UploadYourFile.new(form_params.merge(current_user:)) when "checking-file" diff --git a/app/models/forms/bulk_upload_lettings/guidance.rb b/app/models/forms/bulk_upload_lettings/guidance.rb new file mode 100644 index 000000000..2610ed62d --- /dev/null +++ b/app/models/forms/bulk_upload_lettings/guidance.rb @@ -0,0 +1,27 @@ +module Forms + module BulkUploadLettings + class Guidance + include ActiveModel::Model + include ActiveModel::Attributes + include Rails.application.routes.url_helpers + + attribute :year, :integer + + def view_path + "bulk_upload_shared/guidance" + end + + def back_path + bulk_upload_lettings_log_path(id: "prepare-your-file", form: { year: }) + end + + def template_path + Forms::BulkUploadLettings::PrepareYourFile.new(year:).template_path + end + + def specification_path + Forms::BulkUploadLettings::PrepareYourFile.new(year:).specification_path + end + end + end +end diff --git a/app/models/forms/bulk_upload_lettings/prepare_your_file.rb b/app/models/forms/bulk_upload_lettings/prepare_your_file.rb index 68b9dd5c6..6db68e49d 100644 --- a/app/models/forms/bulk_upload_lettings/prepare_your_file.rb +++ b/app/models/forms/bulk_upload_lettings/prepare_your_file.rb @@ -26,11 +26,21 @@ module Forms end def template_path - "/files/bulk-upload-lettings-template-v1.xlsx" + case year + when 2022 + "/files/bulk-upload-lettings-template-2022-23.xlsx" + when 2023 + "/files/bulk-upload-lettings-template-2023-24.xlsx" + end end def specification_path - "/files/bulk-upload-lettings-specification-2022-23.xlsx" + case year + when 2022 + "/files/bulk-upload-lettings-specification-2022-23.xlsx" + when 2023 + "/files/bulk-upload-lettings-specification-2023-24.xlsx" + end end def year_combo diff --git a/app/models/forms/bulk_upload_sales/guidance.rb b/app/models/forms/bulk_upload_sales/guidance.rb new file mode 100644 index 000000000..869ce8be2 --- /dev/null +++ b/app/models/forms/bulk_upload_sales/guidance.rb @@ -0,0 +1,27 @@ +module Forms + module BulkUploadSales + class Guidance + include ActiveModel::Model + include ActiveModel::Attributes + include Rails.application.routes.url_helpers + + attribute :year, :integer + + def view_path + "bulk_upload_shared/guidance" + end + + def back_path + bulk_upload_sales_log_path(id: "prepare-your-file", form: { year: }) + end + + def template_path + Forms::BulkUploadSales::PrepareYourFile.new(year:).template_path + end + + def specification_path + Forms::BulkUploadSales::PrepareYourFile.new(year:).specification_path + end + end + end +end diff --git a/app/models/forms/bulk_upload_sales/prepare_your_file.rb b/app/models/forms/bulk_upload_sales/prepare_your_file.rb index 52d70a85c..cdf2cf455 100644 --- a/app/models/forms/bulk_upload_sales/prepare_your_file.rb +++ b/app/models/forms/bulk_upload_sales/prepare_your_file.rb @@ -24,11 +24,21 @@ module Forms end def template_path - "/files/bulk-upload-sales-template-v1.xlsx" + case year + when 2022 + "/files/bulk-upload-sales-template-2022-23.xlsx" + when 2023 + "/files/bulk-upload-sales-template-2023-24.xlsx" + end end def specification_path - "/files/bulk-upload-sales-specification-2022-23.xlsx" + case year + when 2022 + "/files/bulk-upload-sales-specification-2022-23.xlsx" + when 2023 + "/files/bulk-upload-sales-specification-2023-24.xlsx" + end end def year_combo diff --git a/app/views/bulk_upload_lettings_logs/forms/prepare_your_file.html.erb b/app/views/bulk_upload_lettings_logs/forms/prepare_your_file.html.erb index e48a190f9..529077e07 100644 --- a/app/views/bulk_upload_lettings_logs/forms/prepare_your_file.html.erb +++ b/app/views/bulk_upload_lettings_logs/forms/prepare_your_file.html.erb @@ -13,14 +13,14 @@
- We could not create logs from your bulk upload. Below is a list of everything that you need to fix your spreadsheet. You can download the specification to help you fix the cells in your CSV file. + We could not create logs from your bulk upload. Below is a list of everything that you need to fix your spreadsheet. You can download the <%= govuk_link_to "specification", Forms::BulkUploadLettings::PrepareYourFile.new(year: @bulk_upload.year).specification_path, target: "_blank" %> to help you fix the cells in your CSV file.
diff --git a/app/views/bulk_upload_sales_logs/forms/prepare_your_file.html.erb b/app/views/bulk_upload_sales_logs/forms/prepare_your_file.html.erb index d2a6bd70c..9f59bf509 100644 --- a/app/views/bulk_upload_sales_logs/forms/prepare_your_file.html.erb +++ b/app/views/bulk_upload_sales_logs/forms/prepare_your_file.html.erb @@ -13,13 +13,13 @@
It can take HMS providers a while to update these per new collection year, so you may have to wait for updates to export, or adjust your data manually post-export.
<% end %> <%= govuk_details(summary_text: "My organisation does not have a CMS") do %> -Your organisation’s IT team may be able to export CSV data for you - <%= govuk_link_to "find out more about data specification", @form.specification_path %>. This document outlines:
+Your organisation’s IT team may be able to export CSV data for you - <%= govuk_link_to "find out more about data specification", @form.specification_path, target: "_blank" %>. This document outlines:
There is no step-by-step bulk upload guide like there is with single log upload. However, you can download <%= govuk_link_to "our template", @form.template_path %>, which you can copy-paste data into from your systems column-by-column. You can also view a post-upload report showing any data errors, and our <%= govuk_link_to "data specification", @form.specification_path %> can help fix these.
+There is no step-by-step bulk upload guide like there is with single log upload. However, you can download <%= govuk_link_to "our template", @form.template_path %>, which you can copy-paste data into from your systems column-by-column. You can also view a post-upload report showing any data errors, and our <%= govuk_link_to "data specification", @form.specification_path, target: "_blank" %> can help fix these.
If you still need support mapping data in the way we need, DLUHC’s helpdesk can help. If your data is across multiple systems, or is hard to export as a single file in the correct format, you could try different exports, or copy-pasting data by hand.