diff --git a/journal/templatetags/user_actions.py b/journal/templatetags/user_actions.py index 67582c77..d5590a52 100644 --- a/journal/templatetags/user_actions.py +++ b/journal/templatetags/user_actions.py @@ -30,7 +30,7 @@ def liked_post(context, post): return ( user and user.is_authenticated - and Takahe.post_liked_by(post.pk, user.identity.pk) + and post.interactions.filter(identity_id=user.identity.pk, type="like").exists() ) @@ -40,5 +40,7 @@ def boosted_post(context, post): return ( user and user.is_authenticated - and Takahe.post_boosted_by(post.pk, user.identity.pk) + and post.interactions.filter( + identity_id=user.identity.pk, type="boost" + ).exists() ) diff --git a/neodb-takahe b/neodb-takahe index cb53b38b..9b57e4f2 160000 --- a/neodb-takahe +++ b/neodb-takahe @@ -1 +1 @@ -Subproject commit cb53b38b3e8de79233867de3e89459ce820c1e58 +Subproject commit 9b57e4f24413b1b335987ca8575e08b400e7fb41 diff --git a/social/templates/feed_events.html b/social/templates/feed_events.html index c79b848d..2591b5c4 100644 --- a/social/templates/feed_events.html +++ b/social/templates/feed_events.html @@ -8,7 +8,7 @@ {% load user_actions %} {% load duration %} {% for event in events %} - {% with event.subject_post as post %} + {% with post=event.subject_post piece=event.subject_post.piece item=event.subject_post.piece.item %} {% if not post %} {% else %} @@ -34,22 +34,22 @@
{{ post.published|naturaldelta }} - {% if post.piece and post.piece.item and post.piece.item.class_name != 'tvepisode' %} + {% if item and item.class_name != 'tvepisode' %} - {% if post.piece.item.class_name == 'podcastepisode' %} + {% if item.class_name == 'podcastepisode' %} + data-uuid="{{ item.uuid }}" + data-media="{{ item.media_url }}" + data-cover="{{ item.cover_url|default:item.parent_item.cover.url }}" + data-title="{{ item.title }}" + data-album="{{ item.parent_item.title }}" + data-hosts="{{ item.parent_item.hosts|join:' / ' }}" + {% if request.user.is_authenticated %} data-comment-href="{% url 'journal:comment' item.uuid %}" {% endif %} + data-position="{{ piece.metadata.position | default:0 }}"> {% else %} @@ -66,7 +66,7 @@ {{ post.author.name }} - {% if post.piece and post.piece.classname == 'note' %} + {% if piece and piece.classname == 'note' %} {% trans "wrote a note" %} {% endif %} @@ -88,7 +88,7 @@ {% endif %} {% endfor %}
- {% if post.piece and post.piece.classname == 'note' %} + {% if piece and piece.classname == 'note' %}
{% if post.piece %} - {% if post.piece.item %} - {#
{% include "_item_card.html" with item=post.piece.item allow_embed=1 %}
#} - - cover + {% if item %} + {#
{% include "_item_card.html" with item=item allow_embed=1 %}
#} +
+ cover {% endif %} {% endif %} diff --git a/social/views.py b/social/views.py index 03bdeea6..92d2d584 100644 --- a/social/views.py +++ b/social/views.py @@ -68,17 +68,17 @@ def data(request): .select_related( "subject_post", "subject_post__author", - "subject_post__author__domain", + # "subject_post__author__domain", "subject_identity", - "subject_identity__domain", + # "subject_identity__domain", "subject_post_interaction", "subject_post_interaction__identity", - "subject_post_interaction__identity__domain", + # "subject_post_interaction__identity__domain", ) .prefetch_related( "subject_post__attachments", - "subject_post__mentions", - "subject_post__emojis", + # "subject_post__mentions", + # "subject_post__emojis", ) ) if since_id: