{% extends "base.html" %} {% load static %} {% block title %}Документы{% endblock %} {% block extra_css %} {% endblock %} {% block content %}
{# ===== Шапка страницы ===== #}

Документы

{% if can_manage_documents or user.is_staff or user.is_superuser %}
{% if perms.documents.add_document %} {% endif %}
{% else %} Показаны ваши документы {% endif %}
{# ===== Карточка со списком ===== #}
{% if documents %}
{% for doc in documents %}
{% if doc.file_url %} {{ doc.title|default:"Без названия" }} {% 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 %}
{# Вкладка "Мои" — как раньше #} {% if scope == 'mine' %} {% if doc.id in acked_ids %} Ознакомлен {% else %} Ознакомиться {% endif %} {# Вкладка "Все" — кнопка модалки #} {% else %} {% endif %} {% if show_admin_controls %} {% 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 %}
{# ===== Пагинация (если понадобится — через next_url/prev_url) ===== #} {% if prev_url or next_url %}
Назад Вперёд
{% endif %}
{# ===== Модалка ведомости ознакомлений ===== #} {% endblock %} {% block extra_js %} {% endblock %}