moviewyrm/fedireads/templates/snippets/shelf.html

62 lines
1.1 KiB
HTML
Raw Normal View History

2020-02-22 00:03:05 +00:00
{% load humanize %}
{% load fr_display %}
{% if shelf.books %}
<table>
<tr class="book-preview">
<th>
Cover
</th>
<th>
Title
</th>
<th>
Author
</th>
<th>
Published
</th>
<th>
Shelved
</th>
<th>
External links
</th>
{% if ratings %}
<th>
Rating
</th>
{% endif %}
</tr>
{% for book in shelf.books.all %}
<tr class="book-preview">
<td>
{% include 'snippets/book_cover.html' with book=book %}
</td>
<td>
2020-03-07 06:56:44 +00:00
<a href="/book/{{ book.openlibrary_key }}">{{ book.title }}</a>
2020-02-22 00:03:05 +00:00
</td>
<td>
{{ book.authors.first.data.name }}
</td>
<td>
2020-03-07 06:56:44 +00:00
{{ book.first_publish_date }}
2020-02-22 00:03:05 +00:00
</td>
<td>
{{ book.added_date | naturalday }}
</td>
<td>
2020-03-07 06:56:44 +00:00
<a href="https://openlibrary.org{{ book.key }}" target="_blank">OpenLibrary</a>
2020-02-22 00:03:05 +00:00
</td>
{% if ratings %}
<td>
{{ ratings | dict_key:book.id | stars}}
</td>
{% endif %}
</tr>
{% endfor %}
</table>
{% else %}
<p>This shelf is empty.</p>
{% endif %}