mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-12-20 23:26:42 +00:00
Display start and finish dates in books list.
This commit is contained in:
parent
53ff28b5dc
commit
8e12071b99
2 changed files with 18 additions and 0 deletions
|
@ -18,6 +18,12 @@
|
|||
<th>
|
||||
Shelved
|
||||
</th>
|
||||
<th>
|
||||
Started
|
||||
</th>
|
||||
<th>
|
||||
Finished
|
||||
</th>
|
||||
<th>
|
||||
External links
|
||||
</th>
|
||||
|
@ -44,6 +50,13 @@
|
|||
<td>
|
||||
{{ book.created_date | naturalday }}
|
||||
</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>
|
||||
<td>
|
||||
<a href="https://openlibrary.org/book/{{ book.openlibrary_key }}" target="_blank">OpenLibrary</a>
|
||||
</td>
|
||||
|
|
|
@ -168,3 +168,8 @@ def current_shelf(context, book):
|
|||
return None
|
||||
return shelf.name
|
||||
|
||||
@register.simple_tag(takes_context=False)
|
||||
def latest_read_through(book, user):
|
||||
return models.ReadThrough.objects.filter(
|
||||
user=user,
|
||||
book=book).order_by('-created_date').first()
|
||||
|
|
Loading…
Reference in a new issue