moviewyrm/bookwyrm/templates/snippets/shelf.html

81 lines
1.7 KiB
HTML
Raw Normal View History

2020-02-22 00:03:05 +00:00
{% load humanize %}
{% load fr_display %}
2020-10-30 21:01:43 +00:00
{% if shelf.books.all|length > 0 %}
2020-09-29 21:11:55 +00:00
<table class="table is-striped is-fullwidth">
2020-02-22 00:03:05 +00:00
<tr class="book-preview">
<th>
Cover
</th>
<th>
Title
</th>
<th>
Author
</th>
<th>
Published
</th>
<th>
Shelved
</th>
<th>
Started
</th>
<th>
Finished
</th>
2020-02-22 00:03:05 +00:00
<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-05-04 00:53:14 +00:00
<a href="/book/{{ book.id }}">{{ book.title }}</a>
2020-02-22 00:03:05 +00:00
</td>
<td>
2020-06-17 22:16:19 +00:00
{{ book.authors.first.display_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>
{% latest_read_through book user as read_through %}
<td>
{{ read_through.start_date | naturalday |default_if_none:""}}
</td>
<td>
{{ read_through.finish_date | naturalday |default_if_none:""}}
</td>
2020-02-22 00:03:05 +00:00
<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 %}
{% if shelf.user == request.user %}
2020-10-28 23:52:23 +00:00
<td>
{% include 'snippets/shelf_selector.html' with current=shelf %}
2020-10-28 23:52:23 +00:00
</td>
{% endif %}
2020-02-22 00:03:05 +00:00
</tr>
{% endfor %}
</table>
{% else %}
<p>This shelf is empty.</p>
{% endif %}