diff --git a/bookwyrm/activitystreams.py b/bookwyrm/activitystreams.py index 86321cd8..ff3c55fb 100644 --- a/bookwyrm/activitystreams.py +++ b/bookwyrm/activitystreams.py @@ -55,6 +55,8 @@ class ActivityStream(RedisStore): return ( models.Status.objects.select_subclasses() .filter(id__in=statuses) + .select_related("user", "reply_parent") + .prefetch_related("mention_books", "mention_users") .order_by("-published_date") ) diff --git a/bookwyrm/templates/layout.html b/bookwyrm/templates/layout.html index d5a2087e..1158d82d 100644 --- a/bookwyrm/templates/layout.html +++ b/bookwyrm/templates/layout.html @@ -134,12 +134,14 @@ {% trans "Notifications" %} + {% with request.user.unread_notification_count as notification_count %} - {{ request.user.unread_notification_count }} + {{ notification_count }} + {% endwith %} {% else %} diff --git a/bookwyrm/templates/snippets/boost_button.html b/bookwyrm/templates/snippets/boost_button.html index 5b84ea44..0f927406 100644 --- a/bookwyrm/templates/snippets/boost_button.html +++ b/bookwyrm/templates/snippets/boost_button.html @@ -3,14 +3,31 @@ {% load i18n %} {% with status.id|uuid as uuid %} -
- {% endwith %} +{% endwith %} diff --git a/bookwyrm/templates/snippets/fav_button.html b/bookwyrm/templates/snippets/fav_button.html index 40fa2d25..6c4cfe9a 100644 --- a/bookwyrm/templates/snippets/fav_button.html +++ b/bookwyrm/templates/snippets/fav_button.html @@ -3,7 +3,8 @@ {% load i18n %} {% with status.id|uuid as uuid %} - - {% endwith %} +{% endwith %} diff --git a/bookwyrm/templates/snippets/status/layout.html b/bookwyrm/templates/snippets/status/layout.html index 6fd7ebde..b1d361fe 100644 --- a/bookwyrm/templates/snippets/status/layout.html +++ b/bookwyrm/templates/snippets/status/layout.html @@ -15,7 +15,7 @@