paginate books
This commit is contained in:
parent
6d949bb21e
commit
6a79f0c1ed
10 changed files with 99 additions and 13 deletions
8
rusty-library/templates/book_list.html
Normal file
8
rusty-library/templates/book_list.html
Normal file
|
@ -0,0 +1,8 @@
|
|||
{% extends "base" %}
|
||||
{% block content %}
|
||||
<div class="grid-container">
|
||||
{% for book in books %}
|
||||
{% include "book_card" %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endblock content %}
|
|
@ -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 %}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue