{# Forum building blocks shared by discussions.html and discussion_thread.html. #} {% macro av(name, size="", official=False) -%} {%- if official -%} {%- else -%} {%- set a = forum_avatar(name) -%} {%- endif -%} {%- endmacro %} {# Author name plus, for the official account, the verified badge; automated posts also say so. Only server-side code can create official posts. #} {% macro author(item, tag="b") -%} <{{ tag }}{% if tag != 'b' %} class="who"{% endif %}>{{ item.author }}{{ tag }}> {%- if item.is_official %} Verified moderator{% endif %} {%- if item.automated %} Automated{% endif %} {%- endmacro %} {# "3h" -> "3h ago"; "now" and calendar dates stay as they are #} {% macro ago(s) -%}{{ s }}{{ ' ago' if s[-1] in 'mhd' else '' }}{%- endmacro %} {% macro stack(names, limit=4) -%} {%- for n in names[:limit] %}{{ av(n) }}{% endfor -%} {%- if names|length > limit %}+{{ names|length - limit }}{% endif -%} {%- endmacro %} {# Up/down vote control. kind: 't' thread or 'r' reply; mine: -1, 0 or 1. #} {% macro vote(kind, id, score, mine=0, layout="col") -%}
Emoji artwork: Twemoji, CC-BY 4.0.
> to quote, `code`, :rocket: for emoji. Ctrl + Enter posts.
{%- endmacro %}
{# Moderator-only pieces. The macros file is imported "with context" so these
can see is_mod and forum_csrf; for everyone else they render nothing. #}
{% macro as_official() -%}
{%- if is_mod %}
{%- endif %}
{%- endmacro %}
{% macro mod_button(kind, id, action, label, next) -%}
{%- if is_mod %}
{%- endif %}
{%- endmacro %}
{% macro report_button(kind, id) -%}
{%- endmacro %}
{% macro honeypot() -%}
{%- endmacro %}