Browse Source

CLDC-3532: Make BU guidance back link depend on referrer

pull/2488/head
Rachael Booth 2 years ago
parent
commit
e68181df2b
  1. 2
      app/controllers/bulk_upload_lettings_logs_controller.rb
  2. 2
      app/controllers/bulk_upload_sales_logs_controller.rb
  3. 8
      app/models/forms/bulk_upload_lettings/guidance.rb
  4. 8
      app/models/forms/bulk_upload_sales/guidance.rb
  5. 2
      app/views/bulk_upload_lettings_logs/forms/prepare_your_file_2023.html.erb
  6. 2
      app/views/bulk_upload_lettings_logs/forms/prepare_your_file_2024.html.erb
  7. 2
      app/views/bulk_upload_sales_logs/forms/prepare_your_file_2023.html.erb
  8. 2
      app/views/bulk_upload_sales_logs/forms/prepare_your_file_2024.html.erb
  9. 2
      app/views/start/guidance.html.erb

2
app/controllers/bulk_upload_lettings_logs_controller.rb

@ -47,7 +47,7 @@ private
when "prepare-your-file"
Forms::BulkUploadLettings::PrepareYourFile.new(form_params)
when "guidance"
Forms::BulkUploadLettings::Guidance.new(form_params)
Forms::BulkUploadLettings::Guidance.new(form_params.merge(referrer: params[:referrer]))
when "needstype"
Forms::BulkUploadLettings::Needstype.new(form_params)
when "upload-your-file"

2
app/controllers/bulk_upload_sales_logs_controller.rb

@ -47,7 +47,7 @@ private
when "prepare-your-file"
Forms::BulkUploadSales::PrepareYourFile.new(form_params)
when "guidance"
Forms::BulkUploadSales::Guidance.new(form_params)
Forms::BulkUploadSales::Guidance.new(form_params.merge(referrer: params[:referrer]))
when "upload-your-file"
Forms::BulkUploadSales::UploadYourFile.new(form_params.merge(current_user:))
when "checking-file"

8
app/models/forms/bulk_upload_lettings/guidance.rb

@ -6,13 +6,19 @@ module Forms
include Rails.application.routes.url_helpers
attribute :year, :integer
attribute :referrer
def view_path
"bulk_upload_shared/guidance"
end
def back_path
bulk_upload_lettings_log_path(id: "prepare-your-file", form: { year: })
case referrer
when "prepare-your-file"
bulk_upload_lettings_log_path(id: "prepare-your-file", form: { year: })
else
guidance_path
end
end
def lettings_legacy_template_path

8
app/models/forms/bulk_upload_sales/guidance.rb

@ -6,13 +6,19 @@ module Forms
include Rails.application.routes.url_helpers
attribute :year, :integer
attribute :referrer
def view_path
"bulk_upload_shared/guidance"
end
def back_path
bulk_upload_sales_log_path(id: "prepare-your-file", form: { year: })
case referrer
when "prepare-your-file"
bulk_upload_sales_log_path(id: "prepare-your-file", form: { year: })
else
guidance_path
end
end
def lettings_legacy_template_path

2
app/views/bulk_upload_lettings_logs/forms/prepare_your_file_2023.html.erb

@ -9,7 +9,7 @@
<span class="govuk-caption-l">Upload lettings logs in bulk (<%= @form.year_combo %>)</span>
<h1 class="govuk-heading-l">Prepare your file</h1>
<p class="govuk-body govuk-!-margin-bottom-2"><%= govuk_link_to "Read the full guidance", bulk_upload_lettings_log_path(id: "guidance", form: { year: @form.year }) %> before you start if you have not used bulk upload before.</p>
<p class="govuk-body govuk-!-margin-bottom-2"><%= govuk_link_to "Read the full guidance", bulk_upload_lettings_log_path(id: "guidance", form: { year: @form.year }, referrer: "prepare-your-file") %> before you start if you have not used bulk upload before.</p>
<h2 class="govuk-heading-s">Download template</h2>

