moviewyrm/fedireads/templates/snippets/shelf.html

62 lines
1.2 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>
<a href="/book/{{ book.fedireads_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>
<a href="https://openlibrary.org/book/{{ book.openlibrary_key }}" target="_blank">OpenLibrary</a>
2020-02-22 00:03:05 +00:00
</td>
{% if ratings %}
<td>
{% include 'snippets/stars.html' with rating=ratings|dict_key:book.id %}
2020-02-22 00:03:05 +00:00
</td>
{% endif %}
</tr>
{% endfor %}
</table>
{% else %}
<p>This shelf is empty.</p>
{% endif %}