| | |
| | | </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"> |
| | | <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 }}"> |
| | | <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> |
| | | <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 %} |