From b9d44da06ecba40c132cc9c027ce3c80b3d81bee Mon Sep 17 00:00:00 2001 From: Thomas Sileo Date: Wed, 27 Jul 2022 18:56:14 +0200 Subject: [PATCH] Twek admin actor profile --- app/templates/admin_inbox.html | 14 +++----------- app/templates/admin_profile.html | 7 ++++++- app/templates/utils.html | 8 ++++++++ 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/app/templates/admin_inbox.html b/app/templates/admin_inbox.html index 2feae63..c8d3aa4 100644 --- a/app/templates/admin_inbox.html +++ b/app/templates/admin_inbox.html @@ -6,14 +6,6 @@ {{ utils.display_box_filters("admin_inbox") }} {% endif %} -{% macro actor_action(inbox_object, text) %} -
- {{ inbox_object.actor.display_name | clean_html(inbox_object.actor) | safe }} {{ text }} - {{ inbox_object.ap_published_at | timeago }} -
- -{% endmacro %} - {% if not inbox %}

Nothing to see yet, start following people in the lookup section.

@@ -22,15 +14,15 @@ {% for inbox_object in inbox %} {% if inbox_object.ap_type == "Announce" %} - {{ actor_action(inbox_object, "shared") }} + {{ utils.actor_action(inbox_object, "shared") }} {{ utils.display_object(inbox_object.relates_to_anybox_object) }} {% elif inbox_object.ap_type in ["Article", "Note", "Video", "Page", "Question"] %} {{ utils.display_object(inbox_object) }} {% elif inbox_object.ap_type == "Follow" %} - {{ actor_action(inbox_object, "followed you") }} + {{ utils.actor_action(inbox_object, "followed you") }} {{ utils.display_actor(inbox_object.actor, actors_metadata) }} {% elif inbox_object.ap_type == "Like" %} - {{ actor_action(inbox_object, "liked one of your post") }} + {{ utils.actor_action(inbox_object, "liked one of your post") }} {{ utils.display_object(inbox_object.relates_to_anybox_object) }} {% else %}

diff --git a/app/templates/admin_profile.html b/app/templates/admin_profile.html index 450f074..68cc05f 100644 --- a/app/templates/admin_profile.html +++ b/app/templates/admin_profile.html @@ -3,6 +3,11 @@ {% block content %} {{ utils.display_actor(actor, actors_metadata) }} {% for inbox_object in inbox_objects %} - {{ utils.display_object(inbox_object) }} + {% if inbox_object.ap_type == "Announce" %} + {{ utils.actor_action(inbox_object, "shared") }} + {{ utils.display_object(inbox_object.relates_to_anybox_object) }} + {% else %} + {{ utils.display_object(inbox_object) }} + {% endif %} {% endfor %} {% endblock %} diff --git a/app/templates/utils.html b/app/templates/utils.html index edecdfe..7f8fa00 100644 --- a/app/templates/utils.html +++ b/app/templates/utils.html @@ -171,6 +171,14 @@ {% endmacro %} +{% macro actor_action(inbox_object, text) %} +

+ {{ inbox_object.actor.display_name | clean_html(inbox_object.actor) | safe }} {{ text }} + {{ inbox_object.ap_published_at | timeago }} +
+ +{% endmacro %} + {% macro display_actor(actor, actors_metadata={}, embedded=False) %} {% set metadata = actors_metadata.get(actor.ap_id) %}