mirror of
https://github.com/searxng/searxng.git
synced 2025-12-23 04:00:02 +00:00
[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 <markus.heiser@darmarit.de>
This commit is contained in:
@@ -50,7 +50,7 @@ from flask_babel import (
|
||||
)
|
||||
|
||||
from searx import logger
|
||||
from searx import brand
|
||||
from searx import get_setting
|
||||
from searx import (
|
||||
settings,
|
||||
searx_debug,
|
||||
@@ -473,11 +473,9 @@ def render(template_name, override_theme=None, **kwargs):
|
||||
kwargs['search_formats'] = [
|
||||
x for x in settings['search']['formats'] if x != 'html'
|
||||
]
|
||||
|
||||
# brand
|
||||
kwargs['instance_name'] = settings['general']['instance_name']
|
||||
kwargs['instance_name'] = get_setting('general.instance_name')
|
||||
kwargs['searx_version'] = VERSION_STRING
|
||||
kwargs['brand'] = brand
|
||||
kwargs['get_setting'] = get_setting
|
||||
|
||||
# helpers to create links to other pages
|
||||
kwargs['url_for'] = url_for_theme # override url_for function in templates
|
||||
@@ -1323,9 +1321,9 @@ def config():
|
||||
'default_theme': settings['ui']['default_theme'],
|
||||
'version': VERSION_STRING,
|
||||
'brand': {
|
||||
'CONTACT_URL': brand.CONTACT_URL,
|
||||
'GIT_URL': brand.GIT_URL,
|
||||
'DOCS_URL': brand.DOCS_URL
|
||||
'CONTACT_URL': get_setting('general.contact_url'),
|
||||
'GIT_URL': get_setting('brand.git_url'),
|
||||
'DOCS_URL': get_setting('brand.docs_url'),
|
||||
},
|
||||
'doi_resolvers': list(settings['doi_resolvers'].keys()),
|
||||
'default_doi_resolver': settings['default_doi_resolver'],
|
||||
|
||||
Reference in New Issue
Block a user