mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-12-21 07:36: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>
|
<th>
|
||||||
Shelved
|
Shelved
|
||||||
</th>
|
</th>
|
||||||
|
<th>
|
||||||
|
Started
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
Finished
|
||||||
|
</th>
|
||||||
<th>
|
<th>
|
||||||
External links
|
External links
|
||||||
</th>
|
</th>
|
||||||
|
@ -44,6 +50,13 @@
|
||||||
<td>
|
<td>
|
||||||
{{ book.created_date | naturalday }}
|
{{ book.created_date | naturalday }}
|
||||||
</td>
|
</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>
|
<td>
|
||||||
<a href="https://openlibrary.org/book/{{ book.openlibrary_key }}" target="_blank">OpenLibrary</a>
|
<a href="https://openlibrary.org/book/{{ book.openlibrary_key }}" target="_blank">OpenLibrary</a>
|
||||||
</td>
|
</td>
|
||||||
|
|
|
@ -168,3 +168,8 @@ def current_shelf(context, book):
|
||||||
return None
|
return None
|
||||||
return shelf.name
|
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