Fix latest pagination
This commit is contained in:
parent
dce9c4838a
commit
aaf6df48cf
5
app.py
5
app.py
@ -55,9 +55,8 @@ def search():
|
|||||||
|
|
||||||
|
|
||||||
@app.route('/latest')
|
@app.route('/latest')
|
||||||
def latest():
|
@app.route('/latest/<int:page>')
|
||||||
page = request.args.get('page', 1)
|
def latest(page=1):
|
||||||
|
|
||||||
torrents = [
|
torrents = [
|
||||||
Nyaa('', return_type=ConnectorReturn.HISTORY, page=page).run(),
|
Nyaa('', return_type=ConnectorReturn.HISTORY, page=page).run(),
|
||||||
Pantsu('', return_type=ConnectorReturn.HISTORY, page=page).run(),
|
Pantsu('', return_type=ConnectorReturn.HISTORY, page=page).run(),
|
||||||
|
@ -70,11 +70,11 @@
|
|||||||
|
|
||||||
<nav class="pagination is-right" role="navigation" aria-label="pagination">
|
<nav class="pagination is-right" role="navigation" aria-label="pagination">
|
||||||
{% if page > 1 %}
|
{% 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
|
Previous
|
||||||
</a>
|
</a>
|
||||||
{% endif %}
|
{% 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
|
Next page
|
||||||
</a>
|
</a>
|
||||||
<ul class="pagination-list"></ul>
|
<ul class="pagination-list"></ul>
|
||||||
|
Reference in New Issue
Block a user