| | |
| | | <img src="/avatar/{{ chat.chat_id }}" alt="" |
| | | class="h-12 w-12 rounded-full bg-gray-200 object-cover dark:bg-gray-700" |
| | | onerror="this.style.visibility='hidden'"> |
| | | <div class="text-sm text-gray-500">id {{ chat.chat_id }} · {{ chat.type }}</div> |
| | | <div class="min-w-0 flex-1 text-sm text-gray-500">id {{ chat.chat_id }} · {{ chat.type }}</div> |
| | | <a href="/chats/{{ chat.chat_id }}/messages" target="_blank" rel="noopener" |
| | | class="shrink-0 rounded-lg border border-gray-200 px-3 py-1.5 text-sm text-brand-600 hover:bg-gray-100 dark:border-gray-700 dark:text-brand-400 dark:hover:bg-gray-800"> |
| | | Последние сообщения ↗ |
| | | </a> |
| | | </div> |
| | | |
| | | <section class="rounded-xl border border-gray-200 bg-white p-4 shadow-sm dark:border-gray-800 dark:bg-gray-900"> |
| | |
| | | </section> |
| | | |
| | | <section class="rounded-xl border border-gray-200 bg-white shadow-sm dark:border-gray-800 dark:bg-gray-900"> |
| | | <div class="border-b border-gray-200 px-5 py-3 font-semibold dark:border-gray-800">Репорты ({{ reports|length }})</div> |
| | | <div class="flex items-center justify-between border-b border-gray-200 px-5 py-3 dark:border-gray-800"> |
| | | <span class="font-semibold">Репорты ({{ reports|length }})</span> |
| | | {% if reports and myperms.config %} |
| | | <form method="post" action="/reports/clear" onsubmit="return confirm('Очистить все репорты?')"> |
| | | <input type="hidden" name="chat_id" value="{{ chat.chat_id }}"> |
| | | <button class="rounded-lg border border-red-300 px-3 py-1 text-xs text-red-600 hover:bg-red-50 dark:border-red-800 dark:text-red-300 dark:hover:bg-red-950/40">Очистить всё</button> |
| | | </form> |
| | | {% endif %} |
| | | </div> |
| | | <div class="divide-y divide-gray-100 dark:divide-gray-800"> |
| | | {% for r in reports %} |
| | | <div class="px-5 py-3 text-sm {% if r.status == 'closed' %}opacity-50{% endif %}"> |
| | | <div class="px-5 py-3 text-sm {% if r.status == 'closed' %}opacity-60{% endif %}"> |
| | | <div class="flex flex-wrap items-center justify-between gap-2"> |
| | | <span class="text-gray-600 dark:text-gray-300"> |
| | | #{{ r.id }} · от {{ r.user_id }}{% if r.target_id %} на {{ r.target_id }}{% endif %} |
| | |
| | | <span class="text-xs text-gray-400">{{ fmt_dt(r.created_at) }}</span> |
| | | </div> |
| | | <div class="mt-1">{{ r.text or "(без текста)" }}</div> |
| | | {% if r.target_text %} |
| | | <div class="mt-2 rounded-lg bg-gray-50 px-3 py-2 text-xs text-gray-600 dark:bg-gray-800 dark:text-gray-300"> |
| | | Сообщение: {{ r.target_text }} |
| | | {% if r.link %} · <a class="text-brand-600 hover:underline dark:text-brand-400" href="{{ r.link }}" target="_blank" rel="noopener">открыть в Telegram</a>{% endif %} |
| | | </div> |
| | | {% endif %} |
| | | {% if r.status != 'closed' and myperms.config %} |
| | | <form method="post" action="/reports/close" class="mt-2"> |
| | | <input type="hidden" name="chat_id" value="{{ chat.chat_id }}"> |
| | | <input type="hidden" name="report_id" value="{{ r.id }}"> |
| | | <button class="rounded-lg border border-gray-200 px-3 py-1 text-xs hover:bg-gray-100 dark:border-gray-700 dark:hover:bg-gray-800">Закрыть</button> |
| | | </form> |
| | | <div class="mt-2 flex flex-wrap items-center gap-2"> |
| | | <form method="post" action="/reports/accept" class="flex flex-wrap items-center gap-2"> |
| | | <input type="hidden" name="chat_id" value="{{ chat.chat_id }}"> |
| | | <input type="hidden" name="report_id" value="{{ r.id }}"> |
| | | <select name="kind" class="rounded-lg border border-gray-300 bg-transparent px-2 py-1 text-xs dark:border-gray-700"> |
| | | <option value="warn">варн</option> |
| | | <option value="mute">мут</option> |
| | | <option value="ban">бан</option> |
| | | </select> |
| | | <input name="dur" placeholder="-" class="w-20 rounded-lg border border-gray-300 bg-transparent px-2 py-1 text-xs dark:border-gray-700"> |
| | | <input name="reason" placeholder="причина" class="rounded-lg border border-gray-300 bg-transparent px-2 py-1 text-xs dark:border-gray-700"> |
| | | <button class="rounded-lg bg-brand-600 px-3 py-1 text-xs font-medium text-white hover:bg-brand-700">Принять</button> |
| | | </form> |
| | | <form method="post" action="/reports/close"> |
| | | <input type="hidden" name="chat_id" value="{{ chat.chat_id }}"> |
| | | <input type="hidden" name="report_id" value="{{ r.id }}"> |
| | | <button class="rounded-lg border border-gray-200 px-3 py-1 text-xs hover:bg-gray-100 dark:border-gray-700 dark:hover:bg-gray-800">Отклонить</button> |
| | | </form> |
| | | </div> |
| | | {% endif %} |
| | | </div> |
| | | {% else %} |
| | |
| | | <span class="min-w-0 truncate"> |
| | | {{ "мут" if p.kind == "mute" else "бан" }} · |
| | | <a class="text-brand-600 hover:underline dark:text-brand-400" href="/users/{{ chat.chat_id }}/{{ p.user_id }}">{{ p.user_id }}</a> |
| | | · {{ fmt_dur(p.until) if p.until else "бессрочно" }} |
| | | · {{ fmt_dt(p.until) if p.until else "бессрочно" }} |
| | | {% if not p.active %}<span class="text-xs text-gray-400">(снято)</span>{% endif %} |
| | | </span> |
| | | <span class="ml-2 shrink-0 text-gray-500">{{ fmt_dt(p.created_at) }}</span> |