{% macro avatar(username, size="24px", selector_type="username") -%} @{{ username }} {%- endmacro %} {% macro community_avatar(id, community=false, size="24px") -%} {% if community %} {{ community.title }}'s avatar {% else %} {{ id }}'s avatar {% endif %} {%- endmacro %} {% macro banner(username, border_radius="var(--radius)") -%} {%- endmacro %} {% macro community_banner(id, community=false) -%} {% if community %} {% else %} {% endif %} {%- endmacro %} {% macro community_listing_card(community) -%} {{ components::community_avatar(id=community.id, community=community, size="48px") }}

{{ community.context.display_name }}

{{ community.member_count }} members
{%- endmacro %} {% macro username(user) -%}
{% if user.settings.display_name %} {{ user.settings.display_name }} {% else %} {{ user.username }} {% endif %}
{%- endmacro %} {% macro likes(id, asset_type, likes=0, dislikes=0) -%} {%- endmacro %} {% macro full_username(user) -%}
{{ components::username(user=user) }} {{ components::online_indicator(user=user) }} {% if user.is_verified %} {{ icon "badge-check" }} {% endif %}
{%- endmacro %} {% macro post(post, owner, secondary=false, community=false, show_community=true, can_manage_post=false) -%} {% if community and show_community and post.community != config.town_square %}
{{ components::community_avatar(id=post.community, community=community) }} {% if community.context.display_name %} {{ community.context.display_name }} {% else %} {{ community.title }} {% endif %} {% if post.context.is_pinned %} {{ icon "pin" }} {% endif %}
{% endif %}
{{ components::avatar(username=post.owner, size="52px", selector_type="id") }}
{{ components::full_username(user=owner) }} {% if post.context.edited != 0 %}
{{ post.context.edited }} *
{% else %} {{ post.created }} {% endif %} {% if show_community %} {% if not community %} {{ components::community_avatar(id=post.community) }} {% endif %} {% endif %} {% if post.context.is_nsfw %} {{ icon "square-asterisk" }} {% endif %}
{{ post.content|markdown|safe }}
{% if user %}
{{ components::likes(id=post.id, asset_type="Post", likes=post.likes, dislikes=post.dislikes) }}
{% else %}
{% endif %}
{{ icon "message-circle" }} {{ post.comment_count }} {{ icon "external-link" }} {% if user %} {% endif %}
{% if community and show_community and post.community != config.town_square %}
{% endif %} {%- endmacro %} {% macro notification(notification) -%}
{% if not notification.read %} {% endif %} {{ notification.title|markdown|safe }}
{{ notification.content|markdown|safe }}
{% if notification.read %} {% else %} {% endif %}
{%- endmacro %} {% macro user_card(user) -%}
{{ components::banner(username=user.username, border_radius="0px") }}
{{ components::avatar(username=user.username, size="48px") }}
{{ components::username(user=user) }} {{ components::online_indicator(user=user) }}
{%- endmacro %} {% macro pagination(page=0, items=0) -%}
{% if page > 0 %} {{ icon "arrow-left" }} {{ text "general:link.previous" }} {% else %}
{% endif %} {% if items != 0 %} {{ text "general:link.next" }} {{ icon "arrow-right"}} {% endif %}
{%- endmacro %} {% macro online_indicator(user) -%} {% if not user.settings.private_last_online or is_helper %}
{% endif %} {%- endmacro %} {% macro town_square_post_form() -%} {% if config.town_square and user %}
{{ icon "pencil" }} {{ text "communities:label.create_post" }}
Posts created here go to the town square community!
{% endif %} {%- endmacro %}