From 584c5c85461b3d7f9f3129755e4125cd99242353 Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Sat, 15 Jan 2022 18:36:29 +0100 Subject: [PATCH] Allow configuration of upstream pgweb address MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Search forms currently point to the hardcoded address of www.postgresql.org. Add a parameter in the settings to make it possible to configure the domain hosting the /search/ function. Originally from Célestin Matte, but in the end not his patch --- django/archives/mailarchives/templates/base.html | 2 +- django/archives/mailarchives/templates/searchform.html | 4 ++-- django/archives/mailarchives/views.py | 1 + django/archives/settings.py | 2 ++ 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/django/archives/mailarchives/templates/base.html b/django/archives/mailarchives/templates/base.html index b0aa4de..23d137e 100644 --- a/django/archives/mailarchives/templates/base.html +++ b/django/archives/mailarchives/templates/base.html @@ -53,7 +53,7 @@ -
+
diff --git a/django/archives/mailarchives/templates/searchform.html b/django/archives/mailarchives/templates/searchform.html index 4855de2..1e5b4a2 100644 --- a/django/archives/mailarchives/templates/searchform.html +++ b/django/archives/mailarchives/templates/searchform.html @@ -1,6 +1,6 @@

Search the Archives

- + {%if searchform_listname%} {%endif%}
@@ -17,7 +17,7 @@ (enter a message-id to go directly to that message)
diff --git a/django/archives/mailarchives/views.py b/django/archives/mailarchives/views.py index 885f808..e5bbe51 100644 --- a/django/archives/mailarchives/views.py +++ b/django/archives/mailarchives/views.py @@ -174,6 +174,7 @@ class NavContext(object): self.request = request self.ctx = { 'allow_resend': settings.ALLOW_RESEND, + 'PGWEB_ADDRESS': settings.PGWEB_ADDRESS, } if all_groups: diff --git a/django/archives/settings.py b/django/archives/settings.py index bb97bb8..4eed26c 100644 --- a/django/archives/settings.py +++ b/django/archives/settings.py @@ -145,6 +145,8 @@ API_CLIENTS = ('127.0.0.1',) PUBLIC_ARCHIVES = False ALLOW_RESEND = False +PGWEB_ADDRESS = 'https://www.postgresql.org' + try: from .settings_local import * except ImportError: -- 2.39.5