{% macro embed_csrf_token() %} {% endmacro %} {% macro embed_redirect_url() %} {% endmacro %} {% macro admin_follow_button(actor) %}
{{ embed_csrf_token() }} {{ embed_redirect_url() }}
{% endmacro %} {% macro admin_like_button(ap_object_id) %}
{{ embed_csrf_token() }} {{ embed_redirect_url() }}
{% endmacro %} {% macro admin_bookmark_button(ap_object_id) %}
{{ embed_csrf_token() }} {{ embed_redirect_url() }}
{% endmacro %} {% macro admin_unbookmark_button(ap_object_id) %}
{{ embed_csrf_token() }} {{ embed_redirect_url() }}
{% endmacro %} {% macro admin_pin_button(ap_object_id) %}
{{ embed_csrf_token() }} {{ embed_redirect_url() }}
{% endmacro %} {% macro admin_unpin_button(ap_object_id) %}
{{ embed_csrf_token() }} {{ embed_redirect_url() }}
{% endmacro %} {% macro admin_delete_button(ap_object_id) %}
{{ embed_csrf_token() }} {{ embed_redirect_url() }}
{% endmacro %} {% macro admin_announce_button(ap_object_id, disabled=False) %}
{{ embed_csrf_token() }} {{ embed_redirect_url() }}
{% endmacro %} {% macro admin_undo_button(ap_object_id, action="Undo") %}
{{ embed_csrf_token() }} {{ embed_redirect_url() }}
{% endmacro %} {% macro sensitive_button(permalink_id) %}
{% for k, v in request.query_params.items() %} {% endfor %}
{% endmacro %} {% macro show_more_button(permalink_id) %}
{% for k, v in request.query_params.items() %} {% endfor %}
{% endmacro %} {% macro admin_reply_button(ap_object_id) %}
{% endmacro %} {% macro admin_profile_button(ap_actor_id) %}
{% endmacro %} {% macro admin_expand_button(ap_object_id) %}
{% endmacro %} {% macro display_box_filters(route) %}

Filter by {% for ap_type in ["Note", "Like", "Announce", "Follow"] %} {% if request.query_params.filter_by == ap_type %} {{ ap_type }} {% else %} {{ ap_type }} {% endif %} {% endfor %}. {% if request.query_params.filter_by %}Reset filter{% endif %}

{% endmacro %} {% macro display_actor(actor, actors_metadata) %} {% set metadata = actors_metadata.get(actor.ap_id) %}
{{ actor.display_name | clean_html(actor) | safe }}
{{ actor.handle }}
{% if is_admin and metadata %}
{% endif %} {% endmacro %} {% macro display_og_meta(object) %} {% if object.og_meta %} {% for og_meta in object.og_meta %}
{% if og_meta.image %}
{{ og_meta.title }} {{ og_meta.site_name }}
{% endif %}
{% endfor %} {% endif %} {% endmacro %} {% macro display_attachments(object) %} {% if object.attachments and object.sensitive and not request.query_params.show_sensitive == object.permalink_id %} {{ sensitive_button(object.permalink_id )}} {% endif %} {% if object.attachments and (not object.sensitive or (object.sensitive and request.query_params["show_sensitive"] == object.permalink_id)) %} {% for attachment in object.attachments %} {% if attachment.type == "Image" or (attachment | has_media_type("image")) %} {{ attachment.name }} {% elif attachment.type == "Video" or (attachment | has_media_type("video")) %} {% elif attachment.type == "Audio" or (attachment | has_media_type("audio")) %} {% else %} {{ attachment.url }} {% endif %} {% endfor %} {% endif %} {% endmacro %} {% macro display_object_expanded(object, likes=[], shares=[]) %}
{{ display_actor(object.actor, {}) }} {% if object.summary %}

{{ object.summary | clean_html(object) | safe }}

{% endif %} {% if object.sensitive and object.summary and not request.query_params.show_more == object.permalink_id %} {{ show_more_button(object.permalink_id) }} {% endif %} {% if not object.sensitive or (object.sensitive and object.summary and request.query_params.show_more == object.permalink_id) %}
{{ object.content | clean_html(object) | safe }}
{% endif %} {{ display_og_meta(object) }} {{ object.visibility.value }} {% if object.is_from_outbox %} {{ object.likes_count }} likes {% endif %} {% if object.is_from_outbox %} {{ object.announces_count }} shares {% endif %} {{ 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 %} {% macro display_object(object) %} {% if object.ap_type in ["Note", "Article", "Video"] %}
{{ object.actor.display_name }} {{ object.actor.handle }} {{ object.visibility.value }} {% if object.summary %}

{{ object.summary | clean_html(object) | safe }}

{% endif %} {% if object.sensitive and object.summary and not request.query_params.show_more == object.permalink_id %} {{ show_more_button(object.permalink_id) }} {% endif %} {% if not object.sensitive or (object.sensitive and object.summary and request.query_params.show_more == object.permalink_id) %}
{{ object.content | clean_html(object) | safe }}
{% endif %}
{{ display_og_meta(object) }}
{{ display_attachments(object) }}
{% if object.is_from_outbox %}
{{ object.likes_count }} like{{ object.likes_count | pluralize }}
{{ object.announces_count }} share{{ object.announces_count | pluralize }}
{{ object.replies_count }} repl{{ object.replies_count | pluralize("y", "ies") }}
{% if is_admin %}
{{ admin_delete_button(object.ap_id) }}
{{ admin_reply_button(object.ap_id) }}
{% if object.is_pinned %} {{ admin_unpin_button(object.ap_id) }} {% else %} {{ admin_pin_button(object.ap_id) }} {% endif %}
{% endif %} {% endif %} {% if object.is_from_inbox %}
{% if object.liked_via_outbox_object_ap_id %} {{ admin_undo_button(object.liked_via_outbox_object_ap_id, "Unlike") }} {% else %} {{ admin_like_button(object.ap_id) }} {% endif %}
{% if object.is_bookmarked %} {{ admin_unbookmark_button(object.ap_id) }} {% else %} {{ admin_bookmark_button(object.ap_id) }} {% endif %}
{% if object.announced_via_outbox_object_ap_id %} {{ admin_undo_button(object.liked_via_outbox_object_ap_id, "Unshare") }} {% else %} {{ admin_announce_button(object.ap_id, disabled=object.visibility not in [visibility_enum.PUBLIC, visibility_enum.UNLISTED]) }} {% endif %}
{{ admin_reply_button(object.ap_id) }}
{{ admin_profile_button(object.actor.ap_id) }}
{{ admin_expand_button(object.ap_id) }}
{% endif %}
{% endif %} {% endmacro %}