61
fedireads/templates/snippets/shelf.html
Normal file
61
fedireads/templates/snippets/shelf.html
Normal file
@ -0,0 +1,61 @@
|
||||
{% 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>
|
||||
<a href="/book/{{ book.openlibrary_key }}">{{ book.data.title }}</a>
|
||||
</td>
|
||||
<td>
|
||||
{{ book.authors.first.data.name }}
|
||||
</td>
|
||||
<td>
|
||||
{{ book.data.first_publish_date }}
|
||||
</td>
|
||||
<td>
|
||||
{{ book.added_date | naturalday }}
|
||||
</td>
|
||||
<td>
|
||||
<a href="https://openlibrary.org{{ book.data.key }}" target="_blank">OpenLibrary</a>
|
||||
</td>
|
||||
{% if ratings %}
|
||||
<td>
|
||||
{{ ratings | dict_key:book.id | stars}}
|
||||
</td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% else %}
|
||||
<p>This shelf is empty.</p>
|
||||
{% endif %}
|
||||
|
@ -1,2 +1,2 @@
|
||||
<a href="/user/{% if user.localname %}{{ user.localname }}{% else %}{{ user.username }}{% endif %}" class="user">{% if user.name %}{{ user.name }}{% elif user.localname %}{{ user.localname }}{% else %}{{ user.username }}{% endif %}</a>
|
||||
|
||||
{% load fr_display %}
|
||||
<a href="/user/{{ user | username }}" class="user">{% if user.name %}{{ user.name }}{% else %}{{ user | username }}{% endif %}</a>
|
||||
|
Reference in New Issue
Block a user