{# ===== НОВАЯ ШАПКА С КОМПОНЕНТОМ ===== #}
{% include "includes/components/page_header.html" with icon="bi-chat-dots" title="Мои чаты" search_id="chatSearch" search_placeholder="Поиск по названию или участникам" create_as_card=True create_modal="chatCreateModal" create_text="Создать чат" %}
{# ===== ДВУХКОЛОНОЧНАЯ СТРУКТУРА ===== #}
{# Левая колонка - иконки типов чатов #}
{# Правая колонка - список чатов #}
{# ===== 1) ГЛОБАЛЬНЫЙ ===== #}
Глобальный
Нет глобального чата
{% for chat in chats %}
{% if chat.type == 'global' %}
{% with last=chat.last_message.0 %}
{% for chat in chats %}
{% if chat.type == 'private' %}
{% with last=chat.last_message.0 %}
{% with p0=chat.participants.all.0 p1=chat.participants.all.1 %}
{% if p0 and p0 != user and p0.avatar %}
{% elif p1 and p1 != user and p1.avatar %}
{% else %}
{% endif %}
{% endwith %}