From 25f338cfc58d473b9cc9bba501129d67b92ba170 Mon Sep 17 00:00:00 2001 From: Georg Lehner Date: Sat, 11 May 2024 16:41:01 +0200 Subject: [PATCH 1/2] Pop up a nice error message when an AJAX request fails. --- helpdesk/templates/helpdesk/ticket_list.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/helpdesk/templates/helpdesk/ticket_list.html b/helpdesk/templates/helpdesk/ticket_list.html index b8aa32f7..6e7efdd0 100644 --- a/helpdesk/templates/helpdesk/ticket_list.html +++ b/helpdesk/templates/helpdesk/ticket_list.html @@ -341,6 +341,9 @@ $(document).ready(function () { // Ticket DataTable Initialization + $.fn.dataTable.ext.errMode = function(settings, helpPage, message) { + alert("{% trans 'Error fetching tickets occured, please contact the system administrators of this server' %}") + }; $('#ticketTable').DataTable({ language: { "emptyTable": "{% trans 'No Tickets Match Your Selection' %}" From 95755125fb4b2c86909bc99edbf5ce5b9351ecb0 Mon Sep 17 00:00:00 2001 From: Georg Lehner Date: Tue, 14 May 2024 21:46:18 +0200 Subject: [PATCH 2/2] Add datatables error message to error pop up --- helpdesk/templates/helpdesk/ticket_list.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helpdesk/templates/helpdesk/ticket_list.html b/helpdesk/templates/helpdesk/ticket_list.html index 6e7efdd0..c511d5f2 100644 --- a/helpdesk/templates/helpdesk/ticket_list.html +++ b/helpdesk/templates/helpdesk/ticket_list.html @@ -342,7 +342,7 @@ $(document).ready(function () { // Ticket DataTable Initialization $.fn.dataTable.ext.errMode = function(settings, helpPage, message) { - alert("{% trans 'Error fetching tickets occured, please contact the system administrators of this server' %}") + alert("{% trans 'Error fetching tickets occured, please contact the system administrators of this server providing the message below:\n ' %}" + message) }; $('#ticketTable').DataTable({ language: {