2
app/views/bulk_upload_lettings_logs/forms/prepare_your_file_2024.html.erb

@ -9,7 +9,7 @@
<span class="govuk-caption-l">Upload lettings logs in bulk (<%= @form.year_combo %>)</span>
<h1 class="govuk-heading-l">Prepare your file</h1>
<p class="govuk-body govuk-!-margin-bottom-2"><%= govuk_link_to "Read the full guidance", bulk_upload_lettings_log_path(id: "guidance", form: { year: @form.year }) %> before you start if you have not used bulk upload before.</p>
<p class="govuk-body govuk-!-margin-bottom-2"><%= govuk_link_to "Read the full guidance", bulk_upload_lettings_log_path(id: "guidance", form: { year: @form.year }, referrer: "prepare-your-file") %> before you start if you have not used bulk upload before.</p>
<h2 class="govuk-heading-s">Download template</h2>

2
app/views/bulk_upload_sales_logs/forms/prepare_your_file_2023.html.erb

@ -9,7 +9,7 @@
<span class="govuk-caption-l">Upload sales logs in bulk (<%= @form.year_combo %>)</span>
<h1 class="govuk-heading-l">Prepare your file</h1>
<p class="govuk-body govuk-!-margin-bottom-2"><%= govuk_link_to "Read the full guidance", bulk_upload_sales_log_path(id: "guidance", form: { year: @form.year }) %> before you start if you have not used bulk upload before.</p>
<p class="govuk-body govuk-!-margin-bottom-2"><%= govuk_link_to "Read the full guidance", bulk_upload_sales_log_path(id: "guidance", form: { year: @form.year }, referrer: "prepare-your-file") %> before you start if you have not used bulk upload before.</p>
<h2 class="govuk-heading-s">Download template</h2>

2
app/views/bulk_upload_sales_logs/forms/prepare_your_file_2024.html.erb

@ -9,7 +9,7 @@
<span class="govuk-caption-l">Upload sales logs in bulk (<%= @form.year_combo %>)</span>
<h1 class="govuk-heading-l">Prepare your file</h1>
<p class="govuk-body govuk-!-margin-bottom-2"><%= govuk_link_to "Read the full guidance", bulk_upload_sales_log_path(id: "guidance", form: { year: @form.year }) %> before you start if you have not used bulk upload before.</p>
<p class="govuk-body govuk-!-margin-bottom-2"><%= govuk_link_to "Read the full guidance", bulk_upload_sales_log_path(id: "guidance", form: { year: @form.year }, referrer: "prepare-your-file") %> before you start if you have not used bulk upload before.</p>
<h2 class="govuk-heading-s">Download template</h2>

2
app/views/start/guidance.html.erb

@ -9,7 +9,7 @@
<%= accordion.with_section(heading_text: "How to create logs", expanded: true) do %>
<p class="govuk-body">There are 2 ways to create logs on CORE.</p>
<p class="govuk-body">You can create logs one at a time by answering questions using the online form. Click the “Create a new log” button on the logs page to create logs this way.</p>
<p class="govuk-body">You can also create many logs at once by uploading a CSV file. This might be faster than creating logs individually if your organisation has its own database and a way to export the data. Click the “Upload logs in bulk” button on the logs page to create logs this way. For more information, <%= govuk_link_to "read the full guidance on bulk upload", bulk_upload_lettings_log_path(id: "guidance", form: { year: current_collection_start_year }) %>.</p>
<p class="govuk-body">You can also create many logs at once by uploading a CSV file. This might be faster than creating logs individually if your organisation has its own database and a way to export the data. Click the “Upload logs in bulk” button on the logs page to create logs this way. For more information, <%= govuk_link_to "read the full guidance on bulk upload", bulk_upload_lettings_log_path(id: "guidance", form: { year: current_collection_start_year }, referrer: "guidance") %>.</p>
<p class="govuk-body">Once you have created and completed a log, there is nothing more you need to do to submit the data.</p>
<% end %>

Loading…
Cancel
Save