From 3e17e17e2ac977c269e4d4ddd84a7de7c4a5bd73 Mon Sep 17 00:00:00 2001 From: Thomas Sileo Date: Wed, 29 Jun 2022 22:20:15 +0200 Subject: [PATCH] Start displaying likes/shares for outbox objects --- app/templates/object.html | 2 +- app/templates/utils.html | 33 ++++++++++++++++++++++++++++++--- 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/app/templates/object.html b/app/templates/object.html index 3da1392..1bcb5e1 100644 --- a/app/templates/object.html +++ b/app/templates/object.html @@ -19,7 +19,7 @@ {% macro display_replies_tree(replies_tree_node) %} {% if replies_tree_node.is_requested %} - {{ utils.display_object_expanded(replies_tree_node.ap_object) }} + {{ utils.display_object_expanded(replies_tree_node.ap_object, likes=likes, shares=shares) }} {% else %} {{ utils.display_object(replies_tree_node.ap_object) }} {% endif %} diff --git a/app/templates/utils.html b/app/templates/utils.html index 6284c10..1f115d9 100644 --- a/app/templates/utils.html +++ b/app/templates/utils.html @@ -208,7 +208,7 @@ {% endif %} {% endmacro %} -{% macro display_object_expanded(object) %} +{% macro display_object_expanded(object, likes=[], shares=[]) %}
@@ -240,6 +240,34 @@ {{ display_attachments(object) }} +{% if likes or shares %} +
+
Likes +
+{% for like in likes %} + + {{ like.actor.handle}} + +{% endfor %} +
And 2223 more.
+ + +
+
+ +
Shares +
+{% for share in shares %} + + {{ share.actor.handle}} + +{% endfor %} +
+
+{% endif %} + +
+
{% endmacro %} @@ -339,8 +367,7 @@ - {% endif %} - + {% endif %} {% endif %}