From 2d26ace2650a893b7cf4019ae8c9b41dd8785550 Mon Sep 17 00:00:00 2001 From: MrPaulBlack Date: Fri, 24 Sep 2021 16:04:10 +0200 Subject: [PATCH 1/6] [preferences] add special queries tab to preferences --- searx/templates/simple/preferences.html | 42 +++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/searx/templates/simple/preferences.html b/searx/templates/simple/preferences.html index d544a8cb8..ab237a219 100644 --- a/searx/templates/simple/preferences.html +++ b/searx/templates/simple/preferences.html @@ -287,6 +287,48 @@ {{ tab_footer() }} + {{ tab_header('maintab', 'query', _('Special Queries')) }} + + {% if answerers %} +
+ + + + + + + + + + + {% for answerer in answerers %} + + + + + + + + {% endfor %} + + + {%- for plugin in plugins -%} + {%- if plugin.preference_section == 'query' -%} + + + + + + + + {%- endif -%} + {%- endfor -%} +
{{ _('Allow') }}{{ _('Keywords') }}{{ _('Name') }}{{ _('Description') }}{{ _('Examples') }}
{{ _('This is the list of searx\'s instant answering modules.') }}
{{ answerer.keywords|join(', ') }}
{{ answerer.info.name }}
{{ answerer.info.description }}{{ answerer.info.examples|join(', ') }}
{{ _('This is the list of plugins.') }}
{{- checkbox_onoff('plugin_' + plugin.id, plugin.id not in allowed_plugins) -}}{{ plugin.query_keywords|join(', ') }}
{{ _(plugin.name) }}
{{ _(plugin.description) }}{{ plugin.query_examples }}
+
+ {% endif %} + + {{ tab_footer() }} + {{ tab_header('maintab', 'privacy', _('Privacy')) }} {% if 'method' not in locked_preferences %}
From 45eb2b5637985354770625532287d1fd8b1df91f Mon Sep 17 00:00:00 2001 From: MrPaulBlack Date: Fri, 24 Sep 2021 16:15:26 +0200 Subject: [PATCH 2/6] [preferences] cleanup whitespaces --- searx/templates/simple/preferences.html | 268 ++++++++++++------------ 1 file changed, 129 insertions(+), 139 deletions(-) diff --git a/searx/templates/simple/preferences.html b/searx/templates/simple/preferences.html index ab237a219..6699a30a4 100644 --- a/searx/templates/simple/preferences.html +++ b/searx/templates/simple/preferences.html @@ -102,79 +102,77 @@ {{ tabs_open() }} -{{ tab_header('maintab', 'general', _('General')) }} - {% if 'categories' not in locked_preferences %} -
- {{ _('Default categories') }} - {% set display_tooltip = false %} - {% include 'simple/categories.html' %} -
- {% endif %} - {% if 'language' not in locked_preferences %} -
- {{ _('Search language') }} -

{{- '' -}} - {{- '' -}} + + {%- for lang_id,lang_name,country_name,english_name in language_codes | sort(attribute=1) -%} + + {%- endfor -%} + {{- '' -}} +

+
{{ _('What language do you prefer for search?') }}
+
+ {% endif %} + {% if 'autocomplete' not in locked_preferences %} +
+ {{ _('Autocomplete') }} +

+ +

+
{{ _('Find stuff as you type') }}
+
+ {% endif %} + {% if 'safesearch' not in locked_preferences %} +
+ {{ _('SafeSearch') }} +

+ +

+

{{ _('Filter content') }}

+
+ {% endif %} + {{ plugin_preferences('general') }} + {% if 'doi_resolver' not in locked_preferences %} +
+ {{ _('Open Access DOI resolver') }} +

+ {{- '' -}} -

-
{{ _('What language do you prefer for search?') }}
-
- {% endif %} - {% if 'autocomplete' not in locked_preferences %} -
- {{ _('Autocomplete') }} -

- -

-
{{ _('Find stuff as you type') }}
-
- {% endif %} - {% if 'safesearch' not in locked_preferences %} -
- {{ _('SafeSearch') }} -

- -

-

{{ _('Filter content') }}

-
- {% endif %} - {{ plugin_preferences('general') }} - {% if 'doi_resolver' not in locked_preferences %} -
- {{ _('Open Access DOI resolver') }} -

- -

-
-
- {% endif %} + +

+
+
+ {% endif %} {{ tab_footer() }} {{ tab_header('maintab', 'engines', _('Engines')) }}

