{% load common_tags %} {% load i18n %}
{% trans "Ко всем новостям" %}
{% if can_edit %} {% trans "Редактировать" %} {% endif %} {% if can_delete %}
{% csrf_token %}
{% endif %} {% if request.user.is_staff and post.mattermost_targets %}
{% csrf_token %}
{% endif %}
{% if post.mattermost_posted_at %}
✓ {% trans "Опубликовано в чат Mattermost" %} {{ post.mattermost_posted_at|date:"d.m.Y H:i" }}
{% endif %}
{% if post.is_pinned %} 📌 {% trans "Закреплено" %} {% endif %} {% if post.is_important %}{% trans "Важно" %}{% endif %} {{ post.get_category_display }}

{{ post.title }}

{{ post.author|initials }}
{{ post.author.get_full_name|default:"—" }} · {{ post.created_at|date:"d.m.Y H:i" }}
{# body — HTML из редактора, санитизирован nh3 при сохранении #}
{{ post.body|safe }}
{% trans "Комментарии" %} · {{ comments|length }}
{% for comment in comments %}
{{ comment.author|initials }}
{{ comment.author.get_full_name|default:"—" }} {{ comment.created_at|date:"d.m.Y H:i" }} {% if comment.mattermost_source_id %} · {% trans "из Mattermost" %} {% endif %}
{{ comment.text }}
{% empty %}
{% trans "Комментариев пока нет — будьте первым" %}
{% endfor %}
{% csrf_token %}
{{ request.user|initials }}