From 6f73f4e7a41b957bf74494613d035f9140f5f906 Mon Sep 17 00:00:00 2001 From: Adam Tauber Date: Tue, 7 Apr 2015 18:09:38 +0200 Subject: [PATCH] [fix] ordered categories in preferences - closes #258 --- searx/templates/courgette/preferences.html | 4 ++-- searx/templates/default/preferences.html | 4 ++-- searx/templates/oscar/preferences.html | 6 +++--- searx/webapp.py | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/searx/templates/courgette/preferences.html b/searx/templates/courgette/preferences.html index c25385bc8..2afb74d11 100644 --- a/searx/templates/courgette/preferences.html +++ b/searx/templates/courgette/preferences.html @@ -101,8 +101,8 @@ {{ _('Category') }} {{ _('Allow') }} / {{ _('Block') }} - {% for (categ,search_engines) in categs %} - {% for search_engine in search_engines %} + {% for categ in categories %} + {% for search_engine in engines_by_category[categ] %} {% if not search_engine.private %} diff --git a/searx/templates/default/preferences.html b/searx/templates/default/preferences.html index ae3f058e4..0afe9f7d0 100644 --- a/searx/templates/default/preferences.html +++ b/searx/templates/default/preferences.html @@ -89,8 +89,8 @@ {{ _('Category') }} {{ _('Allow') }} / {{ _('Block') }} - {% for (categ,search_engines) in categs %} - {% for search_engine in search_engines %} + {% for categ in categories %} + {% for search_engine in engines_by_category[categ] %} {% if not search_engine.private %} diff --git a/searx/templates/oscar/preferences.html b/searx/templates/oscar/preferences.html index acb89741e..9beb21009 100644 --- a/searx/templates/oscar/preferences.html +++ b/searx/templates/oscar/preferences.html @@ -116,7 +116,7 @@ @@ -127,13 +127,13 @@
- {% for (categ,search_engines) in categs %} + {% for categ in categories %}
- {% for search_engine in search_engines %} + {% for search_engine in engines_by_category[categ] %} {% if not search_engine.private %}
{% if not rtl %} diff --git a/searx/webapp.py b/searx/webapp.py index eca68d271..5530becc1 100644 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -607,7 +607,7 @@ def preferences(): current_language=lang or 'all', image_proxy=image_proxy, language_codes=language_codes, - categs=categories.items(), + engines_by_category=categories, blocked_engines=blocked_engines, autocomplete_backends=autocomplete_backends, shortcuts={y: x for x, y in engine_shortcuts.items()},