paginated authors
This commit is contained in:
parent
352d4e0a7a
commit
ead3672570
12 changed files with 175 additions and 23 deletions
19
rusty-library/templates/authors.html
Normal file
19
rusty-library/templates/authors.html
Normal 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 %}
|
|
@ -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>
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
{% extends "base" %}
|
||||
{% block content %}
|
||||
<h1>Recent Books</h1>
|
||||
<div class="grid-container">
|
||||
{% for book in books %}
|
||||
{% include "book_card" %}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue