From f3aff26086dda1c2610c9aa845db119ad413006f Mon Sep 17 00:00:00 2001 From: mrpaulblack Date: Sun, 21 Nov 2021 21:38:00 +0100 Subject: =?UTF-8?q?[simple=20theme]=20rework=20select;=20add=20safesearch?= =?UTF-8?q?=20to=20search=20and=20replace=20/=20with=20=E2=80=BA=20in=20ar?= =?UTF-8?q?ticle=20url?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * rework selection UI in pref (fix based on: https://github.com/twelsby/searx/commit/78643e9f43a103c523f112e9f3ce26a5c7bb3a0f) * moved search filters underneath categories * cut params from url and replace / with › * make h3 and url in article bigger * add safe search select to search filter (this will not override settings and only be valid while on result page in a session) * make search form button not overlap each other when js is disabled * 1rem padding around preview image and thumbnail in default article template --- searx/webapp.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'searx/webapp.py') diff --git a/searx/webapp.py b/searx/webapp.py index 4dd7ec723..6039be547 100755 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -419,6 +419,16 @@ def _get_enable_categories(all_categories): return [x for x in all_categories if x in enabled_categories] +def get_pretty_url(parsed_url): + path = parsed_url.path + path = path[:-1] if len(path) > 0 and path[-1] == '/' else path + path = path.replace("/", " › ") + return [ + parsed_url.scheme + "://" + parsed_url.netloc, + path + ] + + def render(template_name, override_theme=None, **kwargs): # values from the HTTP requests kwargs['endpoint'] = 'results' if 'q' in kwargs else request.endpoint @@ -457,6 +467,7 @@ def render(template_name, override_theme=None, **kwargs): kwargs['searx_version'] = VERSION_STRING kwargs['searx_git_url'] = GIT_URL kwargs['get_setting'] = get_setting + kwargs['get_pretty_url'] = get_pretty_url # helpers to create links to other pages kwargs['url_for'] = url_for_theme # override url_for function in templates -- cgit v1.2.3