From d046deaf11d5c2dc43ebe68e2c81feccaa76c46a Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Sun, 5 Sep 2021 14:42:11 -0700 Subject: [PATCH] Adds totals and page counts to shelf headers --- bookwyrm/templates/user/shelf/shelf.html | 36 ++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/bookwyrm/templates/user/shelf/shelf.html b/bookwyrm/templates/user/shelf/shelf.html index 61458fcc..06507d3e 100644 --- a/bookwyrm/templates/user/shelf/shelf.html +++ b/bookwyrm/templates/user/shelf/shelf.html @@ -24,11 +24,26 @@
@@ -55,6 +70,23 @@ {% include 'snippets/privacy-icons.html' with item=shelf %} + {% with count=books.paginator.count %} + {% if count %} +

+ {% blocktrans trimmed count counter=count with formatted_count=count|intcomma %} + {{ formatted_count }} book + {% plural %} + {{ formatted_count }} books + {% endblocktrans %} + + {% if books.has_other_pages %} + {% blocktrans trimmed with start=books.start_index end=books.end_index %} + (showing {{ start }}-{{ end }}) + {% endblocktrans %} + {% endif %} +

+ {% endif %} + {% endwith %}
{% if is_self and shelf.id %}