Adds "all books" view"

This commit is contained in:
Mouse Reeve
2021-03-31 10:23:20 -07:00
parent 2fd917a6cc
commit a670c8d366
4 changed files with 27 additions and 34 deletions

View File

@ -20,10 +20,13 @@
<div class="column">
<div class="tabs">
<ul>
<li class="{% if shelf.identifier == 'all' %}is-active{% endif %}">
<a href="{% url 'user-shelves' user|username %}"{% if shelf.identifier == 'all' %} aria-current="page"{% endif %}>{% trans "All books" %}</a>
</li>
{% for shelf_tab in shelves %}
<li class="{% if shelf_tab.identifier == shelf.identifier %}is-active{% endif %}">
<a href="{{ shelf_tab.local_path }}"{% if shelf_tab.identifier == shelf.identifier %} aria-current="page"{% endif %}>{% if shelf_tab.identifier == 'to-read' %}{% trans "To Read" %}{% elif shelf_tab.identifier == 'reading' %}{% trans "Currently Reading" %}{% elif shelf_tab.identifier == 'read' %}{% trans "Read" %}{% else %}{{ shelf_tab.name }}{% endif %}</a>
</li>
</li>
{% endfor %}
</ul>
</div>
@ -81,7 +84,6 @@
{% endif %}
</tr>
{% for book in books %}
{% with book=book.book %}
<tr class="book-preview">
<td>
<a href="{{ book.local_path }}">{% include 'snippets/book_cover.html' with book=book size="small" %}</a>
@ -113,13 +115,12 @@
</td>
{% endif %}
</tr>
{% endwith %}
{% endfor %}
</table>
</div>
{% else %}
<p>{% trans "This shelf is empty." %}</p>
{% if shelf.editable %}
{% if shelf.id and shelf.editable %}
<form name="delete-shelf" action="/delete-shelf/{{ shelf.id }}" method="post">
{% csrf_token %}
<input type="hidden" name="user" value="{{ request.user.id }}">