- {{- checkbox_onoff('plugin_' + plugin.id, plugin.id not in allowed_plugins) -}}
+ {{- checkbox_onoff_reversed('plugin_' + plugin.id, plugin.id not in allowed_plugins) -}}
{{- '' -}}
{{- _(plugin.description) -}}
@@ -19,427 +52,190 @@
{%- endfor -%}
{%- endmacro -%}
-{% macro engine_about(search_engine) -%}
-{% if search_engine.about is defined %}
-{% set about = search_engine.about %}
-
{%- endif -%}
-{%- endmacro %}
+{%- endmacro -%}
{%- macro engine_time(engine_name) -%}
-
{{- "" -}}
+ | {{- '' -}}
{%- if stats[engine_name].time != None -%}
- {{- stats[engine_name].time -}}{{- "" -}}
+ {{- stats[engine_name].time -}}{{- '' -}}
{%- if max_rate95 is not none and max_rate95 > 0 -%}
- {{- "" -}}
- {{- "" -}}
- {{- "" -}}
+ {{- '' -}}
+ {{- '' -}}
+ {{- '' -}}
{%- endif -%}
- {{- "" -}}
- {{- "" -}}
- {{ _('Median') }}: {{ stats[engine_name].time }} {{- "" -}}
- {{ _('P80') }}: {{ stats[engine_name].rate80 }} {{- "" -}}
- {{ _('P95') }}: {{ stats[engine_name].rate95 }} {{- "" -}}
+ {{- '' -}}
+ {{- '' -}}
+ {{ _('Median') }}: {{ stats[engine_name].time }} {{- '' -}}
+ {{ _('P80') }}: {{ stats[engine_name].rate80 }} {{- '' -}}
+ {{ _('P95') }}: {{ stats[engine_name].rate95 }} {{- '' -}}
- {%- endif -%}
- |
+ {%- endif -%}
+
{%- endmacro -%}
{%- macro engine_reliability(engine_name) -%}
-{% set r = reliabilities.get(engine_name, {}).get('reliablity', None) %}
-{% set checker_result = reliabilities.get(engine_name, {}).get('checker', []) %}
-{% set errors = reliabilities.get(engine_name, {}).get('errors', []) %}
-{% if r != None %}
- {% if r <= 50 %}{% set label = 'danger' %}
- {% elif r < 80 %}{% set label = 'warning' %}
- {% elif r < 90 %}{% set label = '' %}
- {% else %}{% set label = 'success' %}
- {% endif %}
-{% else %}
- {% set r = '' %}
-{% endif %}
-{% if checker_result or errors %}
-
{{- "" -}}
- {{- "" -}}
-
- {{ icon_big('warning', 'The engine is not reliabled') }} {{ r -}}
- {{- "" -}}
- {{- "" -}}
- {{- '' -}}
+ |
+ {%- else -%}
+
{% if r %}{{ r }}
+ {%- endif -%}
+ |
+ {%- endif -%}
{%- endmacro -%}
-{% block head %} {% endblock %}
-{% block linkto_preferences %}{% endblock %}
-{% block content %}
-
{{ _('Preferences') }}
+{%- block head -%}{%- endblock -%}
+{%- block linkto_preferences -%}{%- endblock -%}
-
-{% endblock %}
+ {{- tabs_close() -}}
+ {%- include 'simple/preferences/footer.html' -%}
+
+ {{- '' -}}
+{%- endblock -%}
diff --git a/searx/templates/simple/preferences/answerers.html b/searx/templates/simple/preferences/answerers.html
new file mode 100644
index 000000000..b2770c2f5
--- /dev/null
+++ b/searx/templates/simple/preferences/answerers.html
@@ -0,0 +1,43 @@
+
{{- '' -}}
diff --git a/searx/templates/simple/preferences/autocomplete.html b/searx/templates/simple/preferences/autocomplete.html
new file mode 100644
index 000000000..17ee22953
--- /dev/null
+++ b/searx/templates/simple/preferences/autocomplete.html
@@ -0,0 +1,17 @@
+
{{- '' -}}
diff --git a/searx/templates/simple/preferences/center_alignment.html b/searx/templates/simple/preferences/center_alignment.html
new file mode 100644
index 000000000..983a3957b
--- /dev/null
+++ b/searx/templates/simple/preferences/center_alignment.html
@@ -0,0 +1,12 @@
+
{{- '' -}}
diff --git a/searx/templates/simple/preferences/cookies.html b/searx/templates/simple/preferences/cookies.html
new file mode 100644
index 000000000..f84251ef6
--- /dev/null
+++ b/searx/templates/simple/preferences/cookies.html
@@ -0,0 +1,45 @@
+
+ {{- _('This is the list of cookies and their values SearXNG is storing on your computer.') }}
+
{{- _('With that list, you can assess SearXNG transparency.') -}}
+
{{- '' -}}
+
+{% if cookies %}
+
+ {{- '' -}}
+ {{ _('Cookie name') }} | {{- '' -}}
+ {{ _('Value') }} | {{- '' -}}
+
+ {%- for cookie in cookies -%}
+ {{- '' -}}
+ {{ cookie }} | {{- '' -}}
+ {{ cookies[cookie] }} | {{- '' -}}
+
+ {%- endfor -%}
+
+{%- else -%}
+ {% include 'simple/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.') -}}
+
+
+ {{- _('URL to restore your preferences in another browser') -}}:{{- '' -}}
+
{{- '' -}}
+
{{- '' -}}
+
+ {{- url_for('preferences', _external=True) -}}?preferences={{- preferences_url_params|e -}}
+ &save=1{{- '' -}}
+
{{- '' -}}
+
{{- '' -}}
+
+ {{- _('Specifying custom settings in the preferences URL can be used to sync preferences across devices.') -}}
+
diff --git a/searx/templates/simple/preferences/doi_resolver.html b/searx/templates/simple/preferences/doi_resolver.html
new file mode 100644
index 000000000..a53e964f9
--- /dev/null
+++ b/searx/templates/simple/preferences/doi_resolver.html
@@ -0,0 +1,16 @@
+
{{- '' -}}
diff --git a/searx/templates/simple/preferences/engines.html b/searx/templates/simple/preferences/engines.html
new file mode 100644
index 000000000..66610024f
--- /dev/null
+++ b/searx/templates/simple/preferences/engines.html
@@ -0,0 +1,93 @@
+{%- set ns = namespace(checked=true) -%}
+{%- for categ in categories_as_tabs + [DEFAULT_CATEGORY] -%}
+
+ {{- tab_header('enginetab', 'category_' + categ, _(categ), ns.checked ) -}}
+
+ {%- set ns.checked = false -%}
+ {%- if categ == DEFAULT_CATEGORY -%}
+
+ {{- _('This tab does not exists in the user interface, but you can search in these engines by its !bangs.') -}}
+ {{- ' ' -}}ⓘ
+
+ {%- endif -%}
+
+
+ {{- tab_footer() -}}
+
+{%- endfor -%}
diff --git a/searx/templates/simple/preferences/footer.html b/searx/templates/simple/preferences/footer.html
new file mode 100644
index 000000000..57a0ddaf8
--- /dev/null
+++ b/searx/templates/simple/preferences/footer.html
@@ -0,0 +1,14 @@
+
+ {{- _('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/preferences/image_proxy.html b/searx/templates/simple/preferences/image_proxy.html
new file mode 100644
index 000000000..c636a3172
--- /dev/null
+++ b/searx/templates/simple/preferences/image_proxy.html
@@ -0,0 +1,12 @@
+
{{- '' -}}
diff --git a/searx/templates/simple/preferences/infinite_scroll.html b/searx/templates/simple/preferences/infinite_scroll.html
new file mode 100644
index 000000000..df91b5f2e
--- /dev/null
+++ b/searx/templates/simple/preferences/infinite_scroll.html
@@ -0,0 +1,12 @@
+
{{- '' -}}
diff --git a/searx/templates/simple/preferences/language.html b/searx/templates/simple/preferences/language.html
new file mode 100644
index 000000000..809c516df
--- /dev/null
+++ b/searx/templates/simple/preferences/language.html
@@ -0,0 +1,27 @@
+
{{- '' -}}
diff --git a/searx/templates/simple/preferences/method.html b/searx/templates/simple/preferences/method.html
new file mode 100644
index 000000000..0e44b6435
--- /dev/null
+++ b/searx/templates/simple/preferences/method.html
@@ -0,0 +1,16 @@
+
{{- '' -}}
diff --git a/searx/templates/simple/preferences/query_in_title.html b/searx/templates/simple/preferences/query_in_title.html
new file mode 100644
index 000000000..12d0e5577
--- /dev/null
+++ b/searx/templates/simple/preferences/query_in_title.html
@@ -0,0 +1,12 @@
+
{{- '' -}}
diff --git a/searx/templates/simple/preferences/results_on_new_tab.html b/searx/templates/simple/preferences/results_on_new_tab.html
new file mode 100644
index 000000000..c0d6c51a5
--- /dev/null
+++ b/searx/templates/simple/preferences/results_on_new_tab.html
@@ -0,0 +1,12 @@
+
{{- '' -}}
diff --git a/searx/templates/simple/preferences/safesearch.html b/searx/templates/simple/preferences/safesearch.html
new file mode 100644
index 000000000..1e33da3c8
--- /dev/null
+++ b/searx/templates/simple/preferences/safesearch.html
@@ -0,0 +1,22 @@
+
{{- '' -}}
diff --git a/searx/templates/simple/preferences/theme.html b/searx/templates/simple/preferences/theme.html
new file mode 100644
index 000000000..f75bb24b7
--- /dev/null
+++ b/searx/templates/simple/preferences/theme.html
@@ -0,0 +1,35 @@
+
{{- '' -}}
+
+
{{- '' -}}
+
+{%- include 'simple/preferences/center_alignment.html' -%}
diff --git a/searx/templates/simple/preferences/tokens.html b/searx/templates/simple/preferences/tokens.html
new file mode 100644
index 000000000..11d85c75f
--- /dev/null
+++ b/searx/templates/simple/preferences/tokens.html
@@ -0,0 +1,11 @@
+
{{- '' -}}
diff --git a/searx/templates/simple/preferences/ui_locale.html b/searx/templates/simple/preferences/ui_locale.html
new file mode 100644
index 000000000..99f79cc8b
--- /dev/null
+++ b/searx/templates/simple/preferences/ui_locale.html
@@ -0,0 +1,16 @@
+
{{- '' -}}
diff --git a/tests/unit/test_webapp.py b/tests/unit/test_webapp.py
index 9f10df908..1c8f8a403 100644
--- a/tests/unit/test_webapp.py
+++ b/tests/unit/test_webapp.py
@@ -201,7 +201,7 @@ class ViewsTestCase(SearxTestCase):
self.assertIn(
b'
', result.data
)
- self.assertIn(b'
', result.data)
+ self.assertIn(b'
', result.data)
def test_browser_locale(self):
result = self.app.get('/preferences', headers={'Accept-Language': 'zh-tw;q=0.8'})