{{ _('Currently used search engines') }}

- {{ tabs_open() }} {% for categ in all_categories %} - {{ tab_header('enginetab', 'category' + categ, _(categ)) }}
@@ -190,7 +188,6 @@ {% for search_engine in engines_by_category[categ] %} - {% if not search_engine.private %} {% set engine_id = 'engine_' + search_engine.name|replace(' ', '_') + '__' + categ|replace(' ', '_') %} @@ -214,54 +211,52 @@ {{ tab_footer() }} {{ tab_header('maintab', 'ui', _('User interface')) }} - {% if 'locale' not in locked_preferences %} -
- {{ _('Interface language') }} -

- -

-
{{ _('Change the language of the layout') }}
-
- {% endif %} - {% if 'theme' not in locked_preferences %} -
- {{ _('Themes') }} -

- -

-
{{ _('Change searx layout') }}
-
- {% endif %} - {% if 'results_on_new_tab' not in locked_preferences %} -
- {{ _('Results on new tabs') }} -

- -

-
{{_('Open result links on new browser tabs') }}
-
- {% endif %} - {{ plugin_preferences('ui') }} + {% if 'locale' not in locked_preferences %} +
+ {{ _('Interface language') }} +

+ +

+
{{ _('Change the language of the layout') }}
+
+ {% endif %} + {% if 'theme' not in locked_preferences %} +
+ {{ _('Themes') }} +

+ +

+
{{ _('Change searx layout') }}
+
+ {% endif %} + {% if 'results_on_new_tab' not in locked_preferences %} +
+ {{ _('Results on new tabs') }} +

+ +

+
{{_('Open result links on new browser tabs') }}
+
+ {% endif %} + {{ plugin_preferences('ui') }} {{ tab_footer() }} {{ tab_header('maintab', 'cookies', _('Cookies')) }} -

{{ _('This is the list of cookies and their values searx is storing on your computer.') }}
{{ _('With that list, you can assess searx transparency.') }}

- {% if cookies %}
{{ _("Reliablity") }}
@@ -278,17 +273,14 @@ {% else %} {% include 'oscar/messages/no_cookies.html' %} {% endif %} -

{{ _('Search URL of the currently saved preferences') }} :

{{ url_for('index', _external=True) }}?preferences={{ preferences_url_params|e }}{% raw %}&q=%s{% endraw %}

{{ _('Note: specifying custom settings in the search URL can reduce privacy by leaking data to the clicked result sites.') }}

- {{ tab_footer() }} {{ tab_header('maintab', 'query', _('Special Queries')) }} - {% if answerers %}
@@ -326,39 +318,37 @@
{% endif %} - {{ tab_footer() }} {{ tab_header('maintab', 'privacy', _('Privacy')) }} - {% if 'method' not in locked_preferences %} -
- {{ _('Method') }} -

- -

-
{{ _('Search language') }}
-
- {% endif %} - {% if 'image_proxy' not in locked_preferences %} -
- {{ _('Image proxy') }} -

- -

-
{{ _('Proxying image results through searx') }}
-
- {% endif %} - {{ plugin_preferences('privacy') }} - + {% if 'method' not in locked_preferences %} +
+ {{ _('Method') }} +

+ +

+
{{ _('Search language') }}
+
+ {% endif %} + {% if 'image_proxy' not in locked_preferences %} +
+ {{ _('Image proxy') }} +

+ +

+
{{ _('Proxying image results through searx') }}
+
+ {% endif %} + {{ plugin_preferences('privacy') }} {{ tab_footer() }} - {{ tabs_close() }} +{{ tabs_close() }}

{{ _('These settings are stored in your cookies, this allows us not to store this data about you.') }}
From d24bcbb6f0c4d462df7930d401af68d119e815f3 Mon Sep 17 00:00:00 2001 From: MrPaulBlack Date: Fri, 24 Sep 2021 16:21:43 +0200 Subject: [PATCH 3/6] [preferences] reorder tabs in simple to match oscar theme --- searx/templates/simple/preferences.html | 186 ++++++++++++------------ 1 file changed, 93 insertions(+), 93 deletions(-) diff --git a/searx/templates/simple/preferences.html b/searx/templates/simple/preferences.html index 6699a30a4..17a22b00e 100644 --- a/searx/templates/simple/preferences.html +++ b/searx/templates/simple/preferences.html @@ -169,47 +169,6 @@ {% endif %} {{ tab_footer() }} - {{ tab_header('maintab', 'engines', _('Engines')) }} -

