From 772c048d01c7585fd60afca1ce30a1914e6e5b4a Mon Sep 17 00:00:00 2001 From: Marc Abonce Seguin Date: Wed, 28 Feb 2018 22:30:48 -0600 Subject: refactor engine's search language handling Add match_language function in utils to match any user given language code with a list of engine's supported languages. Also add language_aliases dict on each engine to translate standard language codes into the custom codes used by the engine. --- searx/templates/oscar/preferences.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'searx/templates') diff --git a/searx/templates/oscar/preferences.html b/searx/templates/oscar/preferences.html index f23cae3e5..b64d72ddf 100644 --- a/searx/templates/oscar/preferences.html +++ b/searx/templates/oscar/preferences.html @@ -187,7 +187,7 @@ {{ search_engine.name }} {{ shortcuts[search_engine.name] }} - {{ support_toggle(current_language in search_engine.supported_languages or current_language.split('-')[0] in search_engine.supported_languages) }} + {{ support_toggle(stats[search_engine.name].supports_selected_language) }} {{ support_toggle(search_engine.safesearch==True) }} {{ support_toggle(search_engine.time_range_support==True) }} {{ 'N/A' if stats[search_engine.name].time==None else stats[search_engine.name].time }} @@ -197,7 +197,7 @@ {{ 'N/A' if stats[search_engine.name].time==None else stats[search_engine.name].time }} {{ support_toggle(search_engine.time_range_support==True) }} {{ support_toggle(search_engine.safesearch==True) }} - {{ support_toggle(current_language in search_engine.supported_languages or current_language.split('-')[0] in search_engine.supported_languages) }} + {{ support_toggle(stats[search_engine.name].supports_selected_language) }} {{ shortcuts[search_engine.name] }} {{ search_engine.name }} -- cgit v1.2.3 From 3ba0d0516e5cabce8ebcc9a27c0fe069fa23f52c Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 9 Aug 2018 16:13:50 +0200 Subject: simple theme update - npm package update - apply #1226 - implement vim help dialog - display cookies and search URL with preferences - allow to enable / disable Open Access DOI rewrite - add a clear text button on the left of the search button - implement #1011 : the HTML title page is not set when using POST - remove searx/static/themes/simple/img/loader.gif - use full width when only there are only images as result --- searx/templates/simple/preferences.html | 52 ++++++++++++++++++++++-- searx/templates/simple/result_templates/map.html | 15 +++---- searx/templates/simple/results.html | 31 ++++++++------ searx/templates/simple/search.html | 1 + 4 files changed, 75 insertions(+), 24 deletions(-) (limited to 'searx/templates') diff --git a/searx/templates/simple/preferences.html b/searx/templates/simple/preferences.html index 4529fea8c..049af5e33 100644 --- a/searx/templates/simple/preferences.html +++ b/searx/templates/simple/preferences.html @@ -52,9 +52,9 @@

{{ _('Find stuff as you type') }}
@@ -71,6 +71,19 @@
{{ _('Filter content') }}

{{ plugin_preferences('general') }} +
+ {{ _('Open Access DOI resolver') }} +

+ +

+
+
{{ tab_footer() }} {{ tab_header('maintab', 'engines', _('Engines')) }} @@ -151,6 +164,38 @@ {{ 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_footer() }} + {{ tab_header('maintab', 'privacy', _('Privacy')) }}
{{ _('Method') }} @@ -173,6 +218,7 @@
{{ _('Proxying image results through searx') }}
{{ plugin_preferences('privacy') }} + {{ tab_footer() }} {{ tabs_close() }} @@ -180,7 +226,7 @@

{{ _('These settings are stored in your cookies, this allows us not to store this data about you.') }}
{{ _("These cookies serve your sole convenience, we don't use these cookies to track you.") }} -

+

diff --git a/searx/templates/simple/result_templates/map.html b/searx/templates/simple/result_templates/map.html index 1fe0c86ac..2de445168 100644 --- a/searx/templates/simple/result_templates/map.html +++ b/searx/templates/simple/result_templates/map.html @@ -23,17 +23,17 @@ {%- endif -%} {% if result.address.road -%} - {% if result.address.house_number %}{{ result.address.house_number }}, {% endif %} - {{ result.address.road }} + {%- if result.address.house_number -%}{{- result.address.house_number -}}, {% endif %} + {{- result.address.road -}}
{%- endif %} {%- if result.address.locality -%} - {{ result.address.locality }} - {% if result.address.postcode %}, {{ result.address.postcode }}{% endif %} + {{- result.address.locality -}} + {%- if result.address.postcode -%}, {{- result.address.postcode -}}{% endif %}
{%- endif -%} {%- if result.address.country -%} - {{ result.address.country }} + {{- result.address.country -}} {%- endif -%}

{%- endif -%} @@ -44,11 +44,8 @@ {% if result.osm and (result.osm.type and result.osm.id) -%}