From e20218ac98592cae59b6fb12c9b060c63e5bf31e Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 3 Nov 2022 15:55:39 +0000 Subject: [PATCH] Bug 31028: Add feedback to the patron on submission This patch adds a success alert box when a patron submits a concern sucessfully. Signed-off-by: David Nind Signed-off-by: Helen Oliver --- .../bootstrap/en/includes/modals/catalog_concern.inc | 2 +- .../opac-tmpl/bootstrap/js/modals/catalog_concern.js | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/modals/catalog_concern.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/modals/catalog_concern.inc index 5b3d235249a..70c5c6dcb8f 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/modals/catalog_concern.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/modals/catalog_concern.inc @@ -41,7 +41,7 @@ diff --git a/koha-tmpl/opac-tmpl/bootstrap/js/modals/catalog_concern.js b/koha-tmpl/opac-tmpl/bootstrap/js/modals/catalog_concern.js index f5dab6aa132..817c9dd4a3a 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/js/modals/catalog_concern.js +++ b/koha-tmpl/opac-tmpl/bootstrap/js/modals/catalog_concern.js @@ -41,13 +41,23 @@ $(document).ready(function() { reporter_id: reporter_id, }; + $('#concern-submit-spinner').show(); + $('#addConfirm').prop('disabled', true); $.ajax({ url: '/api/v1/public/tickets', type: 'POST', data: JSON.stringify(params), success: function(data) { + $('#concern-submit-spinner').hide(); $('#addConcernModal').modal('hide'); $('#concern_body').val(''); + $('#concern_title').val(''); + $('h1:first').before('
Your concern was sucessfully submitted.
'); + }, + error: function(data) { + $('#concern-submit-spinner').hide(); + $('#addConcernModal').modal('hide'); + $('h1:first').before('
There was an error when submitting your concern, please contact a librarian.
'); }, contentType: "json" }); -- 2.39.1