diff --git a/HISTORY.rst b/HISTORY.rst index 10852b5cf5..42662a967c 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -99,6 +99,7 @@ * Backport list facet menu code. * Backport sidebar code. * CSS updates to maximize usable width. +* Improve partial navigation error messages and display. 3.1.11 (2019-04-XX) =================== diff --git a/docs/releases/3.2.rst b/docs/releases/3.2.rst index 69e96932b8..aa592e6cf3 100644 --- a/docs/releases/3.2.rst +++ b/docs/releases/3.2.rst @@ -131,6 +131,7 @@ Other changes * Backport list facet menu code. * Backport sidebar code. * CSS updates to maximize usable width. +* Improve partial navigation error messages and display. Removals -------- diff --git a/mayan/apps/appearance/static/appearance/js/partial_navigation.js b/mayan/apps/appearance/static/appearance/js/partial_navigation.js index 422d000f0c..0c5fcd5c04 100644 --- a/mayan/apps/appearance/static/appearance/js/partial_navigation.js +++ b/mayan/apps/appearance/static/appearance/js/partial_navigation.js @@ -160,7 +160,25 @@ class PartialNavigation { */ if (djangoDEBUG) { - $('#ajax-content').html('
' + jqXHR.statusText + '
'); + var errorMessage = null; + + if (jqXHR.status != 0) { + errorMessage = jqXHR.responseText || jqXHR.statusText; + } else { + errorMessage = 'Server communication error.'; + } + + $('#ajax-content').html( + ' \ +
\ +
\ + \ +
' +  errorMessage +' \
+                    
\ +
\ +
\ + ' + ); } else { if (jqXHR.status == 0) { $('#modal-server-error .modal-body').html($('#template-error').html()); @@ -171,6 +189,7 @@ class PartialNavigation { } } + setLocation (newLocation, pushState) { /* * Method to update the browsers history and trigger a page update.