{% macro display_actor_inline(follower) -%} {% if not follower.icon %} {% else %} {% endif %}
{{ follower.name or follower.preferredUsername }}
@{{ follower.preferredUsername }}@{{ follower.url | domain }}
{%- endmacro %} {% macro display_actor(follower) -%}
{% if not follower.icon %} {% else %} {% endif %}

{{ follower.name or follower.preferredUsername }}

@{{ follower.preferredUsername }}@{{ follower.url | domain }}
{{ follower.summary | safe }}
{%- endmacro %} {% macro display_note(item, perma=False, ui=False, likes=[], shares=[]) -%} {% set actor = item.activity.object.attributedTo | get_actor %}
{{ actor.name or actor.preferredUsername }} @{{ actor.preferredUsername }}@{{ actor.url | domain }} {% if not perma %} {% endif %} {% if item.activity.object.summary %}

{{ item.activity.object.summary }}

{% endif %}
{{ item.activity.object.content | safe }}
{% if item.activity.object.attachment %}
{% if item.activity.object.attachment | not_only_imgs %}

Attachment

{% endif %}
{% endif %}
{% if perma %}{{ item.activity.object.published | format_time }} {% else %} permalink {% if item.meta.count_reply %}{{ item.meta.count_reply }} replies{% endif %} {% if item.meta.count_boost %}{{ item.meta.count_boost }} boosts{% endif %} {% if item.meta.count_like %}{{ item.meta.count_like }} likes{% endif %} {% endif %} {% if ui and session.logged_in %} {% set aid = item.activity.object.id | quote_plus %} reply {% set redir = request.path + "#activity-" + item['_id'].__str__() %} {% if item.meta.boosted %}
{% else %}
{% endif %} {% if item.meta.liked %}
{% else %}
{% endif %} {% endif %}
{% if likes or shares %}
{% if likes %}

{{ item.meta.count_like }} likes

{% for like in likes %} {{ display_actor_inline(like) }} {% endfor %}
{% endif %} {% if shares %}

{{ item.meta.count_boost }} boosts

{% for boost in shares %} {{ display_actor_inline(boost) }} {% endfor %}
{% endif %}
{% endif %}
{%- endmacro %} {% macro display_thread(thread, likes=[], shares=[]) -%} {% for reply in thread %} {% if reply._requested %} {{ display_note(reply, perma=True, ui=False, likes=likes, shares=shares) }} {% else %} {{ display_note(reply, perma=False, ui=True) }} {% endif %} {% endfor %} {% endmacro -%}