{% from "_macros.html" import icon %} {% if left or failed %}

Отписались: {{ left }}{% if failed %}, не удалось: {{ failed }}{% endif %}

{% endif %} {% if selected_phone %} Показан сохранённый список диалогов{% if dialogs_cached_at %} от {{ dialogs_cached_at|local_dt }}{% endif %}. Кнопка «Обновить диалоги» заново загружает данные из Telegram. {% if dialogs_partial %}
Не удалось полностью загрузить диалоги из Telegram. Список может быть неполным.
{% endif %} {# Refresh lives inside the fragment so its phone always matches the shown account, even after an HTMX account switch (the static page selector swaps only this div). #}
{% endif %} {% if dialogs %} {% set channels = dialogs | selectattr("channel_type", "in", ["channel", "monoforum", "scam", "fake", "restricted"]) | list %} {% set groups = dialogs | selectattr("channel_type", "in", ["supergroup", "group", "gigagroup", "forum"]) | list %} {% set dms = dialogs | selectattr("channel_type", "equalto", "dm") | list %} {% set bots = dialogs | selectattr("channel_type", "equalto", "bot") | list %} {% set own = dialogs | selectattr("is_own") | list %}

Всего диалогов: {{ dialogs|length }}

0 выбрано
{% macro dialog_row_actions(d, selected_phone) %}
{% endmacro %} {% macro dialog_pane(items, pane_id, empty_text, with_type=True, active=False) %}
{% if items %}
{% if with_type %}{% endif %}{% if with_type %}{% endif %} {% for d in items %} {% if with_type %}{% endif %} {% if with_type %}{% endif %} {% endfor %}
ТипНазваниеUsernameВ базеДействия
{{ d.channel_type }}{{ d.title }} {% if d.username %}@{{ d.username }}{% else %}—{% endif %}{% if d.already_added %}{{ icon("success") }}{% else %}—{% endif %}{{ dialog_row_actions(d, selected_phone) }}
{% for d in items %}
{{ d.title }}
{% if with_type %} {{ d.channel_type }}{% if d.username %} · @{{ d.username }}{% endif %}{% if d.already_added %} · {{ icon("success") }}{% endif %} {% elif d.username %} @{{ d.username }} {% endif %}
{{ dialog_row_actions(d, selected_phone) }}
{% endfor %}
{% else %}

{{ empty_text }}

{% endif %}
{% endmacro %}
{{ dialog_pane(own, 'own', 'Нет своих каналов/групп.') }} {{ dialog_pane(channels, 'channels', 'Нет каналов.', active=True) }} {{ dialog_pane(groups, 'groups', 'Нет групп.') }} {{ dialog_pane(dms, 'dms', 'Нет личных диалогов.', with_type=False) }} {{ dialog_pane(bots, 'bots', 'Нет ботов.', with_type=False) }}
{% elif selected_phone %}

Нет диалогов.

{% else %}

Выберите аккаунт, чтобы загрузить список диалогов.

{% endif %}