From 6ab569f5588e148bf73a7d80bc2f52bc737bf5e0 Mon Sep 17 00:00:00 2001 From: Adam Tauber Date: Thu, 25 Jun 2020 17:32:05 +0200 Subject: [PATCH] [fix] connect selects and inputs programmatically on the preferences page - #350 --- searx/templates/oscar/macros.html | 6 ++-- searx/templates/oscar/preferences.html | 48 +++++++++++++------------- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/searx/templates/oscar/macros.html b/searx/templates/oscar/macros.html index c4b2a7ddb..809c9f595 100644 --- a/searx/templates/oscar/macros.html +++ b/searx/templates/oscar/macros.html @@ -60,15 +60,15 @@ {%- endif %} {%- endmacro %} -{% macro preferences_item_header(info, label, rtl) -%} +{% macro preferences_item_header(info, label, rtl, id) -%} {% if rtl %}
- + {{ info }}
{% else %}
- +
{% endif %} {%- endmacro %} diff --git a/searx/templates/oscar/preferences.html b/searx/templates/oscar/preferences.html index 3466df006..8d37b8be2 100644 --- a/searx/templates/oscar/preferences.html +++ b/searx/templates/oscar/preferences.html @@ -30,9 +30,9 @@
{% include 'oscar/categories.html' %}
- + {% else %} - +
{% include 'oscar/categories.html' %}
@@ -40,14 +40,14 @@
{% set language_label = _('Search language') %} {% set language_info = _('What language do you prefer for search?') %} - {{ preferences_item_header(language_info, language_label, rtl) }} + {{ preferences_item_header(language_info, language_label, rtl, 'language') }} {% include 'oscar/languages.html' %} {{ preferences_item_footer(language_info, language_label, rtl) }} {% set locale_label = _('Interface language') %} {% set locale_info = _('Change the language of the layout') %} - {{ preferences_item_header(locale_info, locale_label, rtl) }} - {% for locale_id,locale_name in locales.items() | sort %} {% endfor %} @@ -56,8 +56,8 @@ {% set autocomplete_label = _('Autocomplete') %} {% set autocomplete_info = _('Find stuff as you type') %} - {{ preferences_item_header(autocomplete_info, autocomplete_label, rtl) }} - {% for backend in autocomplete_backends %} @@ -67,8 +67,8 @@ {% set image_proxy_label = _('Image proxy') %} {% set image_proxy_info = _('Proxying image results through searx') %} - {{ preferences_item_header(image_proxy_info, image_proxy_label, rtl) }} - @@ -76,8 +76,8 @@ {% set method_label = _('Method') %} {% set method_info = _('Change how forms are submited, learn more about request methods') %} - {{ preferences_item_header(method_info, method_label, rtl) }} - @@ -85,8 +85,8 @@ {% set safesearch_label = _('SafeSearch') %} {% set safesearch_info = _('Filter content') %} - {{ preferences_item_header(safesearch_info, safesearch_label, rtl) }} - @@ -95,16 +95,16 @@ {% set theme_label = _('Themes') %} {% set theme_info = _('Change searx layout') %} - {{ preferences_item_header(theme_info, theme_label, rtl) }} - {% for name in themes %} {% endfor %} {{ preferences_item_footer(theme_info, theme_label, rtl) }} - {{ preferences_item_header(_('Choose style for this theme'), _('Style'), rtl) }} - @@ -113,8 +113,8 @@ {% set label = _('Results on new tabs') %} {% set info = _('Open result links on new browser tabs') %} - {{ preferences_item_header(info, label, rtl) }} - @@ -122,8 +122,8 @@ {% set label = _('Open Access DOI resolver') %} {% set info = _('Redirect to open-access versions of publications when available (plugin required)') %} - {{ preferences_item_header(info, label, rtl) }} - {% for doi_resolver_name,doi_resolver_url in doi_resolvers.items() %}
@@ -241,7 +241,7 @@

{{ _(plugin.name) }}

-
{{ _(plugin.description) }}
+
{{ checkbox_toggle('plugin_' + plugin.id, plugin.id not in allowed_plugins) }}