| | |
| | | <html lang="ru" class="dark"> |
| | | <head> |
| | | <meta charset="utf-8"> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1"> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover"> |
| | | <title>{% block title %}Amadeus{% endblock %}</title> |
| | | <script> |
| | | // Применяем сохранённую тему до отрисовки, чтобы не мигало. |
| | |
| | | </head> |
| | | <body class="min-h-screen bg-gray-50 text-gray-900 dark:bg-gray-950 dark:text-gray-100 font-sans antialiased"> |
| | | <div class="flex min-h-screen"> |
| | | <aside class="hidden md:flex w-64 shrink-0 flex-col border-r border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900"> |
| | | <div class="h-16 flex items-center gap-2 px-5 border-b border-gray-200 dark:border-gray-800"> |
| | | <span class="inline-flex h-8 w-8 items-center justify-center rounded-lg bg-brand-600 text-white font-bold">A</span> |
| | | <!-- Сайдбар: только на десктопе --> |
| | | <aside class="hidden w-64 shrink-0 flex-col border-r border-gray-200 bg-white dark:border-gray-800 dark:bg-gray-900 md:flex"> |
| | | <div class="flex h-16 items-center gap-2 border-b border-gray-200 px-5 dark:border-gray-800"> |
| | | <span class="relative inline-flex h-8 w-8 items-center justify-center overflow-hidden rounded-lg bg-brand-600 font-bold text-white"> |
| | | A |
| | | <img src="/avatar/bot" alt="" class="absolute inset-0 h-full w-full object-cover" onerror="this.remove()"> |
| | | </span> |
| | | <span class="text-lg font-semibold">Amadeus</span> |
| | | </div> |
| | | <nav class="flex-1 p-3 space-y-1 text-sm"> |
| | | <nav class="flex-1 space-y-1 overflow-y-auto p-3 text-sm"> |
| | | {% set items = [ |
| | | ("dash", "/", "Дашборд"), |
| | | ("chats", "/chats", "Чаты"), |
| | |
| | | ] %} |
| | | {% for key, href, label in items %} |
| | | <a href="{{ href }}" |
| | | class="flex items-center rounded-lg px-3 py-2 transition |
| | | class="flex items-center rounded-lg px-3 py-2.5 transition |
| | | {% if active == key %}bg-brand-600 text-white shadow{% else %}text-gray-600 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-800{% endif %}"> |
| | | {{ label }} |
| | | </a> |
| | | {% endfor %} |
| | | </nav> |
| | | <div class="p-3 border-t border-gray-200 dark:border-gray-800"> |
| | | <div class="border-t border-gray-200 p-3 dark:border-gray-800"> |
| | | <div class="flex items-center gap-3"> |
| | | {% if user and user.photo_url %} |
| | | <img src="{{ user.photo_url }}" class="h-9 w-9 rounded-full object-cover" alt=""> |
| | | {% else %} |
| | | <span class="inline-flex h-9 w-9 items-center justify-center rounded-full bg-gray-200 dark:bg-gray-700 text-sm font-medium"> |
| | | <span class="inline-flex h-9 w-9 items-center justify-center rounded-full bg-gray-200 text-sm font-medium dark:bg-gray-700"> |
| | | {{ (user.first_name or "?")[:1] }} |
| | | </span> |
| | | {% endif %} |
| | |
| | | <div class="truncate text-xs text-gray-500">{% if user.username %}@{{ user.username }}{% else %}id {{ user.user_id }}{% endif %}</div> |
| | | </div> |
| | | </div> |
| | | <a href="/logout" class="mt-3 block text-center rounded-lg border border-gray-200 dark:border-gray-700 px-3 py-1.5 text-sm hover:bg-gray-100 dark:hover:bg-gray-800">Выйти</a> |
| | | <a href="/logout" class="mt-3 block rounded-lg border border-gray-200 px-3 py-1.5 text-center text-sm hover:bg-gray-100 dark:border-gray-700 dark:hover:bg-gray-800">Выйти</a> |
| | | </div> |
| | | </aside> |
| | | |
| | | <div class="flex-1 flex flex-col min-w-0"> |
| | | <header class="h-16 flex items-center justify-between gap-4 px-6 border-b border-gray-200 dark:border-gray-800 bg-white/70 dark:bg-gray-900/70 backdrop-blur"> |
| | | <h1 class="text-lg font-semibold truncate">{% block header %}{% endblock %}</h1> |
| | | <div class="flex min-w-0 flex-1 flex-col"> |
| | | <header class="sticky top-0 z-20 flex h-14 items-center justify-between gap-3 border-b border-gray-200 bg-white/80 px-4 backdrop-blur dark:border-gray-800 dark:bg-gray-900/80 md:h-16 md:px-6"> |
| | | <div class="flex min-w-0 items-center gap-3"> |
| | | <span class="relative inline-flex h-8 w-8 items-center justify-center overflow-hidden rounded-lg bg-brand-600 font-bold text-white md:hidden"> |
| | | A |
| | | <img src="/avatar/bot" alt="" class="absolute inset-0 h-full w-full object-cover" onerror="this.remove()"> |
| | | </span> |
| | | <h1 class="truncate text-base font-semibold md:text-lg">{% block header %}{% endblock %}</h1> |
| | | </div> |
| | | <div class="flex items-center gap-2"> |
| | | <button id="theme-toggle" class="rounded-lg border border-gray-200 dark:border-gray-700 px-3 py-1.5 text-sm hover:bg-gray-100 dark:hover:bg-gray-800">Тема</button> |
| | | <a href="/logout" class="md:hidden rounded-lg border border-gray-200 dark:border-gray-700 px-3 py-1.5 text-sm">Выйти</a> |
| | | <button id="theme-toggle" class="rounded-lg border border-gray-200 px-3 py-1.5 text-sm hover:bg-gray-100 dark:border-gray-700 dark:hover:bg-gray-800">Тема</button> |
| | | <a href="/logout" class="rounded-lg border border-gray-200 px-3 py-1.5 text-sm hover:bg-gray-100 dark:border-gray-700 dark:hover:bg-gray-800 md:hidden">Выйти</a> |
| | | </div> |
| | | </header> |
| | | <main class="p-6 space-y-6"> |
| | | <main class="space-y-6 p-4 pb-24 md:p-6 md:pb-6"> |
| | | {% block content %}{% endblock %} |
| | | </main> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- Нижняя навигация: только на мобильных --> |
| | | <nav class="fixed inset-x-0 bottom-0 z-30 grid grid-cols-5 border-t border-gray-200 bg-white/95 backdrop-blur dark:border-gray-800 dark:bg-gray-900/95 md:hidden"> |
| | | {% set nav = [ |
| | | ("dash", "/", "Главная"), |
| | | ("chats", "/chats", "Чаты"), |
| | | ("users", "/users", "Люди"), |
| | | ("captcha", "/captcha", "Капчи"), |
| | | ("log", "/log", "Журнал") |
| | | ] %} |
| | | {% for key, href, label in nav %} |
| | | <a href="{{ href }}" class="flex flex-col items-center justify-center py-2.5 text-[11px] leading-tight |
| | | {% if active == key %}text-brand-600 dark:text-brand-400 font-medium{% else %}text-gray-500 dark:text-gray-400{% endif %}"> |
| | | {{ label }} |
| | | </a> |
| | | {% endfor %} |
| | | </nav> |
| | | |
| | | <script> |
| | | // Переключатель тёмной/светлой темы. |
| | | document.getElementById("theme-toggle").addEventListener("click", function () { |