Theme: implement search_on_category_select as a preference

The implementation is change to work without javascript:
When enabled, the HTML page contains buttons instead of checkboxes.

* Related to https://github.com/searxng/searxng/issues/769#issuecomment-1132481995
* Fix https://github.com/searxng/searxng/issues/854
This commit is contained in:
Alexandre Flament 2022-07-02 21:09:26 +02:00
parent 69a6d994e1
commit 3de28b283a
9 changed files with 87 additions and 55 deletions

View file

@ -248,6 +248,18 @@
<div class="description">{{ _('Automatically load next page when scrolling to bottom of current page') }}</div>
</fieldset>
{% endif %}
{% if 'search_on_category_select' not in locked_preferences %}
<fieldset>
<legend>{{ _('Search on category select') }}</legend>
<p class="value">
<select name='search_on_category_select'>
<option value="1" {% if search_on_category_select %}selected="selected"{% endif %}>{{ _('On') }}</option>
<option value="0" {% if not search_on_category_select %}selected="selected"{% endif %}>{{ _('Off')}}</option>
</select>
</p>
<div class="description">{{ _('Perform search immediately if a category selected. Disable to select multiple categories. (JavaScript required)') }}</div>
</fieldset>
{% endif %}
{{ plugin_preferences('ui') }}
{{ tab_footer() }}