{% from 'core/macros.jinja' import user_profile_link_short_name %} {% macro display_forum(forum, user, is_root=False) %}
{% if not is_root %} {% else %} {% endif %} {% if user.is_owner(forum) %} {% endif %}
{% if not is_root %}

{{ forum.topic_number }}

{% endif %}
{% endmacro %} {% macro display_topic(topic, user, first_unread=False) %}
{% if first_unread %} {% else %} {% endif %}
{{ topic.title or topic.messages.first().title }}

{{ topic.description }}

{% if user.can_edit(topic) %} {% endif %}

{{ user_profile_link_short_name(topic.author) }}

{{ topic._message_number }}

{% set last_msg = topic.last_message %} {% if last_msg %} {{ user_profile_link_short_name(last_msg.author) }}
{{ last_msg.date|localtime|date(DATETIME_FORMAT) }} {{ last_msg.date|localtime|time(DATETIME_FORMAT) }} {% endif %}

{% endmacro %} {% macro display_breadcrumb(forum, topic="") %}

{% trans %}Forum{% endtrans %} {% for f in forum.get_parent_list()|reverse %} > {{ f }} {% endfor %} > {{ forum }} {% if topic != "" %} > {{ topic }}{%- endif -%}

{% endmacro %} {% macro display_message(m, user, unread=False) %} {% set user_is_admin = m.topic.is_owned_by(user) %}
{% if user_is_admin or not m._deleted %}
{% if m.author.avatar_pict %} {% trans %}Profile{% endtrans %} {% elif m.author.profile_pict %} {% trans %}Profile{% endtrans %} {% else %} {% trans %}Profile{% endtrans %} {% endif %}
{% if user.can_edit(m) %} {% endif %} {% if user_is_admin and m._deleted %} {% trans %}Undelete{% endtrans %} {% endif %} {% if not m._deleted and (user_is_admin or user.id == m.author_id) %} {% endif %}
{% endif %} {# close `user.can_view(m) or user_is_admin` #} {% if user.can_view(m) %}
{{ m.message|markdown }} {% if m.can_be_moderated_by(user) %} {% endif %}
{% if m.author.forum_signature %}
{{ m.author.forum_signature|markdown }}
{% endif %} {% else %}

{% trans %}Deleted or unreadable message.{% endtrans %}

{% endif %}
{{ m.mark_as_read(user) or "" }} {% endmacro %} {% macro display_search_bar(request) %} {% endmacro %}