From 076c6889d3b6ac3671bca16bb251f9f31c7191b6 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Sat, 19 Mar 2022 19:55:54 +0100 Subject: [PATCH] [fix] simple theme: open preferences with general tab BTW: fix also the category tab to open with category 'general' Signed-off-by: Markus Heiser --- searx/templates/simple/macros.html | 4 ++-- searx/templates/simple/preferences.html | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/searx/templates/simple/macros.html b/searx/templates/simple/macros.html index 637966715..7d9b9f4ae 100644 --- a/searx/templates/simple/macros.html +++ b/searx/templates/simple/macros.html @@ -55,8 +55,8 @@
{%- endmacro -%} -{%- macro tab_header(name, id, label) -%} - +{%- macro tab_header(name, id, label, checked) -%} +
{%- endmacro -%} diff --git a/searx/templates/simple/preferences.html b/searx/templates/simple/preferences.html index 84e1d6e77..2ef83757b 100644 --- a/searx/templates/simple/preferences.html +++ b/searx/templates/simple/preferences.html @@ -102,7 +102,7 @@ {{ tabs_open() }} - {{ tab_header('maintab', 'general', _('General')) }} + {{ tab_header('maintab', 'general', _('General'), True) }} {% if 'categories' not in locked_preferences %}
{{ _('Default categories') }} @@ -284,9 +284,11 @@ {{ tab_header('maintab', 'engines', _('Engines')) }}

{{ _('Currently used search engines') }}

{{ tabs_open() }} - {% for categ in categories_as_tabs + [OTHER_CATEGORY] %} - {{ tab_header('enginetab', 'category' + categ, _(categ)) }} - {% if categ == OTHER_CATEGORY %} + {% set ns = namespace(checked=true) %} + {% for categ in categories_as_tabs + [OTHER_CATEGORY] %} + {{ tab_header('enginetab', 'category' + categ, _(categ), ns.checked )}} + {% set ns.checked = false %} + {% if categ == OTHER_CATEGORY %}

{{_('This tab does not show up for search results, but you can search the engines listed here via bangs.')}}

{% endif %}