From a55e0ac553e608e5657573a8173aa5a040a49054 Mon Sep 17 00:00:00 2001 From: Bnyro Date: Sat, 9 Sep 2023 16:49:14 +0200 Subject: [feat] search on category select without JS Co-authored-by: Alexandre Flament --- searx/templates/simple/categories.html | 29 +++++++++++++++------- searx/templates/simple/preferences.html | 3 +++ .../preferences/search_on_category_select.html | 16 ++++++++++++ 3 files changed, 39 insertions(+), 9 deletions(-) create mode 100644 searx/templates/simple/preferences/search_on_category_select.html (limited to 'searx/templates') diff --git a/searx/templates/simple/categories.html b/searx/templates/simple/categories.html index 29616f127..6ba550015 100644 --- a/searx/templates/simple/categories.html +++ b/searx/templates/simple/categories.html @@ -13,14 +13,25 @@ } -%}
{{- '' -}}
- {%- for category in categories -%} -
- -
- {%- endfor -%} - {%- if display_tooltip %}
{{ _('Click on the magnifier to perform search') }}
{% endif -%} + {%- if not search_on_category_select or not display_tooltip -%} + {%- for category in categories_as_tabs -%} +
{{- '' -}} + + +
+ {%- endfor -%} + {%- if display_tooltip %}
{{ _('Click on the magnifier to perform search') }}
{% endif -%} + {%- else -%} + {%- for category in categories_as_tabs -%}{{- '\n' -}} + {{- '' -}} + {%- endfor -%} + {{- '\n' -}} + {%- endif -%}
{{- '' -}}
diff --git a/searx/templates/simple/preferences.html b/searx/templates/simple/preferences.html index 22979ab05..3d62682bb 100644 --- a/searx/templates/simple/preferences.html +++ b/searx/templates/simple/preferences.html @@ -197,6 +197,9 @@ {%- if 'infinite_scroll' not in locked_preferences -%} {%- include 'simple/preferences/infinite_scroll.html' -%} {%- endif -%} + {%- if 'search_on_category_select' not in locked_preferences -%} + {%- include 'simple/preferences/search_on_category_select.html' -%} + {%- endif -%} {{- plugin_preferences('ui') -}} {{- tab_footer() -}} diff --git a/searx/templates/simple/preferences/search_on_category_select.html b/searx/templates/simple/preferences/search_on_category_select.html new file mode 100644 index 000000000..2bc680a61 --- /dev/null +++ b/searx/templates/simple/preferences/search_on_category_select.html @@ -0,0 +1,16 @@ +
{{- '' -}} + {{ _('Search on category select') }}{{- '' -}} +

{{- '' -}} + {{- '' -}} +

{{- '' -}} +
+ {{- _('Perform search immediately if a category selected. Disable to select multiple categories') -}} +
{{- '' -}} +
{{- '' -}} \ No newline at end of file -- cgit v1.2.3