From 698e74a496468ec07a6b938abfb378d0bbd6bae1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adeodato=20Sim=C3=B3?= <73768+dato@users.noreply.github.com> Date: Sat, 21 Oct 2023 12:53:24 -0300 Subject: [PATCH] Minor vocabulary fixes and structured data improvements (#3036) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Remove duplicate Review object under `rating` property This was preventing validation, since `rating` is not a valid property (`review` is, which is created from book.html already). * Drop `bestRating` property in ratings, since it defaults to 5 See ("If bestRating is omitted, 5 is assumed"). * Create Rating object (and its enclosing Review) in book/rating.html * Use `position` property for Book objects in a series `volumeNumber`, previously used, is only valid for objects of type PublicationVolume (which series members are not). * Give URL of book series when setting of `isPartOf` * series.html: Add empty BookSeries object --------- Co-authored-by: Adeodato Simó --- bookwyrm/templates/book/book.html | 14 +++++++------- bookwyrm/templates/book/rating.html | 15 ++++++++++----- bookwyrm/templates/book/series.html | 9 +++++---- .../templates/snippets/status/content_status.html | 12 ------------ .../templates/snippets/status/headers/rating.html | 3 --- 5 files changed, 22 insertions(+), 31 deletions(-) diff --git a/bookwyrm/templates/book/book.html b/bookwyrm/templates/book/book.html index 9083f9bdc..8e76fb014 100644 --- a/bookwyrm/templates/book/book.html +++ b/bookwyrm/templates/book/book.html @@ -44,16 +44,18 @@ {% endif %} {% if book.series %} - - - + + {% if book.authors.exists %} - + {% endif %} + {% endif %}

{% endif %} @@ -186,8 +188,6 @@ itemtype="https://schema.org/AggregateRating" > - {# @todo Is it possible to not hard-code the value? #} - diff --git a/bookwyrm/templates/book/rating.html b/bookwyrm/templates/book/rating.html index c0af67fab..9998a49dc 100644 --- a/bookwyrm/templates/book/rating.html +++ b/bookwyrm/templates/book/rating.html @@ -5,13 +5,18 @@ {% include 'snippets/avatar.html' with user=user %} -
-
- {{ user.display_name }} +
+ -
+
+

{% trans "rated it" %}

- {% include 'snippets/stars.html' with rating=rating.rating %}
diff --git a/bookwyrm/templates/book/series.html b/bookwyrm/templates/book/series.html index dc8113813..8b945452f 100644 --- a/bookwyrm/templates/book/series.html +++ b/bookwyrm/templates/book/series.html @@ -5,15 +5,15 @@ {% block title %}{{ series_name }}{% endblock %} {% block content %} -
-

{{ series_name }}

+
+

{{ series_name }}

{% trans "Series by" %} @@ -22,6 +22,7 @@
{% for book in books %} {% with book=book %} + {# @todo Set `hasPart` property in some meaningful way #}
{% if book.series_number %}{% blocktrans with series_number=book.series_number %}Book {{ series_number }}{% endblocktrans %}{% else %}{% trans 'Unsorted Book' %}{% endif %} diff --git a/bookwyrm/templates/snippets/status/content_status.html b/bookwyrm/templates/snippets/status/content_status.html index 1dc8382b2..28ed61e83 100644 --- a/bookwyrm/templates/snippets/status/content_status.html +++ b/bookwyrm/templates/snippets/status/content_status.html @@ -6,14 +6,6 @@ {% load humanize %} {% with status_type=status.status_type %} -
-
{% if not hide_book %} {% with book=status.book|default:status.mention_books.first %} @@ -58,9 +50,6 @@ {% endif %} > - - {# @todo Is it possible to not hard-code the value? #} - {% include 'snippets/stars.html' with rating=status.rating %} @@ -154,6 +143,5 @@
-
{% endwith %} diff --git a/bookwyrm/templates/snippets/status/headers/rating.html b/bookwyrm/templates/snippets/status/headers/rating.html index bc40c04c8..fcef7eee7 100644 --- a/bookwyrm/templates/snippets/status/headers/rating.html +++ b/bookwyrm/templates/snippets/status/headers/rating.html @@ -16,9 +16,6 @@ >