mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-29 04:51:11 +00:00
Fix feed display
This commit is contained in:
parent
78fa9a3a20
commit
99a060311b
5 changed files with 19 additions and 5 deletions
|
@ -20,7 +20,7 @@
|
|||
</form>
|
||||
|
||||
{% for review in user_reviews %}
|
||||
{% include 'snippets/status.html' with status=review hide_book=True main=True depth=1 %}
|
||||
{% include 'snippets/status.html' with status=review hide_book=True depth=1 %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
@ -34,7 +34,7 @@
|
|||
|
||||
{% include 'snippets/book_cover.html' with book=book size=large %}
|
||||
<p>{{ active_tab }} rating: {{ rating | stars }}</p>
|
||||
{% if description %}
|
||||
{% if book.description %}
|
||||
<blockquote>{{ book.description | description }}</blockquote>
|
||||
{% endif %}
|
||||
<div>
|
||||
|
@ -62,7 +62,7 @@
|
|||
</form>
|
||||
<p>Average rating: {{ rating | stars }}</p>
|
||||
{% for review in reviews %}
|
||||
{% include 'snippets/status.html' with status=review hide_book=True main=True depth=1 %}
|
||||
{% include 'snippets/status.html' with status=review hide_book=True depth=1 %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
{% include 'snippets/tabs.html' with tabs=feed_tabs active_tab=active_tab %}
|
||||
|
||||
{% for activity in activities %}
|
||||
{% include 'snippets/status.html' with status=activity depth=1 %}
|
||||
{% include 'snippets/status.html' with status=activity depth=1 description=True %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
|
|
|
@ -1,7 +1,15 @@
|
|||
{% load fr_display %}
|
||||
<div class="interaction">
|
||||
{% if activity.favorites.all %}
|
||||
<span>
|
||||
{{ activity.favorites.count }} like(s)
|
||||
{{ activity.favorites.count }} like{{activity.favorites.count|pluralize }}
|
||||
</span>
|
||||
{% endif %}
|
||||
{% if activity|reply_count %}
|
||||
<span>
|
||||
<a href="{{ activity.absolute_id }}">
|
||||
{{ activity|reply_count }} repl{{ activity|reply_count|pluralize:'y,ies' }}
|
||||
</a>
|
||||
</span>
|
||||
{% endif %}
|
||||
<form name="favorite" action="/favorite/{{ activity.id }}" method="post">
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
<small>{{ status.rating | stars }} stars, by {% include 'snippets/username.html' with user=status.user %}</small>
|
||||
</h4>{% endif %}
|
||||
<blockquote>{{ status.content }}</blockquote>
|
||||
{% if not max_depth and status.reply_parent or status|replies %}<p><a href="{{ status.absolute_id }}">Thread</a>{% endif %}
|
||||
{% include 'snippets/interaction.html' with activity=status %}
|
||||
</div>
|
||||
|
||||
|
|
|
@ -60,6 +60,11 @@ def get_replies(status):
|
|||
return models.Status.objects.filter(reply_parent=status).select_subclasses().all()[:10]
|
||||
|
||||
|
||||
@register.filter(name='reply_count')
|
||||
def get_reply_count(status):
|
||||
return models.Status.objects.filter(reply_parent=status).count()
|
||||
|
||||
|
||||
@register.filter(name='parent')
|
||||
def get_parent(status):
|
||||
return models.Status.objects.filter(id=status.reply_parent_id).select_subclasses().get()
|
||||
|
|
Loading…
Reference in a new issue