Add preference for displaying advanced settings

This commit is contained in:
renyhp 2020-11-22 18:00:21 +01:00
parent 2fc3b17c85
commit b00f77059c
3 changed files with 22 additions and 0 deletions

View file

@ -545,6 +545,9 @@ def index_error(output_format, error_message):
def index():
"""Render index page."""
# UI
advanced_search = request.form.get('advanced_search', request.preferences.get_value('advanced_search'))
# redirect to search if there's a query in the request
if request.form.get('q'):
query = ('?' + request.query_string.decode()) if request.query_string else ''
@ -553,6 +556,7 @@ def index():
return render(
'index.html',
selected_categories=get_selected_categories(request.preferences, request.form),
advanced_search=advanced_search,
)