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>
2020-03-17 00:29:37 +00:00
{% include 'snippets/book_cover.html' with book=book size="small" %}
2020-02-22 00:03:05 +00:00
</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>
2020-03-10 00:55:15 +00:00
{{ book.authors.first.name }}
2020-02-22 00:03:05 +00:00
</td>
<td>
2020-03-10 00:55:15 +00:00
{% if book.first_published_date %}{{ book.first_published_date }}{% endif %}
2020-02-22 00:03:05 +00:00
</td>
<td>
2020-03-10 00:55:15 +00:00
{{ book.created_date | naturalday }}
2020-02-22 00:03:05 +00:00
</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 %}