{% macro embed_csrf_token() %} {% endmacro %} {% macro embed_redirect_url(permalink_id=None) %} {% endmacro %} {% macro admin_follow_button(actor) %}
{{ embed_csrf_token() }} {{ embed_redirect_url() }}
{% endmacro %} {% macro admin_like_button(ap_object_id, permalink_id) %}
{{ embed_csrf_token() }} {{ embed_redirect_url(permalink_id) }}
{% endmacro %} {% macro admin_bookmark_button(ap_object_id, permalink_id) %}
{{ embed_csrf_token() }} {{ embed_redirect_url(permalink_id) }}
{% endmacro %} {% macro admin_unbookmark_button(ap_object_id, permalink_id) %}
{{ embed_csrf_token() }} {{ embed_redirect_url(permalink_id) }}
{% endmacro %} {% macro admin_pin_button(ap_object_id, permalink_id) %}
{{ embed_csrf_token() }} {{ embed_redirect_url(permalink_id) }}
{% endmacro %} {% macro admin_unpin_button(ap_object_id, permalink_id) %}
{{ embed_csrf_token() }} {{ embed_redirect_url(permalink_id) }}
{% endmacro %} {% macro admin_delete_button(ap_object_id) %}
{{ embed_csrf_token() }} {{ embed_redirect_url() }}
{% endmacro %} {% macro admin_announce_button(ap_object_id, disabled=False, permalink_id=None) %}
{{ embed_csrf_token() }} {{ embed_redirect_url(permalink_id) }}
{% endmacro %} {% macro admin_undo_button(ap_object_id, action="undo", permalink_id=None) %}
{{ embed_csrf_token() }} {{ embed_redirect_url(permalink_id) }}
{% endmacro %} {% macro sensitive_button(permalink_id) %}
{% for k, v in request.query_params.items() %} {% endfor %}
{% endmacro %} {% macro hide_sensitive_button(permalink_id) %}
{% for k, v in request.query_params.items() %} {% if not (k == "show_sensitive" and v == permalink_id) %} {% endif %} {% endfor %}
{% endmacro %} {% macro show_more_button(permalink_id) %}
{% for k, v in request.query_params.items() %} {% endfor %}
{% endmacro %} {% macro show_less_button(permalink_id) %}
{% for k, v in request.query_params.items() %} {% if not (k == "show_more" and v == permalink_id) %} {% endif %} {% 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) %} {% 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) %} {% if not embedded %}
{% endif %}
{{ actor.display_name }}'s avatar
{{ actor.display_name | clean_html(actor) | safe }}
{{ actor.handle }}
{% if is_admin and metadata %}
{% endif %} {% if not embedded %}
{% 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 object.permalink_id in request.query_params.getlist("show_sensitive") %} {{ sensitive_button(object.permalink_id )}} {% endif %} {% if object.attachments and (not object.sensitive or (object.sensitive and object.permalink_id in request.query_params.getlist("show_sensitive"))) %} {% if object.sensitive %} {{ hide_sensitive_button(object.permalink_id) }} {% endif %} {% 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")) %} {% elif attachment.type == "Link" %} {{ attachment.url }} {% else %} {{ attachment.url }} {% endif %} {% endfor %} {% endif %} {% endmacro %} {% macro display_object(object, likes=[], shares=[], webmentions=[], expanded=False, actors_metadata={}, is_object_page=False) %} {% set is_article_mode = object.is_from_outbox and object.ap_type == "Article" and is_object_page %} {% if object.ap_type in ["Note", "Article", "Video", "Page", "Question"] %}
{% if is_article_mode %} {% else %} {{ display_actor(object.actor, actors_metadata, embedded=True) }} {% endif %} {% if object.in_reply_to %} in reply to {{ object.in_reply_to|truncate(64, True) }} {% endif %} {% if object.ap_type == "Article" %}

{{ object.name }}

{% endif %} {% if is_article_mode %} {% endif %} {% if object.summary %}

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

{% endif %} {% if object.sensitive and object.permalink_id not in request.query_params.getlist("show_more") %} {{ show_more_button(object.permalink_id) }} {% endif %} {% if not object.sensitive or (object.sensitive and object.permalink_id in request.query_params.getlist("show_more")) %} {% if object.sensitive %} {{ show_less_button(object.permalink_id) }} {% endif %}
{{ object.content | clean_html(object) | safe }}
{% endif %} {% if object.ap_type == "Question" and (not object.sensitive or (object.sensitive and object.permalink_id in request.query_params.getlist("show_more"))) %} {% set can_vote = is_admin and object.is_from_inbox and not object.is_poll_ended and not object.voted_for_answers %} {% if can_vote %}
{{ embed_csrf_token() }} {{ embed_redirect_url(object.permalink_id) }} {% endif %} {% if object.poll_items %} {% endif %} {% if can_vote %}

{% endif %} {% endif %} {{ display_og_meta(object) }}
{{ display_attachments(object) }}
{% if is_admin and (object.is_from_outbox or object.is_from_inbox) %} {% endif %} {% if likes or shares or webmentions %}
{% if likes %}
Likes
{% for like in likes %} {{ like.actor.handle}} {% endfor %}
{% endif %} {% if shares %}
Shares
{% for share in shares %} {{ share.actor.handle}} {% endfor %}
{% endif %} {% if webmentions %}
Webmentions
{% for webmention in webmentions %} {% set wm = webmention.as_facepile_item %} {% if wm %} {{ wm.actor_name }} {% endif %} {% endfor %}
{% endif %}
{% endif %}
{% endif %} {% endmacro %}