{% extends "base.html" %} {% from "_macros.html" import icon %} {% block title %}Диалоги — TG Agent{% endblock %} {% block content %}

Диалоги

+ Создать канал
{% if accounts %}
Открыть Photo Loader Если аккаунт не выбран, откроется первый доступный профиль.
{% else %}
Открыть Photo Loader Сначала добавьте Telegram-аккаунт в настройках.
{% endif %} {% if accounts %}
{{ icon("loading") }} Загрузка диалогов…
{% if selected_phone %} Показан сохранённый список диалогов{% if dialogs_cached_at %} от {{ dialogs_cached_at|local_dt }}{% endif %}. Кнопка обновления заново загружает данные из Telegram. {% endif %}
{% endif %}
{% if not accounts %}

Нет подключённых аккаунтов. Добавьте аккаунт в Настройках.

{% else %} {% if left or failed %}

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

{% 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_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 %}
{% 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 %}
{% 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 %} {% endif %} {% endblock %}