This is an automated email from the ASF dual-hosted git repository.

humbedooh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail-foal.git

commit bd3cdbd477cb727d8887de536fa9e8aca38caa59
Author: Daniel Gruno <[email protected]>
AuthorDate: Thu Dec 30 00:08:42 2021 +0100

    Add postface option for adding custom text to 404s
---
 webui/js/config.js                      | 3 ++-
 webui/js/source/base-http-extensions.js | 3 +++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/webui/js/config.js b/webui/js/config.js
index 9d177f6..7900f20 100644
--- a/webui/js/config.js
+++ b/webui/js/config.js
@@ -46,7 +46,8 @@ const pm_config = {
     boring_lists: ['commits', 'cvs', 'site-cvs', 'security', 'notifications'], 
// we'd rather not default to these, noisy!
     favorite_list: 'dev', // if we have this, default to it
     long_tabs: false, // tab name format (long or short)
-    LOTS_OF_LISTS: 25 // Beyond this number of list domains we start using the 
old phonebook.
+    LOTS_OF_LISTS: 25, // Beyond this number of list domains we start using 
the old phonebook.
+    perm_error_postface: "" // Optional text to append to potential permission 
error messages
 }
 
 // Gravatar support. Defaults to using the gravatar proxy.
diff --git a/webui/js/source/base-http-extensions.js 
b/webui/js/source/base-http-extensions.js
index 5ac6238..dce2abf 100644
--- a/webui/js/source/base-http-extensions.js
+++ b/webui/js/source/base-http-extensions.js
@@ -67,6 +67,9 @@ async function async_snap(error) {
     msg = msg.replace(/<.*?>/g, ""); // strip HTML tags
     if (error.status === 404) {
         msg += "\n\nYou may need to be logged in with additional permissions 
in order to view this resource.";
+        if (pm_config.perm_error_postface) {
+            msg += pm_config.perm_error_postface;
+        }
     }
     modal("An error occured", "An error code %u occured while trying to fetch 
%s:\n%s".format(error.status, error.url, msg), "error");
 }

Reply via email to