summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorMagnus Hagander2022-01-15 17:36:29 +0000
committerMagnus Hagander2022-01-15 17:36:29 +0000
commit584c5c85461b3d7f9f3129755e4125cd99242353 (patch)
tree53497569cf8cfe27a5f7ba5239a582c9b40bce03 /django
parentec2f19bf1c9c23080b956e80fc8c377a99a276e1 (diff)
Allow configuration of upstream pgweb address
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
Diffstat (limited to 'django')
-rw-r--r--django/archives/mailarchives/templates/base.html2
-rw-r--r--django/archives/mailarchives/templates/searchform.html4
-rw-r--r--django/archives/mailarchives/views.py1
-rw-r--r--django/archives/settings.py2
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 @@
<li class="nav-item p-2"><a href="/about/donate/" title="Donate">Donate</a></li>
<li class="nav-item p-2"><a href="/account/" title="Your account">Your account</a></li>
</ul>
- <form role="search" method="get" action="/search/">
+ <form role="search" method="get" action="{{ PGWEB_ADDRESS }}/search/">
<div class="input-group">
<input id="q" name="q" type="text" size="20" maxlength="255" accesskey="s" class="form-control" placeholder="Search for...">
<span class="input-group-btn">
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 @@
<h3>Search the Archives</h3>
-<form method="get" action="/search/">
+<form method="get" action="{{ PGWEB_ADDRESS }}/search/">
<input type="hidden" name="m" value="1">
{%if searchform_listname%} <input type="hidden" name="ln" value="{{searchform_listname}}"/>{%endif%}
<div class="row">
@@ -17,7 +17,7 @@
<small class="form-text text-muted">(enter a message-id to go directly to that message)</small>
</div>
<div class="input-group">
- <a href="https://www.postgresql.org/search/?m=1{%if searchform_listname%}&amp;ln={{searchform_listname}}{%endif%}">Advanced Search</a>
+ <a href="{{ PGWEB_ADDRESS }}/search/?m=1{%if searchform_listname%}&amp;ln={{searchform_listname}}{%endif%}">Advanced Search</a>
</div>
</div><!-- /.col-lg-6 -->
</div><!-- /.row -->
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: