Adds minor changes to null states for annual summary

This commit is contained in:
Mouse Reeve 2021-12-27 13:16:27 -08:00
parent c85f881f97
commit a96466bf35
2 changed files with 11 additions and 3 deletions

View file

@ -54,7 +54,13 @@
</p> </p>
{% if no_page_number %} {% if no_page_number %}
<p class="subtitle is-6">{% blocktrans %}({{ no_page_number }} books dont have pages){% endblocktrans %}</p> <p class="subtitle is-6">
{% blocktrans trimmed count counter=no_page_number %}
({{ no_page_number }} book doesnt have pages)
{% plural %}
({{ no_page_number }} books dont have pages)
{% endblocktrans %}
</p>
{% endif %} {% endif %}
</div> </div>
</div> </div>
@ -123,6 +129,7 @@
<div class="column is-3 is-offset-3"> <div class="column is-3 is-offset-3">
<a href="{{ book_rating_highest.book.local_path }}">{% include 'snippets/book_cover.html' with book=book_rating_highest.book cover_class='is-w-auto-tablet is-h-l-mobile' %}</a> <a href="{{ book_rating_highest.book.local_path }}">{% include 'snippets/book_cover.html' with book=book_rating_highest.book cover_class='is-w-auto-tablet is-h-l-mobile' %}</a>
</div> </div>
{% if book_rating_highest %}
<div class="column is-4"> <div class="column is-4">
{% trans "Your best rated review" %} {% trans "Your best rated review" %}
<p class="title is-4 is-serif is-italic"> <p class="title is-4 is-serif is-italic">
@ -141,6 +148,7 @@
{% endwith %} {% endwith %}
</p> </p>
</div> </div>
{% endif %}
</div> </div>
<div class="columns"> <div class="columns">

View file

@ -97,7 +97,7 @@ class AnnualSummary(View):
"year": year, "year": year,
"books_total": len(read_books_in_year), "books_total": len(read_books_in_year),
"books": read_books_in_year, "books": read_books_in_year,
"pages_total": page_stats["pages__sum"], "pages_total": page_stats["pages__sum"] or 0,
"pages_average": round( "pages_average": round(
page_stats["pages__avg"] if page_stats["pages__avg"] else 0 page_stats["pages__avg"] if page_stats["pages__avg"] else 0
), ),