{{ _('Currently used search engines') }}

- {{ tabs_open() }} - {% for categ in all_categories %} - {{ tab_header('enginetab', 'category' + categ, _(categ)) }} -
- - - - - - - - - - - - - {% for search_engine in engines_by_category[categ] %} - {% if not search_engine.private %} - {% set engine_id = 'engine_' + search_engine.name|replace(' ', '_') + '__' + categ|replace(' ', '_') %} - - - - - - - - {{ engine_time(search_engine.name) }} - - {{ engine_reliability(search_engine.name) }} - - {% endif %} - {% endfor %} -
{{ _("Allow") }}{{ _("Engine name") }}{{ _("Shortcut") }}{{ _("Supports selected language") }}{{ _("SafeSearch") }}{{ _("Time range") }}{{ _("Response time") }}{{ _("Max time") }}{{ _("Reliablity") }}
{{ checkbox_onoff(engine_id, (search_engine.name, categ) in disabled_engines) }}{% if search_engine.enable_http %}{{ icon('warning', 'No HTTPS') }}{% endif %} {{ search_engine.name }} {{ engine_about(search_engine) }}{{ shortcuts[search_engine.name] }}{{ checkbox(engine_id + '_supported_languages', supports[search_engine.name]['supports_selected_language'], true, true) }}{{ checkbox(engine_id + '_safesearch', supports[search_engine.name]['safesearch'], true, true) }}{{ checkbox(engine_id + '_time_range_support', supports[search_engine.name]['time_range_support'], true, true) }}{{ search_engine.timeout }}
-
- {{ tab_footer() }} - {% endfor %} - {{ tabs_close() }} - {{ tab_footer() }} - {{ tab_header('maintab', 'ui', _('User interface')) }} {% if 'locale' not in locked_preferences %}
@@ -252,32 +211,73 @@ {{ plugin_preferences('ui') }} {{ tab_footer() }} - {{ tab_header('maintab', 'cookies', _('Cookies')) }} -

- {{ _('This is the list of cookies and their values searx is storing on your computer.') }}
- {{ _('With that list, you can assess searx transparency.') }}
-

- {% if cookies %} - - - - - - {% for cookie in cookies %} - - - - - {% endfor %} -
{{ _('Cookie name') }}{{ _('Value') }}
{{ cookie }}{{ cookies[cookie] }}
- {% else %} - {% include 'oscar/messages/no_cookies.html' %} - {% endif %} -

{{ _('Search URL of the currently saved preferences') }} :

-
-
{{ url_for('index', _external=True) }}?preferences={{ preferences_url_params|e }}{% raw %}&q=%s{% endraw %}
-
-

{{ _('Note: specifying custom settings in the search URL can reduce privacy by leaking data to the clicked result sites.') }}

+ {{ tab_header('maintab', 'privacy', _('Privacy')) }} + {% if 'method' not in locked_preferences %} +
+ {{ _('Method') }} +

+ +

+
{{ _('Search language') }}
+
+ {% endif %} + {% if 'image_proxy' not in locked_preferences %} +
+ {{ _('Image proxy') }} +

+ +

+
{{ _('Proxying image results through searx') }}
+
+ {% endif %} + {{ plugin_preferences('privacy') }} + {{ tab_footer() }} + + {{ tab_header('maintab', 'engines', _('Engines')) }} +

{{ _('Currently used search engines') }}

