{% macro display_actor_inline(follower, size=50) -%} {% if follower and follower.id %} {% if not follower.icon %} {% else %} {% endif %}
{{ (follower.name or follower.preferredUsername) | clean | replace_custom_emojis(follower) | safe }}
@{{ follower.preferredUsername }}@{{ follower | url_or_id | get_url | domain }}
{% endif %} {%- endmacro %} {% macro display_actor_icon(follower, size=50) -%} {% if follower and follower.id %} {% if not follower.icon %} {% else %} {% endif %} {% endif %} {%- endmacro %} {% macro display_actor_oneline(follower) -%} {% if follower and follower.id %} {{ (follower.name or follower.preferredUsername) | clean | replace_custom_emojis(follower) | safe }} @{{ follower.preferredUsername }}@{{ follower | url_or_id | get_url | domain }} {% endif %} {%- endmacro %} {% macro display_actor_box(actor, after=None, before=None, before_url=None) -%} {% if not actor.icon %} {% set icon_url = "/static/nopic.png" %} {% else %} {% set icon_url = actor.icon.url | get_actor_icon_url(50) %} {% endif %} {% if before and before_url %} {{before}} {{ ( actor.name or actor.preferredUsername) | clean | replace_custom_emojis(actor) | safe }} {% endif %} {% if after %} {{ ( actor.name or actor.preferredUsername) | clean | replace_custom_emojis(actor) | safe }} {{ after }} {% endif %} {%- endmacro %} {% macro display_in_reply_to(meta, obj) -%} {% if meta.in_reply_to_actor %} {{ display_actor_box(meta.in_reply_to_actor, before="in reply to", before_url=obj.inReplyTo) }} {% elif meta.in_reply_to_self %} self reply {% endif %} {%- endmacro %} {% macro display_note(obj, perma=False, likes=[], shares=[], meta={}, no_color=False) -%} {% if meta.object_actor %} {% set actor = meta.object_actor %} {% elif meta.actor %} {% set actor = meta.actor %} {% else %} {% set actor = obj.attributedTo | get_actor %} {% endif %} {% if session.logged_in %} {% set perma_id = obj.id | permalink_id %} {% if request.args.get('older_than') %} {% set redir = request.path + "?older_than=" + request.args.get('older_than') + "#activity-" + perma_id %} {% elif request.args.get('newer_than') %} {% set redir = request.path + "?newer_than=" + request.args.get('newer_than') + "#activity-" + perma_id %} {% else %} {% set redir = request.path + "#activity-" + perma_id %} {% endif %} {% set aid = obj.id | quote_plus %} {% endif %} {% set real_end_time = obj.closed or obj.endTime %}
{% if obj.summary %}

{{ obj.summary | clean | replace_custom_emojis(obj) | safe }}

{% endif %} {% if obj | has_type('Video') %}
{% endif %}
{% if obj | has_type(['Article', 'Page']) %} {{ obj.name }} {{ obj | url_or_id | get_url }} {% elif obj | has_type('Question') %} {{ obj.content | update_inline_imgs | clean | replace_custom_emojis(obj) | code_highlight | safe }}
    {% set total_votes = obj | get_total_answers_count(meta) %} {% for oneOf in obj.oneOf %} {% set pct = 0 %} {% if total_votes > 0 %} {% set cnt = oneOf.name | get_answer_count(obj, meta) %} {% set pct = cnt * 100.0 / total_votes %} {% endif %}
  • {% if session.logged_in and not meta.poll_answers_sent and not (real_end_time | gtnow) and not (obj.id | is_from_outbox) %}
    {% endif %} {{ '%0.0f'| format(pct) }}% {{ oneOf.name }} {% if oneOf.name | poll_answer_key in meta.poll_answers_sent %}(your vote){% endif %}
  • {% endfor %} {% if obj.anyOf %} {% for anyOf in obj.anyOf %} {% set pct = 0 %} {% if total_votes > 0 %} {% set cnt = anyOf.name | get_answer_count(obj, meta) %} {% set pct = cnt * 100.0 / total_votes %} {% endif %}
  • {% set already_voted = anyOf.name | poll_answer_key in meta.poll_answers_sent %} {% if session.logged_in and not already_voted and not (real_end_time | gtnow) and not (obj.id | is_from_outbox) %}
    {% elif session.logged_in and already_voted and not (real_end_time | gtnow) %} {% endif %} {{ '%0.0f'| format(pct) }}% {{ anyOf.name }} {% if anyOf.name | poll_answer_key in meta.poll_answers_sent %}(your vote){% endif %}
  • {% endfor %} {% endif %}

{% if real_end_time | gtnow %} Ended {{ real_end_time | format_timeago }} with {{ total_votes }} vote{% if total_votes | gtone %}s{% endif %}. {% else %} Ends {{ real_end_time | format_timeago }} ({{ total_votes }} vote{% if total_votes | gtone %}s{% endif %} as of now). {% endif %}

{% else %} {{ obj.content | update_inline_imgs | clean | replace_custom_emojis(obj) | code_highlight | safe }} {% endif %} {% if obj | has_place %}

Location: {{ obj | get_place | safe }}

{% endif %}
{% if obj.attachment and obj | has_type('Note') %}
{% if obj.sensitive and not request.args.get("show_sensitive") == perma_id %}
{% for k, v in request.args.items() %} {% endfor %}
{% else %} {% if obj.sensitive %}
{% for k, v in request.args.items() %} {% if k != "show_sensitive" %} {% endif %} {% endfor %}
{% endif %} {% if obj.attachment | not_only_imgs %}

Attachments

    {% endif %} {% for a in (obj | iter_note_attachments) %} {% if (a.mediaType and a.mediaType.startswith("image/")) or (a.type and a.type == 'Image') %} {{ a.name }} {% elif (a.mediaType and a.mediaType.startswith("video/")) %}
  • {% elif (a.mediaType and a.mediaType.startswith("audio/")) %}
  • {% else %}
  • {% if a.filename %}{{ a.filename }}{% else %}{{ a.url }}{% endif %}
  • {% endif %} {% endfor %} {% if obj.attachment | not_only_imgs %}
{% endif %} {% endif %}
{% endif %} {% if meta and meta.og_metadata and obj | has_type('Note') %} {% for og in meta.og_metadata %} {% if og.url %} {% if og.image | get_og_image_url %}
{% endif %}
{{ og.title }}

{{ og.description | truncate(80) }}

{{ og.site_name }}
{% endif %} {% endfor %} {% endif %} {% if likes or shares %} {% endif %}
{%- endmacro %} {% macro display_thread(thread, likes=[], shares=[]) -%} {% for reply in thread %} {% if reply._requested %}
{{ display_in_reply_to(reply.meta, reply.activity.object) }}
{{ display_note(reply.activity.object, perma=True, likes=likes, shares=shares, meta=reply.meta) }} {% else %}
{{ display_in_reply_to(reply.meta, reply.activity.object) }}
{{ display_note(reply.activity.object, perma=False, meta=reply.meta) }} {% endif %} {% endfor %} {% endmacro -%} {% macro display_pagination(older_than, newer_than) -%}
{% if older_than %} {% endif %} {% if newer_than %} {% endif %}
{% endmacro -%} {% macro display_pagination_links(older_than, newer_than) -%} {% if older_than %}{% endif %} {% if newer_than %}{% endif %} {% endmacro -%}