From e5535ec078776d07d8eeac0d51dc8f17f77cfb27 Mon Sep 17 00:00:00 2001 From: Bnyro Date: Sun, 20 Aug 2023 14:03:03 +0200 Subject: [PATCH] [feat] settings: replace boolean select preferences with checkboxes --- searx/preferences.py | 15 ++++++++++----- .../simple/preferences/center_alignment.html | 12 ++++++++---- .../templates/simple/preferences/image_proxy.html | 14 +++++++++----- .../simple/preferences/infinite_scroll.html | 12 ++++++++---- .../simple/preferences/query_in_title.html | 14 +++++++++----- .../simple/preferences/results_on_new_tab.html | 12 ++++++++---- 6 files changed, 52 insertions(+), 27 deletions(-) diff --git a/searx/preferences.py b/searx/preferences.py index aba712652..6e7d4a5e1 100644 --- a/searx/preferences.py +++ b/searx/preferences.py @@ -383,7 +383,8 @@ class Preferences: '0': False, '1': True, 'True': True, - 'False': False + 'False': False, + 'on': True } ), 'method': EnumStringSetting( @@ -412,7 +413,8 @@ class Preferences: '0': False, '1': True, 'False': False, - 'True': True + 'True': True, + 'on': True } ), 'doi_resolver': MultipleChoiceSetting( @@ -432,7 +434,8 @@ class Preferences: '0': False, '1': True, 'False': False, - 'True': True + 'True': True, + 'on': True } ), 'advanced_search': MapSetting( @@ -454,7 +457,8 @@ class Preferences: '0': False, '1': True, 'True': True, - 'False': False + 'False': False, + 'on': True } ), 'infinite_scroll': MapSetting( @@ -465,7 +469,8 @@ class Preferences: '0': False, '1': True, 'True': True, - 'False': False + 'False': False, + 'on': True } ), # fmt: on diff --git a/searx/templates/simple/preferences/center_alignment.html b/searx/templates/simple/preferences/center_alignment.html index 983a3957b..80508a1ae 100644 --- a/searx/templates/simple/preferences/center_alignment.html +++ b/searx/templates/simple/preferences/center_alignment.html @@ -1,10 +1,14 @@
{{- '' -}} {{ _('Center Alignment') }}{{- '' -}}

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

{{- '' -}}
{{- _('Displays results in the center of the page (Oscar layout).') -}} diff --git a/searx/templates/simple/preferences/image_proxy.html b/searx/templates/simple/preferences/image_proxy.html index c636a3172..afb3465d4 100644 --- a/searx/templates/simple/preferences/image_proxy.html +++ b/searx/templates/simple/preferences/image_proxy.html @@ -1,11 +1,15 @@
{{- '' -}} {{ _('Image proxy') }}{{- '' -}}

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

+ {{- '' -}} +

{{- '' -}}
{{- _('Proxying image results through SearXNG') -}}
{{- '' -}} diff --git a/searx/templates/simple/preferences/infinite_scroll.html b/searx/templates/simple/preferences/infinite_scroll.html index df91b5f2e..1a734ae1a 100644 --- a/searx/templates/simple/preferences/infinite_scroll.html +++ b/searx/templates/simple/preferences/infinite_scroll.html @@ -1,10 +1,14 @@
{{- '' -}} {{ _('Infinite scroll') }}{{- '' -}}

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

{{- '' -}}
{{- _('Automatically load next page when scrolling to bottom of current page') -}} diff --git a/searx/templates/simple/preferences/query_in_title.html b/searx/templates/simple/preferences/query_in_title.html index 12d0e5577..924d6ccd1 100644 --- a/searx/templates/simple/preferences/query_in_title.html +++ b/searx/templates/simple/preferences/query_in_title.html @@ -1,10 +1,14 @@
{{- '' -}} - {{ _("Query in the page's title") }} + {{ _("Query in the page's title") }}{{- '' -}}

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

{{- '' -}}
{{- _("When enabled, the result page's title contains your query. Your browser can record this title") -}} diff --git a/searx/templates/simple/preferences/results_on_new_tab.html b/searx/templates/simple/preferences/results_on_new_tab.html index c0d6c51a5..972485dcf 100644 --- a/searx/templates/simple/preferences/results_on_new_tab.html +++ b/searx/templates/simple/preferences/results_on_new_tab.html @@ -1,10 +1,14 @@
{{- '' -}} {{ _('Results on new tabs') }}{{- '' -}}

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

{{- '' -}}
{{- _('Open result links on new browser tabs') -}}