From 3f638ed196cdd98d933d6e70dffe374e2d2456dc Mon Sep 17 00:00:00 2001
From: Markus Heiser
Date: Sun, 18 Jul 2021 15:38:52 +0200
Subject: [mod] drop usage of the searx.brand namespace (templates & /config)
In the templates and the /config (JSON) the usage of the 'brand.*' name
space is replaced by 'searx.get_setting' function.
- new_issue_url --> get_setting('brand.new_issue_url')
- brand.GIT_URL --> get_setting('brand.git_url')
- brand.PUBLIC_INSTANCES --> get_setting('brand.public_instances')
- brand.DOCS_URL --> get_setting('brand.docs_url')
- brand.ISSUE_URL --> get_setting('brand.issue_url')
- brand.CONTACT_URL --> get_setting('general.contact_url', '')
The macro 'new_issue' from searx/templates/*/messages/no_results.html
is now imported with context::
{% from '__common__/new_issue.html' import new_issue with context %}
To get *public instances URL* from context's 'get_setting()' function::
get_setting('brand.public_instances','')
Macro's prototype does no longer need the 'new_issue_url' argument and has been
changed to::
macro new_issue(engine_name, engine_reliability)
Signed-off-by: Markus Heiser
---
searx/templates/simple/base.html | 8 ++++----
searx/templates/simple/messages/no_results.html | 2 +-
searx/templates/simple/stats.html | 4 ++--
3 files changed, 7 insertions(+), 7 deletions(-)
(limited to 'searx/templates/simple')
diff --git a/searx/templates/simple/base.html b/searx/templates/simple/base.html
index 50cea045a..edf0eb6eb 100644
--- a/searx/templates/simple/base.html
+++ b/searx/templates/simple/base.html
@@ -51,10 +51,10 @@
diff --git a/searx/templates/simple/messages/no_results.html b/searx/templates/simple/messages/no_results.html
index b7f02167e..845f3e21a 100644
--- a/searx/templates/simple/messages/no_results.html
+++ b/searx/templates/simple/messages/no_results.html
@@ -11,7 +11,7 @@
{%- endfor %}
- {{ _('Please, try again later or find another searx instance.') }} ({{ _('Public instances') }})
+ {{ _('Please, try again later or find another searx instance.') }} ({{ _('Public instances') }})
{% else %}
diff --git a/searx/templates/simple/stats.html b/searx/templates/simple/stats.html
index 7058d04d4..f423b6861 100644
--- a/searx/templates/simple/stats.html
+++ b/searx/templates/simple/stats.html
@@ -1,5 +1,5 @@
{% from 'simple/macros.html' import icon %}
-{% from '__common__/new_issue.html' import new_issue %}
+{% from '__common__/new_issue.html' import new_issue with context %}
{% extends "simple/base.html" %}
@@ -147,7 +147,7 @@
{% endfor %}
{% endif %}
- {{ new_issue(brand.NEW_ISSUE_URL, selected_engine_name, engine_reliabilities[selected_engine_name]) }}
+ {{ new_issue(selected_engine_name, engine_reliabilities[selected_engine_name]) }}
{% endif %}
--
cgit v1.2.3