+ {{ tabs_open() }} + {% for categ in all_categories %} + {{ tab_header('enginetab', 'category' + categ, _(categ)) }} +
+ + + + + + + + + + + + + {% for search_engine in engines_by_category[categ] %} + {% if not search_engine.private %} + {% set engine_id = 'engine_' + search_engine.name|replace(' ', '_') + '__' + categ|replace(' ', '_') %} + + + + + + + + {{ engine_time(search_engine.name) }} + + {{ engine_reliability(search_engine.name) }} + + {% endif %} + {% endfor %} +
{{ _("Allow") }}{{ _("Engine name") }}{{ _("Shortcut") }}{{ _("Supports selected language") }}{{ _("SafeSearch") }}{{ _("Time range") }}{{ _("Response time") }}{{ _("Max time") }}{{ _("Reliablity") }}
{{ checkbox_onoff(engine_id, (search_engine.name, categ) in disabled_engines) }}{% if search_engine.enable_http %}{{ icon('warning', 'No HTTPS') }}{% endif %} {{ search_engine.name }} {{ engine_about(search_engine) }}{{ shortcuts[search_engine.name] }}{{ checkbox(engine_id + '_supported_languages', supports[search_engine.name]['supports_selected_language'], true, true) }}{{ checkbox(engine_id + '_safesearch', supports[search_engine.name]['safesearch'], true, true) }}{{ checkbox(engine_id + '_time_range_support', supports[search_engine.name]['time_range_support'], true, true) }}{{ search_engine.timeout }}
+
+ {{ tab_footer() }} + {% endfor %} + {{ tabs_close() }} {{ tab_footer() }} {{ tab_header('maintab', 'query', _('Special Queries')) }} @@ -320,32 +320,32 @@ {% endif %} {{ tab_footer() }} - {{ tab_header('maintab', 'privacy', _('Privacy')) }} - {% if 'method' not in locked_preferences %} -
- {{ _('Method') }} -

- -

-
{{ _('Search language') }}
-
- {% endif %} - {% if 'image_proxy' not in locked_preferences %} -
- {{ _('Image proxy') }} -

- -

-
{{ _('Proxying image results through searx') }}
-
- {% endif %} - {{ plugin_preferences('privacy') }} + {{ tab_header('maintab', 'cookies', _('Cookies')) }} +

+ {{ _('This is the list of cookies and their values searx is storing on your computer.') }}
+ {{ _('With that list, you can assess searx transparency.') }}
+

+ {% if cookies %} + + + + + + {% for cookie in cookies %} + + + + + {% endfor %} +
{{ _('Cookie name') }}{{ _('Value') }}
{{ cookie }}{{ cookies[cookie] }}
+ {% else %} + {% include 'oscar/messages/no_cookies.html' %} + {% endif %} +

{{ _('Search URL of the currently saved preferences') }} :

+
+
{{ url_for('index', _external=True) }}?preferences={{ preferences_url_params|e }}{% raw %}&q=%s{% endraw %}
+
+

{{ _('Note: specifying custom settings in the search URL can reduce privacy by leaking data to the clicked result sites.') }}

