Update admin editor layout
This commit is contained in:
@@ -145,6 +145,7 @@
|
||||
.htmx-indicator { display:none; }
|
||||
.htmx-request .htmx-indicator { display:inline-block; }
|
||||
.htmx-request.htmx-indicator { display:inline-block; }
|
||||
[x-cloak] { display: none !important; }
|
||||
|
||||
/* Scrollbar */
|
||||
::-webkit-scrollbar { width: 8px; height: 8px; }
|
||||
@@ -157,58 +158,63 @@
|
||||
|
||||
{% if user %}
|
||||
<!-- Sidebar -->
|
||||
<aside class="w-64 flex-shrink-0 bg-app-surface border-r border-app-border flex flex-col hidden md:flex sticky top-0 h-screen">
|
||||
<div class="p-6">
|
||||
<div class="flex items-center gap-3 text-app-textMain font-bold text-lg tracking-wide">
|
||||
<i data-lucide="zap" class="w-6 h-6 text-app-primary"></i>
|
||||
<span>Parser Admin</span>
|
||||
<aside x-data="{ expanded: false }" :class="expanded ? 'w-64' : 'w-20'" class="flex-shrink-0 bg-app-surface border-r border-app-border flex flex-col hidden md:flex sticky top-0 h-screen transition-all duration-200">
|
||||
<div class="p-4">
|
||||
<div class="flex items-center gap-3 text-app-textMain font-bold text-lg tracking-wide" :class="expanded ? 'justify-between' : 'justify-center'">
|
||||
<div class="flex items-center gap-3 min-w-0">
|
||||
<i data-lucide="zap" class="w-6 h-6 text-app-primary flex-shrink-0"></i>
|
||||
<span x-show="expanded" x-cloak class="truncate">Parser Admin</span>
|
||||
</div>
|
||||
<button type="button" class="btn btn-ghost btn-icon flex-shrink-0" @click="expanded = !expanded" :aria-label="expanded ? 'Свернуть меню' : 'Развернуть меню'" :title="expanded ? 'Свернуть меню' : 'Развернуть меню'">
|
||||
<i data-lucide="panel-left" class="w-5 h-5"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<nav class="flex-1 px-4 space-y-1 overflow-y-auto">
|
||||
<a href="/raw" class="flex items-center gap-3 px-3 py-2 rounded-lg text-sm font-medium transition-colors {{ 'bg-app-primary/10 text-app-primary' if 'raw' in request.url.path else 'text-app-textMuted hover:bg-app-surfaceHover hover:text-app-textMain' }}">
|
||||
<i data-lucide="inbox" class="w-5 h-5"></i>
|
||||
Сырые посты
|
||||
<a href="/raw" title="Сырые посты" class="flex items-center gap-3 px-3 py-2 rounded-lg text-sm font-medium transition-colors {{ 'bg-app-primary/10 text-app-primary' if 'raw' in request.url.path else 'text-app-textMuted hover:bg-app-surfaceHover hover:text-app-textMain' }}" :class="expanded ? '' : 'justify-center'">
|
||||
<i data-lucide="inbox" class="w-5 h-5 flex-shrink-0"></i>
|
||||
<span x-show="expanded" x-cloak>Сырые посты</span>
|
||||
</a>
|
||||
<a href="/editor" class="flex items-center gap-3 px-3 py-2 rounded-lg text-sm font-medium transition-colors {{ 'bg-app-primary/10 text-app-primary' if 'editor' in request.url.path else 'text-app-textMuted hover:bg-app-surfaceHover hover:text-app-textMain' }}">
|
||||
<i data-lucide="edit-3" class="w-5 h-5"></i>
|
||||
Редактор
|
||||
<a href="/editor" title="Редактор" class="flex items-center gap-3 px-3 py-2 rounded-lg text-sm font-medium transition-colors {{ 'bg-app-primary/10 text-app-primary' if 'editor' in request.url.path else 'text-app-textMuted hover:bg-app-surfaceHover hover:text-app-textMain' }}" :class="expanded ? '' : 'justify-center'">
|
||||
<i data-lucide="edit-3" class="w-5 h-5 flex-shrink-0"></i>
|
||||
<span x-show="expanded" x-cloak>Редактор</span>
|
||||
</a>
|
||||
<a href="/sources" class="flex items-center gap-3 px-3 py-2 rounded-lg text-sm font-medium transition-colors {{ 'bg-app-primary/10 text-app-primary' if 'sources' in request.url.path else 'text-app-textMuted hover:bg-app-surfaceHover hover:text-app-textMain' }}">
|
||||
<i data-lucide="database" class="w-5 h-5"></i>
|
||||
Источники
|
||||
<a href="/sources" title="Источники" class="flex items-center gap-3 px-3 py-2 rounded-lg text-sm font-medium transition-colors {{ 'bg-app-primary/10 text-app-primary' if 'sources' in request.url.path else 'text-app-textMuted hover:bg-app-surfaceHover hover:text-app-textMain' }}" :class="expanded ? '' : 'justify-center'">
|
||||
<i data-lucide="database" class="w-5 h-5 flex-shrink-0"></i>
|
||||
<span x-show="expanded" x-cloak>Источники</span>
|
||||
</a>
|
||||
{% if user.role != "editor" %}
|
||||
<a href="/workers" class="flex items-center gap-3 px-3 py-2 rounded-lg text-sm font-medium transition-colors {{ 'bg-app-primary/10 text-app-primary' if 'workers' in request.url.path else 'text-app-textMuted hover:bg-app-surfaceHover hover:text-app-textMain' }}">
|
||||
<i data-lucide="cpu" class="w-5 h-5"></i>
|
||||
Воркеры
|
||||
<a href="/workers" title="Воркеры" class="flex items-center gap-3 px-3 py-2 rounded-lg text-sm font-medium transition-colors {{ 'bg-app-primary/10 text-app-primary' if 'workers' in request.url.path else 'text-app-textMuted hover:bg-app-surfaceHover hover:text-app-textMain' }}" :class="expanded ? '' : 'justify-center'">
|
||||
<i data-lucide="cpu" class="w-5 h-5 flex-shrink-0"></i>
|
||||
<span x-show="expanded" x-cloak>Воркеры</span>
|
||||
</a>
|
||||
<a href="/users" class="flex items-center gap-3 px-3 py-2 rounded-lg text-sm font-medium transition-colors {{ 'bg-app-primary/10 text-app-primary' if 'users' in request.url.path else 'text-app-textMuted hover:bg-app-surfaceHover hover:text-app-textMain' }}">
|
||||
<i data-lucide="users" class="w-5 h-5"></i>
|
||||
Пользователи
|
||||
<a href="/users" title="Пользователи" class="flex items-center gap-3 px-3 py-2 rounded-lg text-sm font-medium transition-colors {{ 'bg-app-primary/10 text-app-primary' if 'users' in request.url.path else 'text-app-textMuted hover:bg-app-surfaceHover hover:text-app-textMain' }}" :class="expanded ? '' : 'justify-center'">
|
||||
<i data-lucide="users" class="w-5 h-5 flex-shrink-0"></i>
|
||||
<span x-show="expanded" x-cloak>Пользователи</span>
|
||||
</a>
|
||||
<a href="/logs" class="flex items-center gap-3 px-3 py-2 rounded-lg text-sm font-medium transition-colors {{ 'bg-app-primary/10 text-app-primary' if 'logs' in request.url.path else 'text-app-textMuted hover:bg-app-surfaceHover hover:text-app-textMain' }}">
|
||||
<i data-lucide="file-text" class="w-5 h-5"></i>
|
||||
Логи
|
||||
<a href="/logs" title="Логи" class="flex items-center gap-3 px-3 py-2 rounded-lg text-sm font-medium transition-colors {{ 'bg-app-primary/10 text-app-primary' if 'logs' in request.url.path else 'text-app-textMuted hover:bg-app-surfaceHover hover:text-app-textMain' }}" :class="expanded ? '' : 'justify-center'">
|
||||
<i data-lucide="file-text" class="w-5 h-5 flex-shrink-0"></i>
|
||||
<span x-show="expanded" x-cloak>Логи</span>
|
||||
</a>
|
||||
{% endif %}
|
||||
</nav>
|
||||
|
||||
<div class="p-4 border-t border-app-border">
|
||||
<div class="flex items-center gap-3 px-3 py-2 mb-2">
|
||||
<div class="w-8 h-8 rounded-full bg-app-primary/20 flex items-center justify-center text-app-primary font-bold text-sm">
|
||||
<div class="flex items-center gap-3 px-3 py-2 mb-2" :class="expanded ? '' : 'justify-center'">
|
||||
<div class="w-8 h-8 rounded-full bg-app-primary/20 flex items-center justify-center text-app-primary font-bold text-sm flex-shrink-0">
|
||||
{{ user.login[0]|upper }}
|
||||
</div>
|
||||
<div class="flex-1 min-w-0">
|
||||
<div x-show="expanded" x-cloak class="flex-1 min-w-0">
|
||||
<div class="text-sm font-medium text-app-textMain truncate">{{ user.login }}</div>
|
||||
<div class="text-xs text-app-textMuted truncate">{{ user.role }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<form method="post" action="/logout" class="m-0">
|
||||
<input type="hidden" name="csrf_token" value="{{ user.csrf_token }}">
|
||||
<button type="submit" class="w-full flex items-center justify-center gap-2 px-3 py-2 rounded-lg text-sm font-medium text-app-error hover:bg-app-errorBg transition-colors">
|
||||
<button type="submit" title="Выйти" class="w-full flex items-center justify-center gap-2 px-3 py-2 rounded-lg text-sm font-medium text-app-error hover:bg-app-errorBg transition-colors">
|
||||
<i data-lucide="log-out" class="w-4 h-4"></i>
|
||||
Выйти
|
||||
<span x-show="expanded" x-cloak>Выйти</span>
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user