commit: 16a86416492cd8c0a44116a0195e7c5a3f25a8d6
parent 128b5245ab7a9d54b24a59e91f02c4a54a21ed81
Author: Noemi Vanyi <sitbackandwait@gmail.com>
Date: Mon, 25 Jul 2016 22:47:55 +0200
advanced-search: panel is visible when checked before
Diffstat:
3 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/searx/search.py b/searx/search.py
@@ -139,6 +139,7 @@ class Search(object):
self.pageno = 1
self.lang = 'all'
self.time_range = None
+ self.is_advanced = None
# set blocked engines
self.disabled_engines = request.preferences.engines.get_disabled()
@@ -180,6 +181,7 @@ class Search(object):
self.lang = query_obj.languages[-1]
self.time_range = self.request_data.get('time_range')
+ self.is_advanced = self.request_data.get('advanced_search')
self.engines = query_obj.engines
@@ -298,6 +300,7 @@ class Search(object):
# 0 = None, 1 = Moderate, 2 = Strict
request_params['safesearch'] = request.preferences.get_value('safesearch')
request_params['time_range'] = self.time_range
+ request_params['advanced_search'] = self.is_advanced
# update request parameters dependent on
# search-engine (contained in engines folder)
diff --git a/searx/templates/oscar/advanced.html b/searx/templates/oscar/advanced.html
@@ -1,5 +1,5 @@
<div class="input-group col-sm-12 advanced">
- <input type="checkbox" id="check-advanced">
+ <input type="checkbox" name="advanced_search" id="check-advanced" {% if advanced_search %} checked="checked"{% endif %}>
<label for="check-advanced">
<span class="glyphicon glyphicon-cog"></span>
{{ _('Advanced settings') }}
diff --git a/searx/webapp.py b/searx/webapp.py
@@ -459,6 +459,7 @@ def index():
paging=search.paging,
number_of_results=format_decimal(number_of_results),
pageno=search.pageno,
+ advanced_search=search.is_advanced,
time_range=search.time_range,
base_url=get_base_url(),
suggestions=search.result_container.suggestions,