{# 评论区:数据(权限判断、展示文本、样式类)由模块准备成 comment_rows, 模板只负责排版。author / reply_to 是纯文本(Jinja 自动转义), content 是模块产出的 Markup(已转义并保留换行)。 #}

{{ t('comment_comments', total=comment_total) }}

{% if comment_rows %}
{% for row in comment_rows %}
{{ row.author }} {% if row.badge %}{{ row.badge }}{% endif %} {{ row.created }}
{% for action in row.actions %} {% if action.method == 'post' %}
{{ csrf_input() }}
{% else %} {{ t(action.label_key) }} {% endif %} {% endfor %} {% if row.reply_url %} {{ t('comment_reply') }} {% endif %}

{%- if row.reply_to %}{{ t('comment_replying', name=row.reply_to) }} {% endif -%} {{ row.content }}{% if row.is_deleted %}{{ t('comment_redacted') }}{% endif %}

{% endfor %}
{% else %}

{{ t('comment_none') }}

{% endif %}
{% if user %}

{{ comment_form.title }}

{% if reply_to_message %}

{{ reply_to_message }}

{% endif %}
{{ csrf_input() }} {% if not comment_form.editing %} {% endif %}
{% else %}

{{ t('comment_login_hint') }}

{% endif %}