Fix request search when is empty
This commit is contained in:
parent
de5510d3e3
commit
49d823e135
@ -63,7 +63,7 @@ def get_search_json(query, page, autocorrect, sort, filters):
|
|||||||
def get_search_page():
|
def get_search_page():
|
||||||
query = request.args.get('search_query') or request.args.get('query')
|
query = request.args.get('search_query') or request.args.get('query')
|
||||||
if query is None:
|
if query is None:
|
||||||
return flask.render_template('base.html', title='Search')
|
return flask.render_template('home.html', title='Search')
|
||||||
|
|
||||||
page = request.args.get("page", "1")
|
page = request.args.get("page", "1")
|
||||||
autocorrect = int(request.args.get("autocorrect", "1"))
|
autocorrect = int(request.args.get("autocorrect", "1"))
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
</nav>
|
</nav>
|
||||||
<form class="form" id="site-search" action="/youtube.com/results">
|
<form class="form" id="site-search" action="/youtube.com/results">
|
||||||
<input type="search" name="search_query" class="search-box" value="{{ search_box_value }}"
|
<input type="search" name="search_query" class="search-box" value="{{ search_box_value }}"
|
||||||
{{ "autofocus" if request.path == "/" else "" }} placeholder="Type to search...">
|
{{ "autofocus" if request.path == "/" else "" }} required placeholder="Type to search...">
|
||||||
<button type="submit" value="Search" class="search-button">Search</button>
|
<button type="submit" value="Search" class="search-button">Search</button>
|
||||||
<!-- options -->
|
<!-- options -->
|
||||||
<div class="dropdown">
|
<div class="dropdown">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user