{# templates/employees/employee_list.html #} {% extends 'base.html' %} {% load static django_bootstrap5 %} {% block title %}Сотрудники{% endblock %} {% block extra_css %} {% endblock %} {% block content %}
{# ===== НОВАЯ ШАПКА С КОМПОНЕНТОМ ===== #} {% include "includes/components/page_header.html" with icon="bi-people" title="Сотрудники" count=employees|length count_label=count_label search_id="empFilter" search_placeholder="Поиск по ФИО, должности или отделу" has_filters=True filters_target="empFilters" filters_template="employees/_filters.html" create_as_card=True create_modal="createEmployeeModal" create_text="Создать профиль" %}
{% if employees %} {% for emp in employees %}
{% if emp.avatar %} {{ emp.last_name }} {{ emp.first_name }} {% else %} {% endif %}
{% if emp.id %} {{ emp.last_name }} {{ emp.first_name }}{% if emp.patronymic %} {{ emp.patronymic }}{% endif %} {% else %} {{ emp.last_name }} {{ emp.first_name }}{% if emp.patronymic %} {{ emp.patronymic }}{% endif %} {% endif %} {% if emp.position and emp.position.name %} — {{ emp.position.name }} {% elif emp.position_label %} — {{ emp.position_label }} {% elif emp.position %} — Должность #{{ emp.position }} {% endif %}
{% if emp.departments %}
{% for d in emp.departments %} {% if d.name %} {% if d.id %} {{ d.name }} {% else %} {{ d.name }} {% endif %} {% if not forloop.last %}, {% endif %} {% endif %} {% endfor %}
{% elif is_filtered_by_department and current_department %}
{{ current_department.name }}
{% endif %}
{% if emp.id and user.id != emp.id %} {% if can_manage_roles and is_filtered_by_department and current_department and emp.id != current_department.head_id %} Роль {% endif %} Чат {% endif %}
{% endfor %} {% else %}
Нет сотрудников.
{% endif %}
{# Пагинация #} {% if next_url or prev_url %}
Назад {% if count %} Всего: {{ count }} {% endif %} Вперёд
{% endif %}
{# Модальное окно для создания сотрудника #} {% include "employees/modals/_create_employee.html" %} {% endblock %}