2017-10-06 19:50:59 +00:00
{% from 'oscar/macros.html' import preferences_item_header, preferences_item_header_rtl, preferences_item_footer, preferences_item_footer_rtl, checkbox_toggle, support_toggle %}
2014-09-22 20:42:29 +00:00
{% extends "oscar/base.html" %}
2014-09-26 16:26:46 +00:00
{% block title %}{{ _('preferences') }} - {% endblock %}
2014-09-22 20:42:29 +00:00
{% block content %}
2017-10-06 19:50:59 +00:00
2014-09-22 20:42:29 +00:00
< div >
< h1 > {{ _('Preferences') }}< / h1 >
< form method = "post" action = "{{ url_for('preferences') }}" id = "search_form" >
2015-04-26 18:09:28 +00:00
<!-- Nav tabs -->
2020-05-15 08:16:49 +00:00
< ul class = "nav nav-tabs nav-justified hide_if_nojs" role = "tablist" >
2015-04-26 18:09:28 +00:00
< li class = "active" > < a href = "#tab_general" role = "tab" data-toggle = "tab" > {{ _('General') }}< / a > < / li >
< li > < a href = "#tab_engine" role = "tab" data-toggle = "tab" > {{ _('Engines') }}< / a > < / li >
< li > < a href = "#tab_plugins" role = "tab" data-toggle = "tab" > {{ _('Plugins') }}< / a > < / li >
2016-11-19 19:53:51 +00:00
{% if answerers %}< li > < a href = "#tab_answerers" role = "tab" data-toggle = "tab" > {{ _('Answerers') }}< / a > < / li > {% endif %}
2015-02-18 17:31:01 +00:00
< li > < a href = "#tab_cookies" role = "tab" data-toggle = "tab" > {{ _('Cookies') }}< / a > < / li >
2015-04-26 18:09:28 +00:00
< / ul >
2014-09-22 20:42:29 +00:00
2015-04-26 18:09:28 +00:00
<!-- Tab panes -->
< noscript >
< h3 > {{ _('General') }}< / h3 >
< / noscript >
< div class = "tab-content" >
< div class = "tab-pane active" id = "tab_general" >
< fieldset >
< div class = "container-fluid" >
< div class = "row form-group" >
{% if rtl %}
< div class = "col-sm-11 col-md-10" >
{% include 'oscar/categories.html' %}
< / div >
2020-06-25 15:32:05 +00:00
< label class = "col-sm-3 col-md-2" for = "categories" > {{ _('Default categories') }}< / label >
2015-04-26 18:09:28 +00:00
{% else %}
2020-06-25 15:32:05 +00:00
< label class = "col-sm-3 col-md-2" for = "categories" > {{ _('Default categories') }}< / label >
2016-07-17 16:43:47 +00:00
< div class = "col-sm-11 col-md-10 search-categories" >
2015-04-26 18:09:28 +00:00
{% include 'oscar/categories.html' %}
< / div >
{% endif %}
2014-09-22 20:42:29 +00:00
< / div >
2015-04-26 18:09:28 +00:00
{% set language_label = _('Search language') %}
{% set language_info = _('What language do you prefer for search?') %}
2020-06-25 15:32:05 +00:00
{{ preferences_item_header(language_info, language_label, rtl, 'language') }}
2019-12-10 17:10:33 +00:00
{% include 'oscar/languages.html' %}
2015-04-26 18:09:28 +00:00
{{ preferences_item_footer(language_info, language_label, rtl) }}
2015-01-16 15:58:44 +00:00
2015-04-26 18:09:28 +00:00
{% set locale_label = _('Interface language') %}
{% set locale_info = _('Change the language of the layout') %}
2020-06-25 15:32:05 +00:00
{{ preferences_item_header(locale_info, locale_label, rtl, 'locale') }}
< select class = "form-control" name = "locale" id = "locale" >
2015-04-26 18:09:28 +00:00
{% for locale_id,locale_name in locales.items() | sort %}
< option value = "{{ locale_id }}" { % if locale_id = = current_locale % } selected = "selected" { % endif % } > {{ locale_name }}< / option >
{% endfor %}
< / select >
{{ preferences_item_footer(locale_info, locale_label, rtl) }}
2015-02-10 14:23:56 +00:00
2015-04-26 18:09:28 +00:00
{% set autocomplete_label = _('Autocomplete') %}
{% set autocomplete_info = _('Find stuff as you type') %}
2020-06-25 15:32:05 +00:00
{{ preferences_item_header(autocomplete_info, autocomplete_label, rtl, 'autocomplete') }}
< select class = "form-control" name = "autocomplete" id = "autocomplete" >
2015-04-26 18:09:28 +00:00
< option value = "" > - < / option >
{% for backend in autocomplete_backends %}
< option value = "{{ backend }}" { % if backend = = autocomplete % } selected = "selected" { % endif % } > {{ backend }}< / option >
{% endfor %}
< / select >
{{ preferences_item_footer(autocomplete_info, autocomplete_label, rtl) }}
2015-02-10 14:23:56 +00:00
2015-04-26 18:09:28 +00:00
{% set image_proxy_label = _('Image proxy') %}
{% set image_proxy_info = _('Proxying image results through searx') %}
2020-06-25 15:32:05 +00:00
{{ preferences_item_header(image_proxy_info, image_proxy_label, rtl, 'image_proxy') }}
< select class = "form-control" name = "image_proxy" id = "image_proxy" >
2015-04-26 18:09:28 +00:00
< option value = "1" { % if image_proxy % } selected = "selected" { % endif % } > {{ _('Enabled') }}< / option >
< option value = "" { % if not image_proxy % } selected = "selected" { % endif % } > {{ _('Disabled')}}< / option >
< / select >
{{ preferences_item_footer(image_proxy_info, image_proxy_label, rtl) }}
2015-02-10 14:23:56 +00:00
2015-04-26 18:09:28 +00:00
{% set method_label = _('Method') %}
{% set method_info = _('Change how forms are submited, < a href = "http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods" rel = "external" > learn more about request methods< / a > ') %}
2020-06-25 15:32:05 +00:00
{{ preferences_item_header(method_info, method_label, rtl, 'method') }}
< select class = "form-control" name = "method" id = "method" >
2015-04-26 18:09:28 +00:00
< option value = "POST" { % if method = = ' POST ' % } selected = "selected" { % endif % } > POST< / option >
< option value = "GET" { % if method = = ' GET ' % } selected = "selected" { % endif % } > GET< / option >
< / select >
{{ preferences_item_footer(method_info, method_label, rtl) }}
2015-02-10 14:23:56 +00:00
2015-04-26 18:09:28 +00:00
{% set safesearch_label = _('SafeSearch') %}
{% set safesearch_info = _('Filter content') %}
2020-06-25 15:32:05 +00:00
{{ preferences_item_header(safesearch_info, safesearch_label, rtl, 'safesearch') }}
< select class = "form-control" name = "safesearch" id = "safesearch" >
2015-04-26 18:09:28 +00:00
< option value = "2" { % if safesearch = = ' 2 ' % } selected = "selected" { % endif % } > {{ _('Strict') }}< / option >
< option value = "1" { % if safesearch = = ' 1 ' % } selected = "selected" { % endif % } > {{ _('Moderate') }}< / option >
< option value = "0" { % if safesearch = = ' 0 ' % } selected = "selected" { % endif % } > {{ _('None') }}< / option >
< / select >
{{ preferences_item_footer(safesearch_info, safesearch_label, rtl) }}
2015-02-10 14:23:56 +00:00
2015-04-26 18:09:28 +00:00
{% set theme_label = _('Themes') %}
{% set theme_info = _('Change searx layout') %}
2020-06-25 15:32:05 +00:00
{{ preferences_item_header(theme_info, theme_label, rtl, 'theme') }}
< select class = "form-control" name = "theme" id = "theme" >
2015-04-26 18:09:28 +00:00
{% for name in themes %}
< option value = "{{ name }}" { % if name = = theme % } selected = "selected" { % endif % } > {{ name }}< / option >
{% endfor %}
< / select >
{{ preferences_item_footer(theme_info, theme_label, rtl) }}
2016-06-25 23:57:43 +00:00
2020-06-25 15:32:05 +00:00
{{ preferences_item_header(_('Choose style for this theme'), _('Style'), rtl, 'oscar_style') }}
< select class = "form-control" name = "oscar-style" id = "oscar_style" >
2016-06-25 23:57:43 +00:00
< option value = "logicodev" > Logicodev< / option >
2017-12-05 21:30:20 +00:00
< option value = "pointhi" { % if preferences . get_value ( ' oscar-style ' ) = = ' pointhi ' % } selected = "selected" { % endif % } > Pointhi< / option >
< option value = "logicodev-dark" { % if preferences . get_value ( ' oscar-style ' ) = = ' logicodev-dark ' % } selected = "selected" { % endif % } > Logicodev dark< / option >
2016-06-25 23:57:43 +00:00
< / select >
{{ preferences_item_footer(_('Choose style for this theme'), _('Style'), rtl) }}
2016-09-04 13:56:46 +00:00
{% set label = _('Results on new tabs') %}
{% set info = _('Open result links on new browser tabs') %}
2020-06-25 15:32:05 +00:00
{{ preferences_item_header(info, label, rtl, 'results_on_new_tab') }}
< select class = "form-control" name = "results_on_new_tab" id = "results_on_new_tab" >
2016-09-04 13:56:46 +00:00
< option value = "1" { % if results_on_new_tab % } selected = "selected" { % endif % } > {{ _('On') }}< / option >
< option value = "0" { % if not results_on_new_tab % } selected = "selected" { % endif % } > {{ _('Off')}}< / option >
< / select >
{{ preferences_item_footer(info, label, rtl) }}
2017-11-01 12:58:48 +00:00
{% set label = _('Open Access DOI resolver') %}
{% set info = _('Redirect to open-access versions of publications when available (plugin required)') %}
2020-06-25 15:32:05 +00:00
{{ preferences_item_header(info, label, rtl, 'doi_resolver') }}
< select class = "form-control" name = "doi_resolver" id = "doi_resolver" >
2017-11-01 12:58:48 +00:00
{% for doi_resolver_name,doi_resolver_url in doi_resolvers.items() %}
< option value = "{{ doi_resolver_name }}" { % if doi_resolver_name = = current_doi_resolver % } selected = "selected" { % endif % } >
{{ doi_resolver_name }} - {{ doi_resolver_url }}
< / option >
{% endfor %}
< / select >
{{ preferences_item_footer(info, label, rtl) }}
2020-02-01 10:01:17 +00:00
{% set label = _('Engine tokens') %}
{% set info = _('Access tokens for private engines') %}
2020-06-25 15:32:05 +00:00
{{ preferences_item_header(info, label, rtl, 'tokens') }}
< input class = "form-control" id = "tokens" name = "tokens" value = '{{ preferences.tokens.get_value() }}' / >
2020-02-01 10:01:17 +00:00
{{ preferences_item_footer(info, label, rtl) }}
2015-04-26 18:09:28 +00:00
< / div >
< / fieldset >
2014-09-22 20:42:29 +00:00
< / div >
2015-04-26 18:09:28 +00:00
< div class = "tab-pane active_if_nojs" id = "tab_engine" >
2015-01-16 15:58:44 +00:00
2015-04-26 18:09:28 +00:00
<!-- Nav tabs -->
2020-05-15 08:16:49 +00:00
< ul class = "nav nav-tabs nav-justified hide_if_nojs" role = "tablist" >
2015-06-05 06:48:47 +00:00
{% for categ in all_categories %}
2015-04-26 18:09:28 +00:00
< li { % if loop . first % } class = "active" { % endif % } > < a href = "#tab_engine_{{ categ|replace(' ', '_') }}" role = "tab" data-toggle = "tab" > {{ _(categ) }}< / a > < / li >
{% endfor %}
< / ul >
2015-01-16 15:58:44 +00:00
2015-04-26 18:09:28 +00:00
< noscript >
< h3 > {{ _('Engines') }}< / h3 >
2014-11-03 21:18:40 +00:00
< / noscript >
2015-04-26 18:09:28 +00:00
<!-- Tab panes -->
< div class = "tab-content" >
2020-05-31 20:36:09 +00:00
< div class = "hide_if_nojs" >
< p class = "text-{% if rtl %}left{% else %}right{% endif %}" >
< button type = "button" class = "btn btn-default btn-success" id = "allow-all-engines" > {{ _("Allow all") }}< / button >
< button type = "button" class = "btn btn-default btn-danger" id = "disable-all-engines" > {{ _("Disable all") }}< / button >
< / p >
< / div >
2015-06-05 06:48:47 +00:00
{% for categ in all_categories %}
2015-04-26 18:09:28 +00:00
< noscript > < label > {{ _(categ) }}< / label >
< / noscript >
< div class = "tab-pane{% if loop.first %} active{% endif %} active_if_nojs" id = "tab_engine_{{ categ|replace(' ', '_') }}" >
< div class = "container-fluid" >
< fieldset >
2015-05-30 10:15:23 +00:00
< div class = "table-responsive" >
2019-12-10 17:10:33 +00:00
< table class = "table table-hover table-condensed table-striped" >
< tr >
2015-05-30 10:15:23 +00:00
{% if not rtl %}
2020-06-25 13:51:42 +00:00
< th scope = "col" > {{ _("Allow") }}< / th >
< th scope = "col" > {{ _("Engine name") }}< / th >
< th scope = "col" > {{ _("Shortcut") }}< / th >
< th scope = "col" > {{ _("Selected language") }}< / th >
< th scope = "col" > {{ _("SafeSearch") }}< / th >
< th scope = "col" > {{ _("Time range") }}< / th >
< th scope = "col" > {{ _("Avg. time") }}< / th >
< th scope = "col" > {{ _("Max time") }}< / th >
2015-05-30 10:15:23 +00:00
{% else %}
2020-06-25 13:51:42 +00:00
< th scope = "col" class = "text-right" > {{ _("Max time") }}< / th >
< th scope = "col" class = "text-right" > {{ _("Avg. time") }}< / th >
< th scope = "col" class = "text-right" > {{ _("Time range") }}< / th >
< th scope = "col" class = "text-right" > {{ _("SafeSearch") }}< / th >
< th scope = "col" class = "text-right" > {{ _("Selected language") }}< / th >
< th scope = "col" class = "text-right" > {{ _("Shortcut") }}< / th >
< th scope = "col" class = "text-right" > {{ _("Engine name") }}< / th >
< th scope = "col" class = "text-right" > {{ _("Allow") }}< / th >
2015-05-30 10:15:23 +00:00
{% endif %}
< / tr >
2015-04-26 18:09:28 +00:00
{% for search_engine in engines_by_category[categ] %}
{% if not search_engine.private %}
2015-05-30 10:15:23 +00:00
< tr >
2015-04-26 18:09:28 +00:00
{% if not rtl %}
2016-08-07 21:25:27 +00:00
< td class = "onoff-checkbox" >
{{ checkbox_toggle('engine_' + search_engine.name|replace(' ', '_') + '__' + categ|replace(' ', '_'), (search_engine.name, categ) in disabled_engines) }}
< / td >
2020-06-25 13:51:42 +00:00
< th scope = "row" > {{ search_engine.name }}< / th >
2019-12-10 17:10:33 +00:00
< td class = "name" > {{ shortcuts[search_engine.name] }}< / td >
< td > {{ support_toggle(stats[search_engine.name].supports_selected_language) }}< / td >
< td > {{ support_toggle(search_engine.safesearch==True) }}< / td >
< td > {{ support_toggle(search_engine.time_range_support==True) }}< / td >
2020-06-24 13:00:33 +00:00
< td class = "{{ 'danger' if stats[search_engine.name]['warn_time'] else '' }}" > {% if stats[search_engine.name]['warn_time'] %}{{ icon('exclamation-sign')}} {% endif %}{{ 'N/A' if stats[search_engine.name].time==None else stats[search_engine.name].time }}< / td >
< td class = "{{ 'danger' if stats[search_engine.name]['warn_timeout'] else '' }}" > {% if stats[search_engine.name]['warn_timeout'] %}{{ icon('exclamation-sign') }} {% endif %}{{ search_engine.timeout }}< / td >
{% else %}
< td class = "{{ 'danger' if stats[search_engine.name]['warn_timeout'] else '' }}" > {{ search_engine.timeout }}{% if stats[search_engine.name]['warn_time'] %} {{ icon('exclamation-sign')}}{% endif %}< / td >
< td class = "{{ 'danger' if stats[search_engine.name]['warn_time'] else '' }}" > {{ 'N/A' if stats[search_engine.name].time==None else stats[search_engine.name].time }}{% if stats[search_engine.name]['warn_time'] %} {{ icon('exclamation-sign')}}{% endif %}< / td >
2019-12-10 17:10:33 +00:00
< td > {{ support_toggle(search_engine.time_range_support==True) }}< / td >
< td > {{ support_toggle(search_engine.safesearch==True) }}< / td >
< td > {{ support_toggle(stats[search_engine.name].supports_selected_language) }}< / td >
< td > {{ shortcuts[search_engine.name] }}< / td >
2020-06-25 13:51:42 +00:00
< th scope = "row" > {{ search_engine.name }}< / th >
2016-08-07 21:25:27 +00:00
< td class = "onoff-checkbox" >
{{ checkbox_toggle('engine_' + search_engine.name|replace(' ', '_') + '__' + categ|replace(' ', '_'), (search_engine.name, categ) in disabled_engines) }}
< / td >
2015-04-26 18:09:28 +00:00
{% endif %}
2015-05-30 10:15:23 +00:00
< / tr >
2015-04-26 18:09:28 +00:00
{% endif %}
{% endfor %}
2019-12-10 17:10:33 +00:00
< / table >
2015-05-30 10:15:23 +00:00
< / div >
2015-04-26 18:09:28 +00:00
< / fieldset >
< / div >
2014-09-26 19:43:12 +00:00
< / div >
2015-04-26 18:09:28 +00:00
{% endfor %}
2014-09-22 20:42:29 +00:00
< / div >
2014-09-26 19:43:12 +00:00
< / div >
2015-04-26 18:09:28 +00:00
< div class = "tab-pane active_if_nojs" id = "tab_plugins" >
< noscript >
< h3 > {{ _('Plugins') }}< / h3 >
< / noscript >
< fieldset >
2015-04-26 18:14:40 +00:00
< div class = "container-fluid" >
{% for plugin in plugins %}
< div class = "panel panel-default" >
< div class = "panel-heading" >
2016-03-02 16:16:46 +00:00
< h3 class = "panel-title" > {{ _(plugin.name) }}< / h3 >
2015-04-26 18:14:40 +00:00
< / div >
< div class = "panel-body" >
2020-06-25 15:32:05 +00:00
< div class = "col-xs-6 col-sm-4 col-md-6" > < label for = "{{'plugin_' + plugin.id}}" > {{ _(plugin.description) }}< / label > < / div >
2015-04-26 18:14:40 +00:00
< div class = "col-xs-6 col-sm-4 col-md-6" >
2016-08-07 21:25:27 +00:00
< div class = "onoff-checkbox" >
2015-04-26 18:14:40 +00:00
{{ checkbox_toggle('plugin_' + plugin.id, plugin.id not in allowed_plugins) }}
2016-08-07 21:25:27 +00:00
< / div >
2015-04-26 18:14:40 +00:00
< / div >
2015-04-26 18:09:28 +00:00
< / div >
2015-03-11 17:57:36 +00:00
< / div >
2015-04-26 18:14:40 +00:00
{% endfor %}
2015-03-11 17:57:36 +00:00
< / div >
2015-04-26 18:14:40 +00:00
< / fieldset >
< / div >
2015-02-18 17:31:01 +00:00
2016-11-19 19:53:51 +00:00
{% if answerers %}
< div class = "tab-pane active_if_nojs" id = "tab_answerers" >
< noscript >
< h3 > {{ _('Answerers') }}< / h3 >
< / noscript >
2020-05-15 08:16:49 +00:00
< p class = "text-muted" >
2016-11-19 19:53:51 +00:00
{{ _('This is the list of searx\'s instant answering modules.') }}
< / p >
< table class = "table table-striped" >
< tr >
2020-06-28 20:43:37 +00:00
< th { % if rtl % } class = "text-right" { % endif % } > {{ _('Name') }}< / th >
< th { % if rtl % } class = "text-right" { % endif % } > {{ _('Keywords') }}< / th >
< th { % if rtl % } class = "text-right" { % endif % } > {{ _('Description') }}< / th >
< th { % if rtl % } class = "text-right" { % endif % } > {{ _('Examples') }}< / th >
2016-11-19 19:53:51 +00:00
< / tr >
{% for answerer in answerers %}
< tr >
2020-06-28 20:43:37 +00:00
< td > {{ answerer.info.name }}< / td >
< td > {{ answerer.keywords|join(', ') }}< / td >
< td > {{ answerer.info.description }}< / td >
< td > {{ answerer.info.examples|join(', ') }}< / td >
2016-11-19 19:53:51 +00:00
< / tr >
{% endfor %}
< / table >
< / div >
{% endif %}
2015-02-18 17:31:01 +00:00
< div class = "tab-pane active_if_nojs" id = "tab_cookies" >
< noscript >
< h3 > {{ _('Cookies') }}< / h3 >
< / noscript >
2020-05-15 08:16:49 +00:00
< p class = "text-muted" >
2015-02-18 17:31:01 +00:00
{{ _('This is the list of cookies and their values searx is storing on your computer.') }}< br / >
{{ _('With that list, you can assess searx transparency.') }}< br / >
< / p >
2015-06-05 07:07:59 +00:00
{% if cookies %}
< table class = "table table-striped" >
< tr >
2020-06-01 07:18:51 +00:00
< th class = "text-muted{% if rtl %} text-right{% endif %}" > {{ _('Cookie name') }}< / th >
2020-05-31 18:02:58 +00:00
< th class = "text-muted{% if rtl %} text-right{% endif %}" > {{ _('Value') }}< / th >
2015-06-05 07:07:59 +00:00
< / tr >
2015-02-18 17:31:01 +00:00
{% for cookie in cookies %}
2015-06-05 07:07:59 +00:00
< tr >
2020-05-15 08:16:49 +00:00
< td class = "text-muted" > {{ cookie }}< / td >
2015-06-05 07:07:59 +00:00
< td class = "text-muted" > {{ cookies[cookie] }}< / td >
< / tr >
2015-04-26 18:09:28 +00:00
{% endfor %}
2015-06-05 07:07:59 +00:00
< / table >
{% else %}
{% include 'oscar/messages/no_cookies.html' %}
{% endif %}
2015-03-11 17:57:36 +00:00
< / div >
< / div >
2020-05-15 08:16:49 +00:00
< p class = "text-muted" >
{{ _('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.") }}
2015-04-26 18:09:28 +00:00
< / p >
2020-05-15 08:16:49 +00:00
< p >
{{ _('Search URL of the currently saved preferences') }}
< small class = "text-muted" > ({{ _('Note: specifying custom settings in the search URL can reduce privacy by leaking data to the clicked result sites.') }})< / small > :
2017-07-10 10:47:25 +00:00
< / p >
2014-09-22 20:42:29 +00:00
2020-05-15 08:16:49 +00:00
< div class = "tab-pane" >
2020-08-27 12:29:38 +00:00
< input readonly = "" class = "form-control select-all-on-click cursor-text" type = "url" value = "{{ base_url }}?preferences={{ preferences_url_params|e }}{% raw %}&q=%s{% endraw %}" >
2020-05-15 08:16:49 +00:00
< input type = "submit" class = "btn btn-primary" value = "{{ _('save') }}" / >
2015-04-26 18:09:28 +00:00
< a href = "{{ url_for('index') }}" > < div class = "btn btn-default" > {{ _('back') }}< / div > < / a >
< a href = "{{ url_for('clear_cookies') }}" > < div class = "btn btn-default" > {{ _('Reset defaults') }}< / div > < / a >
2020-05-15 08:16:49 +00:00
< / div >
2015-01-16 15:58:44 +00:00
< / form >
2014-09-22 20:42:29 +00:00
< / div >
{% endblock %}