diff --git a/app/controllers/bulk_upload_lettings_resume_controller.rb b/app/controllers/bulk_upload_lettings_resume_controller.rb index 4c21d39e2..85d697b43 100644 --- a/app/controllers/bulk_upload_lettings_resume_controller.rb +++ b/app/controllers/bulk_upload_lettings_resume_controller.rb @@ -23,6 +23,11 @@ class BulkUploadLettingsResumeController < ApplicationController end end + def pluralize_logs_and_errors_warning(log_count, error_count) + is_or_are = log_count == 1 ? 'is' : 'are' + need_or_needs = error_count == 1 ? 'needs' : 'needs' + "There #{is_or_are} #{view_context.pluralize(log_count, 'log')} in this bulk upload with #{view_context.pluralize(error_count, 'error')} that still #{need_or_needs} to be fixed after upload." + end private def form diff --git a/app/views/bulk_upload_lettings_resume/confirm.html.erb b/app/views/bulk_upload_lettings_resume/confirm.html.erb index af73b33e9..f83eadecb 100644 --- a/app/views/bulk_upload_lettings_resume/confirm.html.erb +++ b/app/views/bulk_upload_lettings_resume/confirm.html.erb @@ -7,7 +7,7 @@ Bulk upload for lettings (<%= @bulk_upload.year_combo %>)

Are you sure you want to upload all logs from this bulk upload?

-

There are <%= pluralize(@bulk_upload.logs.count, "log") %> in this bulk upload with <%= pluralize(@bulk_upload.bulk_upload_errors.count, "error") %> that still need to be fixed after upload.

+

<%= controller.pluralize_logs_and_errors_warning(@bulk_upload.logs.count, @bulk_upload.bulk_upload_errors.count)%>

<%= govuk_warning_text(icon_fallback_text: "Danger") do %> You can not delete logs once you create them