2020-02-21 19:03:05 -05:00
|
|
|
{% load humanize %}
|
2020-12-12 21:25:04 -05:00
|
|
|
{% load bookwyrm_tags %}
|
2020-12-30 19:07:29 -05:00
|
|
|
{% if books|length > 0 %}
|
2021-02-23 16:04:24 -05:00
|
|
|
<div class="table-container">
|
2020-09-29 17:11:55 -04:00
|
|
|
<table class="table is-striped is-fullwidth">
|
|
|
|
|
2020-02-21 19:03:05 -05:00
|
|
|
<tr class="book-preview">
|
|
|
|
<th>
|
|
|
|
Cover
|
|
|
|
</th>
|
|
|
|
<th>
|
|
|
|
Title
|
|
|
|
</th>
|
|
|
|
<th>
|
|
|
|
Author
|
|
|
|
</th>
|
|
|
|
<th>
|
|
|
|
Published
|
|
|
|
</th>
|
|
|
|
<th>
|
|
|
|
Shelved
|
|
|
|
</th>
|
2020-04-15 08:06:23 -04:00
|
|
|
<th>
|
|
|
|
Started
|
|
|
|
</th>
|
|
|
|
<th>
|
|
|
|
Finished
|
|
|
|
</th>
|
2020-02-21 19:03:05 -05:00
|
|
|
<th>
|
|
|
|
External links
|
|
|
|
</th>
|
|
|
|
{% if ratings %}
|
|
|
|
<th>
|
|
|
|
Rating
|
|
|
|
</th>
|
|
|
|
{% endif %}
|
|
|
|
</tr>
|
2020-12-30 19:07:29 -05:00
|
|
|
{% for book in books %}
|
2020-02-21 19:03:05 -05:00
|
|
|
<tr class="book-preview">
|
|
|
|
<td>
|
2021-02-10 19:45:53 -05:00
|
|
|
<a href="{{ book.local_path }}">{% include 'snippets/book_cover.html' with book=book size="small" %}</a>
|
2020-02-21 19:03:05 -05:00
|
|
|
</td>
|
|
|
|
<td>
|
2021-02-10 19:45:53 -05:00
|
|
|
<a href="{{ book.local_path }}">{{ book.title }}</a>
|
2020-02-21 19:03:05 -05:00
|
|
|
</td>
|
|
|
|
<td>
|
2020-12-12 12:47:27 -05:00
|
|
|
{{ book.authors.first.name }}
|
2020-02-21 19:03:05 -05:00
|
|
|
</td>
|
|
|
|
<td>
|
2020-03-09 20:55:15 -04:00
|
|
|
{% if book.first_published_date %}{{ book.first_published_date }}{% endif %}
|
2020-02-21 19:03:05 -05:00
|
|
|
</td>
|
|
|
|
<td>
|
2020-03-09 20:55:15 -04:00
|
|
|
{{ book.created_date | naturalday }}
|
2020-02-21 19:03:05 -05:00
|
|
|
</td>
|
2020-04-15 08:06:23 -04:00
|
|
|
{% 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-21 19:03:05 -05:00
|
|
|
<td>
|
2020-03-27 18:42:44 -04:00
|
|
|
<a href="https://openlibrary.org/book/{{ book.openlibrary_key }}" target="_blank">OpenLibrary</a>
|
2020-02-21 19:03:05 -05:00
|
|
|
</td>
|
|
|
|
{% if ratings %}
|
|
|
|
<td>
|
2020-04-03 16:36:56 -04:00
|
|
|
{% include 'snippets/stars.html' with rating=ratings|dict_key:book.id %}
|
2020-02-21 19:03:05 -05:00
|
|
|
</td>
|
|
|
|
{% endif %}
|
2020-11-07 23:47:56 -05:00
|
|
|
{% if shelf.user == request.user %}
|
2020-10-28 19:52:23 -04:00
|
|
|
<td>
|
2020-11-07 14:49:57 -05:00
|
|
|
{% include 'snippets/shelf_selector.html' with current=shelf %}
|
2020-10-28 19:52:23 -04:00
|
|
|
</td>
|
2020-11-07 23:47:56 -05:00
|
|
|
{% endif %}
|
2020-02-21 19:03:05 -05:00
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
</table>
|
2021-02-23 16:04:24 -05:00
|
|
|
</div>
|
2020-02-21 19:03:05 -05:00
|
|
|
{% else %}
|
|
|
|
<p>This shelf is empty.</p>
|
2020-11-10 23:33:46 -05:00
|
|
|
{% if shelf.editable %}
|
|
|
|
<form name="delete-shelf" action="/delete-shelf/{{ shelf.id }}" method="post">
|
|
|
|
{% csrf_token %}
|
|
|
|
<input type="hidden" name="user" value="{{ request.user.id }}">
|
|
|
|
<button class="button is-danger is-light" type="submit">
|
|
|
|
Delete shelf
|
|
|
|
</button>
|
|
|
|
</form>
|
|
|
|
{% endif %}
|
|
|
|
|
2020-02-21 19:03:05 -05:00
|
|
|
{% endif %}
|
|
|
|
|