mirror of https://github.com/searx/searx
Merge 68a6b386d0
into 276ffd3f01
This commit is contained in:
commit
0fa0511db0
|
@ -389,6 +389,16 @@
|
||||||
<small class="text-muted">({{ _('Note: specifying custom settings in the search URL can reduce privacy by leaking data to the clicked result sites.') }})</small>:
|
<small class="text-muted">({{ _('Note: specifying custom settings in the search URL can reduce privacy by leaking data to the clicked result sites.') }})</small>:
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-1" style="margin-right: 2rem;">
|
||||||
|
{{- checkbox_toggle("save_preferences", cookies["save_preferences"] != "on") -}}
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-10">
|
||||||
|
<p> Save my preferences with cookies </p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="tab-pane">
|
<div class="tab-pane">
|
||||||
<input readonly="" class="form-control select-all-on-click cursor-text" type="url" value="{{ url_for('index', _external=True) }}?preferences={{ preferences_url_params|e }}{% raw %}&q=%s{% endraw %}">
|
<input readonly="" class="form-control select-all-on-click cursor-text" type="url" value="{{ url_for('index', _external=True) }}?preferences={{ preferences_url_params|e }}{% raw %}&q=%s{% endraw %}">
|
||||||
<input type="submit" class="btn btn-primary" value="{{ _('save') }}" />
|
<input type="submit" class="btn btn-primary" value="{{ _('save') }}" />
|
||||||
|
|
|
@ -731,7 +731,7 @@ def search():
|
||||||
},
|
},
|
||||||
result_container.corrections))
|
result_container.corrections))
|
||||||
#
|
#
|
||||||
return render(
|
rendered_page = render(
|
||||||
'results.html',
|
'results.html',
|
||||||
results=results,
|
results=results,
|
||||||
q=request.form['q'],
|
q=request.form['q'],
|
||||||
|
@ -754,6 +754,14 @@ def search():
|
||||||
favicons=global_favicons[themes.index(get_current_theme_name())],
|
favicons=global_favicons[themes.index(get_current_theme_name())],
|
||||||
timeout_limit=request.form.get('timeout_limit', None)
|
timeout_limit=request.form.get('timeout_limit', None)
|
||||||
)
|
)
|
||||||
|
resp = make_response(rendered_page)
|
||||||
|
if __should_save_preferences(request):
|
||||||
|
request.preferences.save(resp)
|
||||||
|
return resp
|
||||||
|
|
||||||
|
|
||||||
|
def __should_save_preferences(request):
|
||||||
|
return request.form.get('preferences') and request.form.get('save_preferences') != 'on'
|
||||||
|
|
||||||
|
|
||||||
def __get_translated_errors(unresponsive_engines):
|
def __get_translated_errors(unresponsive_engines):
|
||||||
|
|
Loading…
Reference in New Issue