paginate books

This commit is contained in:
Sebastian Hugentobler 2024-05-06 14:42:14 +02:00
parent 6d949bb21e
commit 6a79f0c1ed
Signed by: shu
GPG key ID: BB32CF3CA052C2F0
10 changed files with 99 additions and 13 deletions

View file

@ -0,0 +1,8 @@
{% extends "base" %}
{% block content %}
<div class="grid-container">
{% for book in books %}
{% include "book_card" %}
{% endfor %}
</div>
{% endblock content %}

View file

@ -1,8 +1,19 @@
{% extends "base" %}
{% block title %}
{% if has_previous %}
<a class="secondary" href="/books/{{ backward_cursor }}/DESC">← back</a>
{% endif %}
{% if has_previous and has_more %}|{% endif%}
{% if has_more %}
<a class="secondary" href="/books/{{ forward_cursor }}/ASC">more →</a>
{% endif %}
{% endblock title %}
{% block content %}
<div class="grid-container">
{% for book in books %}
{% include "book_card" %}
{% include "book_card" %}
{% endfor %}
</div>
{% endblock content %}