mirror of
https://github.com/searxng/searxng.git
synced 2025-07-19 03:09:25 +02:00
Merge pull request #61 from matejc/optional_search_get
Optional search get
This commit is contained in:
commit
44d3af9fb2
5 changed files with 30 additions and 6 deletions
|
@ -123,6 +123,8 @@ def render(template_name, **kwargs):
|
|||
if not 'autocomplete' in kwargs:
|
||||
kwargs['autocomplete'] = autocomplete
|
||||
|
||||
kwargs['method'] = request.cookies.get('method', 'POST')
|
||||
|
||||
return render_template(template_name, **kwargs)
|
||||
|
||||
|
||||
|
@ -291,6 +293,7 @@ def preferences():
|
|||
selected_categories = []
|
||||
locale = None
|
||||
autocomplete = ''
|
||||
method = 'POST'
|
||||
for pd_name, pd in request.form.items():
|
||||
if pd_name.startswith('category_'):
|
||||
category = pd_name[9:]
|
||||
|
@ -305,6 +308,8 @@ def preferences():
|
|||
pd in (x[0] for
|
||||
x in language_codes)):
|
||||
lang = pd
|
||||
elif pd_name == 'method':
|
||||
method = pd
|
||||
elif pd_name.startswith('engine_'):
|
||||
engine_name = pd_name.replace('engine_', '', 1)
|
||||
if engine_name in engines:
|
||||
|
@ -344,6 +349,8 @@ def preferences():
|
|||
max_age=cookie_max_age
|
||||
)
|
||||
|
||||
resp.set_cookie('method', method, max_age=cookie_max_age)
|
||||
|
||||
return resp
|
||||
return render('preferences.html',
|
||||
locales=settings['locales'],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue