diff --git a/app/assets/javascripts/errorBanner.js b/app/assets/javascripts/errorBanner.js index 2efef7d95..c05c821ea 100644 --- a/app/assets/javascripts/errorBanner.js +++ b/app/assets/javascripts/errorBanner.js @@ -12,6 +12,5 @@ hideBanner: () => $('.banner-dangerous').addClass('display-none'), showBanner: () => $('.banner-dangerous') .removeClass('display-none') - .trigger('focus'), }; })(window); diff --git a/app/assets/javascripts/fileUpload.js b/app/assets/javascripts/fileUpload.js index 9ef72d531..ea6c7ac62 100644 --- a/app/assets/javascripts/fileUpload.js +++ b/app/assets/javascripts/fileUpload.js @@ -15,9 +15,9 @@ // The label gets styled like a button and is used to hide the native file upload control. This is so that // users see a button that looks like the others on the site. -// - this.$form.find('label.file-upload-button').addClass('usa-button margin-bottom-1'); + this.$form.find('label.file-upload-button').addClass('usa-button margin-bottom-1').attr( {role: 'button', tabindex: '0'} ); + // Clear the form if the user navigates back to the page $(window).on("pageshow", () => this.$form[0].reset()); diff --git a/app/assets/javascripts/main.js b/app/assets/javascripts/main.js index 144b2ba67..3cc17c20d 100644 --- a/app/assets/javascripts/main.js +++ b/app/assets/javascripts/main.js @@ -16,8 +16,6 @@ $(() => GOVUK.modules.start()); $(() => $('.error-message, .usa-error-message').eq(0).parent('label').next('input').trigger('focus')); -$(() => $('.banner-dangerous').eq(0).trigger('focus')); - $(() => $('.govuk-header__container').on('click', function() { $(this).css('border-color', '#005ea5'); })); diff --git a/app/templates/components/components/alert/template.njk b/app/templates/components/components/alert/template.njk index 85d40a785..d89405e64 100644 --- a/app/templates/components/components/alert/template.njk +++ b/app/templates/components/components/alert/template.njk @@ -11,7 +11,7 @@
- {{params.text}} + {{params.text | safe }}
- Text messages cannot be longer than {{ SMS_CHAR_COUNT_LIMIT }} characters. - Your message is {{ template.content_count }} characters. -
++ Text messages cannot be longer than {{ SMS_CHAR_COUNT_LIMIT }} characters. + Your message is {{ template.content_count }} characters. +
+- In trial mode you can only - send to yourself and members of your team -
++ In trial mode you can only + send to yourself and members of your team +
+- If you need to resend them, rename the file and upload it again. -
++ If you need to resend them, rename the file and upload it again. +
+- You can only send {{ current_service.message_limit|format_thousands }} messages per day - {%- if current_service.trial_mode %} - in trial mode - {%- endif -%} - . -
-{% if original_file_name %} -- {% if current_service.message_limit != remaining_messages %} +
+ You can only send {{ current_service.message_limit|format_thousands }} messages per day + {%- if current_service.trial_mode %} + in trial mode + {%- endif -%} + . +
+ {% if original_file_name %} ++ {% if current_service.message_limit != remaining_messages %} You can still send {{ remaining_messages|format_thousands }} messages today, but + {% endif %} + ‘{{ original_file_name }}’ contains + {{ count_of_recipients|recipient_count(template.template_type) }}. +
{% endif %} - ‘{{ original_file_name }}’ contains - {{ count_of_recipients|recipient_count(template.template_type) }}. - -{% endif %} ++
Notify can process up to {{ "{:,}".format(recipients.max_rows) }} rows at once. Your file has {{ "{:,}".format(recipients|length) }} rows. -
- - {% elif not count_of_recipients %} - -- It needs at least one row of data, and {{ recipients.missing_column_headers | sort() | formatted_list( - prefix='a column called', - prefix_plural='columns called' - ) }}. -
- {% else %} -- It needs at least one row of data. -
- {% endif %} - - {% elif not recipients.has_recipient_columns %} - -- Your file needs a column called ‘{{ first_recipient_column }}’. -
-- Right now it has {{ recipients.column_headers | formatted_list( - prefix='one column, called ', - prefix_plural='columns called ' - ) }}. -
- - {% elif recipients.duplicate_recipient_column_headers %} - -- We found more than one column called {{ ( - recipients.duplicate_recipient_column_headers - ) | formatted_list( - conjunction='or', - prefix='', - prefix_plural='' - ) }}. -
-- Delete or rename one of these columns and try again. -
- - {% elif recipients.missing_column_headers %} - -- Your file is missing {{ recipients.missing_column_headers | formatted_list( - conjunction='and', - prefix='a column called ', - prefix_plural='columns called ' - ) }}. -
- - {% elif sent_previously %} - - {% include "partials/check/sent-previously.html" %} - - {% elif not recipients.allowed_to_send_to %} - - {% with - count_of_recipients=count_of_recipients, - template_type_label=recipients.recipient_column_headers[0] - %} - {% include "partials/check/not-allowed-to-send-to.html" %} - {% endwith %} - - {% elif recipients.more_rows_than_can_send %} - - {% include "partials/check/too-many-messages.html" %} - - {% endif %} - - {% endcall %} + ++ It needs at least one row of data, and {{ recipients.missing_column_headers | sort() | formatted_list( + prefix='a column called', + prefix_plural='columns called' + ) }}. +
+ {% else %} ++ It needs at least one row of data. +
{% endif %}+ Your file needs a column called ‘{{ first_recipient_column }}’. +
++ Right now it has {{ recipients.column_headers | formatted_list( + prefix='one column, called ', + prefix_plural='columns called ' + ) }}. +
++ We found more than one column called {{ ( + recipients.duplicate_recipient_column_headers + ) | formatted_list( + conjunction='or', + prefix='', + prefix_plural='' + ) }}. +
++ Delete or rename one of these columns and try again. +
++ Your file is missing {{ recipients.missing_column_headers | formatted_list( + conjunction='and', + prefix='a column called ', + prefix_plural='columns called ' + ) }}. +
+- Only showing the first {{ count_of_displayed_recipients }} rows -
- {% elif count_of_displayed_recipients < count_of_recipients %} -- {% if row_errors and not recipients.missing_column_headers %} - Only showing the first {{ count_of_displayed_recipients }} rows with errors - {% else %} - Only showing the first {{ count_of_displayed_recipients }} rows - {% endif %} -
+{% if not request.args.from_test %} + +{% set column_headers = recipients._raw_column_headers if recipients.duplicate_recipient_column_headers else +recipients.column_headers %} + ++ Only showing the first {{ count_of_displayed_recipients }} rows +
+{% elif count_of_displayed_recipients < count_of_recipients %}+ {% if row_errors and not recipients.missing_column_headers %} + Only showing the first {{ count_of_displayed_recipients }} rows with errors + {% else %} + Only showing the first {{ count_of_displayed_recipients }} rows + {% endif %} +
{% elif row_errors and not recipients.missing_column_headers %} -- Only showing rows with errors -
++ Only showing rows with errors +
{% endif %}