From 695e5d00055c59201d42e9905216a9d7afeee154 Mon Sep 17 00:00:00 2001 From: Martin Fischer Date: Fri, 7 Jan 2022 00:16:51 +0100 Subject: [PATCH] [fix 3/3] actually only hide them for tabs The categories.html template is used in three places: 1) for the tabs on the result page 2) for the default category selection in the preferences 3) for the advanced search category selection in the oscar theme The search_on_category_select plugin only makes the checkboxes in 1) behave like tabs. The previous commit however hides the checkboxes in all three places when the plugin is loaded, which we don't want: The categories in 2) and 3) always act like checkboxes, so the checkboxes in these places should actually always be visible. --- searx/static/plugins/css/search_on_category_select.css | 2 +- searx/templates/oscar/categories.html | 2 +- searx/templates/oscar/search.html | 2 ++ searx/templates/simple/categories.html | 2 +- searx/templates/simple/search.html | 4 +++- 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/searx/static/plugins/css/search_on_category_select.css b/searx/static/plugins/css/search_on_category_select.css index 3a25c66a0..95d0f5289 100644 --- a/searx/static/plugins/css/search_on_category_select.css +++ b/searx/static/plugins/css/search_on_category_select.css @@ -1 +1 @@ -.category input { display: none; } +.search-tabs .category input { display: none; } diff --git a/searx/templates/oscar/categories.html b/searx/templates/oscar/categories.html index b343e621c..f4bce4683 100644 --- a/searx/templates/oscar/categories.html +++ b/searx/templates/oscar/categories.html @@ -1,4 +1,4 @@ -
+
{% for category in ((categories_as_tabs | reverse) if rtl else categories_as_tabs) -%}
{{- '' -}} diff --git a/searx/templates/oscar/search.html b/searx/templates/oscar/search.html index 2b3758efd..f75c21711 100644 --- a/searx/templates/oscar/search.html +++ b/searx/templates/oscar/search.html @@ -19,7 +19,9 @@
+ {% with categories_class='search-tabs' %} {%- include 'oscar/categories.html' -%} + {% endwith %}
diff --git a/searx/templates/simple/categories.html b/searx/templates/simple/categories.html index 71a211904..6ed0f8b18 100644 --- a/searx/templates/simple/categories.html +++ b/searx/templates/simple/categories.html @@ -11,7 +11,7 @@ 'files': 'file-tray-full-outline', 'social media': 'people-outline', } -%} -
{{- '' -}} +
{{- '' -}}
{%- if display_tooltip %}
{{ _('Click on the magnifier to perform search') }}
{% endif -%} {%- for category in categories_as_tabs -%} diff --git a/searx/templates/simple/search.html b/searx/templates/simple/search.html index 1df55e782..40c5e38e6 100644 --- a/searx/templates/simple/search.html +++ b/searx/templates/simple/search.html @@ -10,7 +10,9 @@
{% set display_tooltip = true %} - {% include 'simple/categories.html' %} + {% with categories_class='search-tabs' %} + {% include 'simple/categories.html' %} + {% endwith %}
{% include 'simple/filters/languages.html' %}