mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-18 21:44:11 -04:00
Merge branch 'master' of https://github.com/alphagov/notifications-admin into vb-platform-admin-admin
This commit is contained in:
30
app/assets/javascripts/preventDuplicateFormSubmissions.js
Normal file
30
app/assets/javascripts/preventDuplicateFormSubmissions.js
Normal file
@@ -0,0 +1,30 @@
|
||||
(function() {
|
||||
|
||||
"use strict";
|
||||
|
||||
let disableSubmitButtons = function(event) {
|
||||
|
||||
$submitButton = $(this).find(':submit');
|
||||
|
||||
if ($submitButton.data('clicked') == 'true') {
|
||||
|
||||
event.preventDefault();
|
||||
|
||||
} else {
|
||||
|
||||
$submitButton.data('clicked', 'true');
|
||||
setTimeout(renableSubmitButton($submitButton), 1500);
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
let renableSubmitButton = $submitButton => () => {
|
||||
|
||||
$submitButton.data('clicked', '');
|
||||
|
||||
};
|
||||
|
||||
$('form').on('submit', disableSubmitButtons);
|
||||
|
||||
})();
|
||||
@@ -180,6 +180,7 @@ details summary {
|
||||
th,
|
||||
td {
|
||||
@include core-19;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
thead {
|
||||
|
||||
@@ -459,15 +459,17 @@ def check_messages(service_id, template_type, upload_id):
|
||||
data['recipients'].too_many_rows or
|
||||
not data['count_of_recipients'] or
|
||||
not data['recipients'].has_recipient_columns or
|
||||
data['recipients'].missing_column_headers or
|
||||
data['trying_to_send_letters_in_trial_mode']
|
||||
data['recipients'].missing_column_headers
|
||||
):
|
||||
return render_template('views/check/column-errors.html', **data)
|
||||
|
||||
if data['row_errors']:
|
||||
return render_template('views/check/row-errors.html', **data)
|
||||
|
||||
if data['errors']:
|
||||
if (
|
||||
data['errors'] or
|
||||
data['trying_to_send_letters_in_trial_mode']
|
||||
):
|
||||
return render_template('views/check/column-errors.html', **data)
|
||||
|
||||
return render_template('views/check/ok.html', **data)
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
) }}
|
||||
{{ tick_cross(
|
||||
user.has_permissions(permissions=['manage_templates']),
|
||||
'Manage templates'
|
||||
'Add and edit templates'
|
||||
) }}
|
||||
{{ tick_cross(
|
||||
user.has_permissions(permissions=['manage_users', 'manage_settings']),
|
||||
@@ -94,7 +94,7 @@
|
||||
) }}
|
||||
{{ tick_cross(
|
||||
user.has_permissions(permissions=['manage_templates']),
|
||||
'Edit templates'
|
||||
'Add and edit templates'
|
||||
) }}
|
||||
{{ tick_cross(
|
||||
user.has_permissions(permissions=['manage_users', 'manage_settings']),
|
||||
|
||||
Reference in New Issue
Block a user