mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-26 19:41:11 +00:00
Fixes display of user ratings
This commit is contained in:
parent
07d59c8c09
commit
58a059c85f
3 changed files with 28 additions and 28 deletions
|
@ -225,45 +225,23 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% for review in statuses %}
|
{% for status in statuses %}
|
||||||
<div
|
<div
|
||||||
class="block"
|
class="block"
|
||||||
|
{% if status.status_type == 'Review' or status.status_type == 'Rating' %}
|
||||||
itemprop="review"
|
itemprop="review"
|
||||||
itemscope
|
itemscope
|
||||||
itemtype="https://schema.org/Review"
|
itemtype="https://schema.org/Review"
|
||||||
|
{% endif %}
|
||||||
>
|
>
|
||||||
{% with status=review hide_book=True depth=1 %}
|
{% include 'snippets/status/status.html' with status=status hide_book=True depth=1 %}
|
||||||
{% include 'snippets/status/status.html' %}
|
|
||||||
{% endwith %}
|
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
{% if ratings %}
|
{% if ratings %}
|
||||||
<div class="block is-flex is-flex-wrap-wrap">
|
<div class="block is-flex is-flex-wrap-wrap">
|
||||||
{% for rating in ratings %}
|
{% for rating in ratings %}
|
||||||
{% with user=rating.user %}
|
{% include 'book/rating.html' with user=rating.user rating=rating %}
|
||||||
<div class="block mr-5">
|
|
||||||
<div class="media">
|
|
||||||
<div class="media-left">
|
|
||||||
{% include 'snippets/avatar.html' %}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="media-content">
|
|
||||||
<div>
|
|
||||||
<a href="{{ user.local_path }}">{{ user.display_name }}</a>
|
|
||||||
</div>
|
|
||||||
<div class="is-flex">
|
|
||||||
<p class="mr-1">{% trans "rated it" %}</p>
|
|
||||||
|
|
||||||
{% include 'snippets/stars.html' with rating=rating.rating %}
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<a href="{{ rating.remote_id }}">{{ rating.published_date|naturaltime }}</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% endwith %}
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
22
bookwyrm/templates/book/rating.html
Normal file
22
bookwyrm/templates/book/rating.html
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
{% load i18n %}{% load status_display %}
|
||||||
|
<div class="block mr-5">
|
||||||
|
<div class="media">
|
||||||
|
<div class="media-left">
|
||||||
|
{% include 'snippets/avatar.html' with user=user %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="media-content">
|
||||||
|
<div>
|
||||||
|
<a href="{{ user.local_path }}">{{ user.display_name }}</a>
|
||||||
|
</div>
|
||||||
|
<div class="is-flex">
|
||||||
|
<p class="mr-1">{% trans "rated it" %}</p>
|
||||||
|
|
||||||
|
{% include 'snippets/stars.html' with rating=rating.rating %}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<a href="{{ rating.remote_id }}">{{ rating.published_date|published_date }}</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
|
@ -54,7 +54,7 @@ class Book(View):
|
||||||
# the reviews to show
|
# the reviews to show
|
||||||
if user_statuses:
|
if user_statuses:
|
||||||
if user_statuses == "review":
|
if user_statuses == "review":
|
||||||
queryset = book.review_set
|
queryset = book.review_set.select_subclasses()
|
||||||
elif user_statuses == "comment":
|
elif user_statuses == "comment":
|
||||||
queryset = book.comment_set
|
queryset = book.comment_set
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue