logo

searx

My custom branche(s) on searx, a meta-search engine
commit: 6f73f4e7a41b957bf74494613d035f9140f5f906
parent: 79b3de5185bd2a561ffcfd9a1120481af4e8bb91
Author: Adam Tauber <asciimoo@gmail.com>
Date:   Tue,  7 Apr 2015 18:09:38 +0200

[fix] ordered categories in preferences - closes #258

Diffstat:

Msearx/templates/courgette/preferences.html4++--
Msearx/templates/default/preferences.html4++--
Msearx/templates/oscar/preferences.html6+++---
Msearx/webapp.py2+-
4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/searx/templates/courgette/preferences.html b/searx/templates/courgette/preferences.html @@ -101,8 +101,8 @@ <th>{{ _('Category') }}</th> <th>{{ _('Allow') }} / {{ _('Block') }}</th> </tr> - {% 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 %} <tr> diff --git a/searx/templates/default/preferences.html b/searx/templates/default/preferences.html @@ -89,8 +89,8 @@ <th>{{ _('Category') }}</th> <th>{{ _('Allow') }} / {{ _('Block') }}</th> </tr> - {% 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 %} <tr> diff --git a/searx/templates/oscar/preferences.html b/searx/templates/oscar/preferences.html @@ -116,7 +116,7 @@ <!-- Nav tabs --> <ul class="nav nav-tabs nav-justified hide_if_nojs" role="tablist" style="margin-bottom:20px;"> - {% for (categ,search_engines) in categs %} + {% for categ in categories %} <li{% if loop.first %} class="active"{% endif %}><a href="#tab_engine_{{ categ|replace(' ', '_') }}" role="tab" data-toggle="tab">{{ _(categ) }}</a></li> {% endfor %} </ul> @@ -127,13 +127,13 @@ <!-- Tab panes --> <div class="tab-content"> - {% for (categ,search_engines) in categs %} + {% for categ in categories %} <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> - {% for search_engine in search_engines %} + {% for search_engine in engines_by_category[categ] %} {% if not search_engine.private %} <div class="row"> {% if not rtl %} diff --git 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()},