{{ tab_footer() }} {{ tabs_close() }} From 7cb5099c88e0837ca839504b4b57cd28c27197b1 Mon Sep 17 00:00:00 2001 From: MrPaulBlack Date: Fri, 24 Sep 2021 18:01:20 +0200 Subject: [PATCH 4/6] [preferences] make elements in query selecter align left --- searx/static/themes/simple/src/less/preferences.less | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/searx/static/themes/simple/src/less/preferences.less b/searx/static/themes/simple/src/less/preferences.less index d03bf42d2..034102e66 100644 --- a/searx/static/themes/simple/src/less/preferences.less +++ b/searx/static/themes/simple/src/less/preferences.less @@ -4,6 +4,12 @@ } } +#tab-contentquery table td, +#tab-contentquery table th { + text-align: left !important; + height: 3rem; +} + #main_preferences { form { width: 100%; From 30a9146bdc75ef78c8b6906541e5e55910f5d1f3 Mon Sep 17 00:00:00 2001 From: MrPaulBlack Date: Fri, 24 Sep 2021 18:02:07 +0200 Subject: [PATCH 5/6] [build] /static --- searx/static/themes/simple/css/searx-rtl.css | 5 +++++ .../themes/simple/css/searx-rtl.min.css | Bin 33976 -> 34068 bytes .../themes/simple/css/searx-rtl.min.css.map | Bin 19166 -> 19200 bytes searx/static/themes/simple/css/searx.css | 5 +++++ searx/static/themes/simple/css/searx.min.css | Bin 33937 -> 34029 bytes .../themes/simple/css/searx.min.css.map | Bin 19110 -> 19144 bytes 6 files changed, 10 insertions(+) diff --git a/searx/static/themes/simple/css/searx-rtl.css b/searx/static/themes/simple/css/searx-rtl.css index 5ea4193f1..63ab1d619 100644 --- a/searx/static/themes/simple/css/searx-rtl.css +++ b/searx/static/themes/simple/css/searx-rtl.css @@ -1844,6 +1844,11 @@ td:hover .engine-tooltip, .column-reliability .engine-tooltip { right: 12rem; } +#tab-contentquery table td, +#tab-contentquery table th { + text-align: left !important; + height: 3rem; +} #main_preferences form { width: 100%; } diff --git a/searx/static/themes/simple/css/searx-rtl.min.css b/searx/static/themes/simple/css/searx-rtl.min.css index 3052f2d0d357309cff44bb40cc1cc63ff5c3af8b..d2e2be6ccc20c7cbdd0f8f2ff08fc614887daaf7 100644 GIT binary patch delta 109 zcmdnd$uy;lX#-b4R7qlzZgPHJNorn6VQFenr2fk2T8Uz2Zb5!gNn&1!bw+AtdPa$raZzgSWX2%j&C&sLO#t%cDJ}p2 delta 14 VcmbQz#k8Z7X#-cl=CpuyCIBnZ1-SqK diff --git a/searx/static/themes/simple/css/searx-rtl.min.css.map b/searx/static/themes/simple/css/searx-rtl.min.css.map index 171cf32586f49b74a6f51a88b455a9ab6dd2317d..bbb8b5290f3a6a078a3e21691fcdffd71e028d9c 100644 GIT binary patch delta 73 zcmcaNm9b$O;|4iB70-Mp9U~`4XGbtu;-nMq=;)}E3KH-KvAi8U9XBiJJ!E7ybak7o VVI|AtZZuihpq|lk^I`*QDF7C^6siCK delta 39 vcmZpe#&~Zk;|4iBCU3XRPI?a+nG0OqCVN@QGPxH{b~UJHtk`_iz*-6b3{njV diff --git a/searx/static/themes/simple/css/searx.css b/searx/static/themes/simple/css/searx.css index 288f077ef..e2306757d 100644 --- a/searx/static/themes/simple/css/searx.css +++ b/searx/static/themes/simple/css/searx.css @@ -1844,6 +1844,11 @@ td:hover .engine-tooltip, .column-reliability .engine-tooltip { right: 12rem; } +#tab-contentquery table td, +#tab-contentquery table th { + text-align: left !important; + height: 3rem; +} #main_preferences form { width: 100%; } diff --git a/searx/static/themes/simple/css/searx.min.css b/searx/static/themes/simple/css/searx.min.css index 7df4eacbdab37d4f4e685d8e40ef530b251f1192..2e175e34d5c597122d19892afba4df143d8d8ca1 100644 GIT binary patch delta 109 zcmbQ($@I39X#-b4R7qlzZgPHJNorn6VQFenr2fk2T8Uz2Zb5!gNn&1!bw+AtdPa$raZzgSWX2%j&C&s7CIAL}DL4QC delta 14 VcmaFc$uzN(X#-cl=Cpuz696u!1;YRU diff --git a/searx/static/themes/simple/css/searx.min.css.map b/searx/static/themes/simple/css/searx.min.css.map index d93b6d739933413342a31c0b3d047cc9a802d424..0231f68a2c600ae5191be678ce21a0bfe02c93e6 100644 GIT binary patch delta 73 zcmZ2BmGQ(>#tn>mDxUdHIz~>8&W>QR#7QUI(a}*S6(ryfVtG4yI&Nmxd&tOa=;}6^ V+e((n-DonKK|Q18<~9QbDF6%y6b%3X delta 39 vcmX>xm2ufr#tn>mOx|vrRrMY+G8eeIP1d!NWpXc^tYJ{kSh0D9fr1nO1o;eX From 3017227c14882cff46298b6e849fe30a6bd1f9be Mon Sep 17 00:00:00 2001 From: MrPaulBlack Date: Fri, 24 Sep 2021 19:14:35 +0200 Subject: [PATCH 6/6] [preferences] remove checkbox class from query section --- searx/templates/simple/preferences.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/searx/templates/simple/preferences.html b/searx/templates/simple/preferences.html index 17a22b00e..1164bd04f 100644 --- a/searx/templates/simple/preferences.html +++ b/searx/templates/simple/preferences.html @@ -297,7 +297,7 @@ {{ answerer.keywords|join(', ') }} -
{{ answerer.info.name }}
+ {{ answerer.info.name }} {{ answerer.info.description }} {{ answerer.info.examples|join(', ') }} @@ -309,7 +309,7 @@ {{- checkbox_onoff('plugin_' + plugin.id, plugin.id not in allowed_plugins) -}} {{ plugin.query_keywords|join(', ') }} -
{{ _(plugin.name) }}
+ {{ _(plugin.name) }} {{ _(plugin.description) }} {{ plugin.query_examples }}