Add basic view logic for testing

This commit is contained in:
Joel Bradshaw 2020-11-16 23:53:46 -08:00
parent 00b8608a50
commit f524f0cd4d
2 changed files with 8 additions and 1 deletions

View file

@ -76,8 +76,12 @@
<dd>{{ readthrough.finish_date | naturalday }}</dd>
{% elif readthrough.pages_read %}
<dt>On page:</dt>
<dd>{{ readthrough.pages_read}} of {{ book.pages }}</dd>
<dd>{{ readthrough.pages_read }} of {{ book.pages }}</dd>
{% endif %}
{% for progress_update in readthrough.progress_updates %}
<dt>On {{ progress_update.date | naturalday }} you were on:</dt>
<dd>{{ progress_update.progress }} of {{ book.pages }}</dd>
{% endfor %}
</dl>
<div class="field is-grouped">
<label class="button is-small" for="edit-readthrough-{{ readthrough.id }}" role="button" tabindex="0">

View file

@ -562,6 +562,9 @@ def book_page(request, book_id):
book=book,
).order_by('start_date')
for readthrough in readthroughs:
readthrough.progress_updates = readthrough.progressupdate_set.all().order_by('date')
rating = reviews.aggregate(Avg('rating'))
tags = models.Tag.objects.filter(
book=book