paginated authors

This commit is contained in:
Sebastian Hugentobler 2024-05-06 13:51:49 +02:00
parent 352d4e0a7a
commit ead3672570
Signed by: shu
GPG key ID: BB32CF3CA052C2F0
12 changed files with 175 additions and 23 deletions

View file

@ -0,0 +1,19 @@
{% extends "base" %}
{% block title %}
{% if has_previous %}
<a href="/authors/{{ backward_cursor }}/DESC">← back</a>
{% endif %}
{% if has_previous and has_more %}|{% endif%}
{% if has_more %}
<a href="/authors/{{ forward_cursor }}/ASC">more →</a>
{% endif %}
{% endblock title %}
{% block content %}
<div class="grid-container">
{% for author in authors %}
<article>{{ author.name }}</article>
{% endfor %}
</div>
{% endblock content %}

View file

@ -9,18 +9,20 @@
<title>Rusty Library</title>
</head>
<body>
<main class="container">
<header class="container fixed">
<nav>
<ul>
<li><strong>Library</strong></li>
<li>{% block title %}<strong>{{ title }}</strong>{% endblock title %}</li>
</ul>
<ul>
<li><a href="/">Recent</a></li>
<li><a href="/authors">Authors</a></li>
<li><a href="/books">Books</a></li>
<li><a href="/series">Series</a></li>
<li {% if nav == "recent" %}class = "nav-active"{% endif %}><a href="/">Recent</a></li>
<li {% if nav == "authors" %}class = "nav-active"{% endif %}><a href="/authors">Authors</a></li>
<li {% if nav == "books" %}class = "nav-active"{% endif %}><a href="/books">Books</a></li>
<li {% if nav == "series" %}class = "nav-active"{% endif %}><a href="/series">Series</a></li>
</ul>
</nav>
</header>
<main class="container">
{% block content %}{% endblock content %}
</main>
</body>

View file

@ -1,6 +1,5 @@
{% extends "base" %}
{% block content %}
<h1>Recent Books</h1>
<div class="grid-container">
{% for book in books %}
{% include "book_card" %}