From d8098357e605eef0468326937cfeeb5487e5dc1d Mon Sep 17 00:00:00 2001 From: Hugh Rundle Date: Sat, 6 Nov 2021 10:53:41 +1100 Subject: [PATCH 1/2] match page title to active shelf resolves #1586 --- bookwyrm/templates/shelf/shelf.html | 2 +- bookwyrm/templates/user/books_header.html | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/bookwyrm/templates/shelf/shelf.html b/bookwyrm/templates/shelf/shelf.html index 662d75073..02e58ea38 100644 --- a/bookwyrm/templates/shelf/shelf.html +++ b/bookwyrm/templates/shelf/shelf.html @@ -5,7 +5,7 @@ {% load i18n %} {% block title %} -{% include 'user/books_header.html' %} +{% include 'user/books_header.html' with shelfname=shelf.identifier %} {% endblock %} {% block opengraph_images %} diff --git a/bookwyrm/templates/user/books_header.html b/bookwyrm/templates/user/books_header.html index 8fea84c7a..84493b9ca 100644 --- a/bookwyrm/templates/user/books_header.html +++ b/bookwyrm/templates/user/books_header.html @@ -1,6 +1,16 @@ {% load i18n %} {% if is_self %} +{% if shelfname == 'to-read' %} +{% trans "To Read" %} +{% elif shelfname == 'reading' %} +{% trans "Currently Reading" %} +{% elif shelfname == 'read' %} +{% trans "Read" %} +{% elif shelfname == 'all' %} {% trans "Your books" %} {% else %} +{{ shelfname }} +{% endif %} +{% else %} {% blocktrans with username=user.display_name %}{{ username }}'s books{% endblocktrans %} {% endif %} From dfe92a27c074239f41784966d3213b26f3e3b673 Mon Sep 17 00:00:00 2001 From: Hugh Rundle Date: Sat, 6 Nov 2021 11:10:58 +1100 Subject: [PATCH 2/2] use shelf name if not default shelf (instead of shelf.identifier) --- bookwyrm/templates/shelf/shelf.html | 2 +- bookwyrm/templates/user/books_header.html | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bookwyrm/templates/shelf/shelf.html b/bookwyrm/templates/shelf/shelf.html index 02e58ea38..01d41aa07 100644 --- a/bookwyrm/templates/shelf/shelf.html +++ b/bookwyrm/templates/shelf/shelf.html @@ -5,7 +5,7 @@ {% load i18n %} {% block title %} -{% include 'user/books_header.html' with shelfname=shelf.identifier %} +{% include 'user/books_header.html' with shelf=shelf %} {% endblock %} {% block opengraph_images %} diff --git a/bookwyrm/templates/user/books_header.html b/bookwyrm/templates/user/books_header.html index 84493b9ca..7311e2425 100644 --- a/bookwyrm/templates/user/books_header.html +++ b/bookwyrm/templates/user/books_header.html @@ -1,15 +1,15 @@ {% load i18n %} {% if is_self %} -{% if shelfname == 'to-read' %} +{% if shelf.identifier == 'to-read' %} {% trans "To Read" %} -{% elif shelfname == 'reading' %} +{% elif shelf.identifier == 'reading' %} {% trans "Currently Reading" %} -{% elif shelfname == 'read' %} +{% elif shelf.identifier == 'read' %} {% trans "Read" %} -{% elif shelfname == 'all' %} +{% elif shelf.identifier == 'all' %} {% trans "Your books" %} {% else %} -{{ shelfname }} +{{ shelf.name }} {% endif %} {% else %} {% blocktrans with username=user.display_name %}{{ username }}'s books{% endblocktrans %}