mirror of
https://github.com/janeczku/calibre-web
synced 2024-11-24 18:47:23 +00:00
Revert "post" as search request. Search request is now get again (fix for #2741)
Revert "Auxiliary commit to revert individual files from 275675b48add79d2bbce06426cc1224c5e2c1bfb" This reverts commit 6c920bc49f133d5c7451230448121f1f8b3cd9f2.
This commit is contained in:
parent
13c0d30a8f
commit
592216588c
@ -35,13 +35,12 @@ search = Blueprint('search', __name__)
|
||||
log = logger.create()
|
||||
|
||||
|
||||
@search.route("/search", methods=["POST"])
|
||||
@search.route("/search", methods=["GET"])
|
||||
@login_required_if_no_ano
|
||||
def simple_search():
|
||||
term = dict(request.form).get("query")
|
||||
term = request.args.get("query")
|
||||
if term:
|
||||
flask_session['query'] = json.dumps(term.strip())
|
||||
return redirect(url_for('web.books_list', data="search", sort_param='stored', query="")) # term.strip()
|
||||
return redirect(url_for('web.books_list', data="search", sort_param='stored', query=term.strip()))
|
||||
else:
|
||||
return render_title_template('search.html',
|
||||
searchterm="",
|
||||
|
@ -41,8 +41,7 @@
|
||||
<div class="plexBack"><a href="{{url_for('web.index')}}"></a></div>
|
||||
{% endif %}
|
||||
{% if current_user.is_authenticated or g.allow_anonymous %}
|
||||
<form class="navbar-form navbar-left" role="search" action="{{url_for('search.simple_search')}}" method="POST">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
||||
<form class="navbar-form navbar-left" role="search" action="{{url_for('search.simple_search')}}" method="GET">
|
||||
<div class="form-group input-group input-group-sm">
|
||||
<label for="query" class="sr-only">{{_('Search')}}</label>
|
||||
<input type="text" class="form-control" id="query" name="query" placeholder="{{_('Search Library')}}" value="{{searchterm}}">
|
||||
|
@ -396,7 +396,7 @@ def render_books_list(data, sort_param, book_id, page):
|
||||
elif data == "archived":
|
||||
return render_archived_books(page, order)
|
||||
elif data == "search":
|
||||
term = json.loads(flask_session.get('query', ''))
|
||||
term = (request.args.get('query') or '')
|
||||
offset = int(int(config.config_books_per_page) * (page - 1))
|
||||
return render_search_results(term, offset, order, config.config_books_per_page)
|
||||
elif data == "advsearch":
|
||||
|
Loading…
Reference in New Issue
Block a user