Browse Source

Extract fix choice summary into method

pull/1777/head
Kat 3 years ago
parent
commit
60aa42c5ab
  1. 4
      app/helpers/logs_helper.rb
  2. 2
      app/views/bulk_upload_lettings_resume/fix_choice.html.erb
  3. 2
      app/views/bulk_upload_sales_resume/fix_choice.html.erb

4
app/helpers/logs_helper.rb

@ -52,4 +52,8 @@ module LogsHelper
"You will upload #{pluralize(bulk_upload.total_logs_count, 'log')}. There are unexpected answers in #{pluralize(bulk_upload.logs_with_errors_count, 'log')}, and #{pluralize(bulk_upload.bulk_upload_errors.count, 'unexpected answer')} in total. #{this_or_these_unexpected_answers} will be marked as correct." "You will upload #{pluralize(bulk_upload.total_logs_count, 'log')}. There are unexpected answers in #{pluralize(bulk_upload.logs_with_errors_count, 'log')}, and #{pluralize(bulk_upload.bulk_upload_errors.count, 'unexpected answer')} in total. #{this_or_these_unexpected_answers} will be marked as correct."
end end
def bulk_upload_error_summary(bulk_upload)
"You have tried to upload #{bulk_upload.total_logs_count ? pluralize(bulk_upload.total_logs_count, 'log') : 'logs'}. There are errors in #{pluralize(bulk_upload.logs_with_errors_count, 'log')}, and #{pluralize(bulk_upload.bulk_upload_errors.count, 'error')} in total."
end
end end

2
app/views/bulk_upload_lettings_resume/fix_choice.html.erb

@ -11,7 +11,7 @@
</div> </div>
<div class="govuk-body"> <div class="govuk-body">
You have tried to upload <%= @bulk_upload.total_logs_count ? pluralize(@bulk_upload.total_logs_count, "log") : "logs" %>. There are errors in <%= pluralize(@bulk_upload.logs_with_errors_count, "log") %>, and <%= pluralize(@bulk_upload.bulk_upload_errors.count, "error") %> in total. <%= bulk_upload_error_summary(@bulk_upload) %>
</div> </div>
<div class="govuk-body"> <div class="govuk-body">

2
app/views/bulk_upload_sales_resume/fix_choice.html.erb

@ -11,7 +11,7 @@
</div> </div>
<div class="govuk-body"> <div class="govuk-body">
You have tried to upload <%= @bulk_upload.total_logs_count ? pluralize(@bulk_upload.total_logs_count, "log") : "logs" %>. There are errors in <%= pluralize(@bulk_upload.logs_with_errors_count, "log") %>, and <%= pluralize(@bulk_upload.bulk_upload_errors.count, "error") %> in total. <%= bulk_upload_error_summary(@bulk_upload) %>
</div> </div>
<div class="govuk-body"> <div class="govuk-body">

Loading…
Cancel
Save