{% if doc.file_url %}
{# Для неознакомленных - через acknowledge URL, для ознакомленных - прямо на файл #}
{% if doc.id not in acked_ids and scope == 'mine' %}
{{ doc.title|default:"Без названия" }}
{% else %}
{{ doc.title|default:"Без названия" }}
{% endif %}
{% else %}
{{ doc.title|default:"Без названия" }}
{% endif %}
{{ doc.description|default:"— без описания —" }}
{% if doc.uploaded_at %} • Загружен: {{ doc.uploaded_at|date:"d.m.Y H:i" }}{% endif %}
{% if doc.sent_to_all %} • Для всех{% endif %}
{# В scope=mine показываем только статус #}
{% if scope == 'mine' %}
{% if doc.id in acked_ids %}
Ознакомлен
{% else %}
Требуется ознакомление
{% endif %}
{# В scope=all показываем кнопку ознакомлений #}
{% elif scope == 'all' %}
{% endif %}
{# Кнопки управления только для админов в scope=all #}
{% if show_admin_controls and scope == 'all' %}
{% if perms.documents.change_document or user.is_staff or user.is_superuser %}
{% endif %}
{% if perms.documents.delete_document or user.is_staff or user.is_superuser %}
{% endif %}
{% endif %}
{% endfor %}
{% else %}
Нет доступных документов.
{% endif %}
{# ===== Пагинация ===== #}
{% if prev_url or next_url or page > 1 %}
{% if prev_url %}
Назад
{% else %}
Назад
{% endif %}
{% if next_url %}
Вперёд
{% else %}
Вперёд
{% endif %}