Fix latest pagination

This commit is contained in:
Michel Roux 2019-12-15 18:53:19 +01:00
parent dce9c4838a
commit aaf6df48cf
2 changed files with 4 additions and 5 deletions

5
app.py
View File

@ -55,9 +55,8 @@ def search():
@app.route('/latest')
def latest():
page = request.args.get('page', 1)
@app.route('/latest/<int:page>')
def latest(page=1):
torrents = [
Nyaa('', return_type=ConnectorReturn.HISTORY, page=page).run(),
Pantsu('', return_type=ConnectorReturn.HISTORY, page=page).run(),

View File

@ -70,11 +70,11 @@
<nav class="pagination is-right" role="navigation" aria-label="pagination">
{% if page > 1 %}
<a class="pagination-previous" href="{{ url_for('latest', q=request.args.get('q'), page=(page - 1)) }}">
<a class="pagination-previous" href="{{ url_for('latest', page=(page - 1)) }}">
Previous
</a>
{% endif %}
<a class="pagination-next" href="{{ url_for('latest', q=request.args.get('q'), page=(page + 1)) }}">
<a class="pagination-next" href="{{ url_for('latest', page=(page + 1)) }}">
Next page
</a>
<ul class="pagination-list"></ul>