Update admin editor layout

This commit is contained in:
Your Name
2026-07-28 11:59:18 +05:00
parent e559a8b2c6
commit 3f0c9f0b56
2 changed files with 49 additions and 41 deletions
+34 -28
View File
@@ -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>
+15 -13
View File
@@ -126,6 +126,17 @@
</div>
{% endif %}
<!-- Original Spoiler -->
<details class="group/details mb-4">
<summary class="flex items-center gap-2 text-xs font-semibold tracking-wide text-app-textMuted hover:text-white cursor-pointer select-none">
<i data-lucide="chevron-right" class="w-4 h-4 transition-transform group-open/details:rotate-90"></i>
ОРИГИНАЛЬНЫЙ ТЕКСТ
</summary>
<div class="mt-3 bg-app-bg/50 rounded-lg p-4 border border-app-border">
<div class="whitespace-pre-wrap text-app-textMain/80 font-mono text-xs leading-relaxed max-h-[300px] overflow-y-auto">{{ p.raw_text }}</div>
</div>
</details>
<!-- Edit Area (Auto resize textarea) -->
<label class="block text-xs font-bold text-app-textMuted mb-2 uppercase tracking-wider">Финальный текст</label>
<textarea name="final_text"
@@ -159,25 +170,16 @@
</div>
</div>
<!-- Original / AI Spoiler -->
<!-- AI Notes Spoiler -->
<div class="mt-4">
<details class="group/details">
<summary class="flex items-center gap-2 text-xs font-semibold tracking-wide text-app-textMuted hover:text-white cursor-pointer select-none">
<i data-lucide="chevron-right" class="w-4 h-4 transition-transform group-open/details:rotate-90"></i>
ПОСМОТРЕТЬ ИСХОДНИК И AI-ПРЕДЛОЖЕНИЕ
AI ЗАМЕТКИ / РЕЗОЛЮЦИЯ
</summary>
<div class="mt-3 grid grid-cols-1 xl:grid-cols-2 gap-4 bg-app-bg/50 rounded-lg p-4 border border-app-border text-sm">
<div class="mt-3 bg-app-bg/50 rounded-lg p-4 border border-app-border text-sm">
<div class="text-app-textMain/80 whitespace-pre-wrap italic">{{ p.rewrite_notes or p.qualification_reason or "—" }}</div>
<div>
<div class="text-xs text-app-textMuted font-bold mb-2 uppercase tracking-wider">Оригинальный текст</div>
<div class="whitespace-pre-wrap text-app-textMain/80 font-mono text-xs leading-relaxed max-h-[300px] overflow-y-auto">{{ p.raw_text }}</div>
</div>
<div>
<div class="text-xs text-app-primary font-bold mb-2 uppercase tracking-wider">AI-Предложение</div>
<div class="whitespace-pre-wrap text-app-textMain/90 font-mono text-xs leading-relaxed max-h-[300px] overflow-y-auto">{{ p.rewritten_text }}</div>
<div class="text-xs text-app-textMuted font-bold mt-4 mb-2 uppercase tracking-wider">AI Заметки / Резолюция</div>
<div class="text-app-textMain/80 whitespace-pre-wrap italic">{{ p.rewrite_notes or p.qualification_reason or "—" }}</div>
<div class="mt-4">
<label class="block text-xs font-bold text-app-textMuted mb-1 uppercase tracking-wider">Заметка редактора (внутренняя)</label>
<input type="text" name="editor_notes" value="{{ p.editor_notes or '' }}" class="input input-sm w-full text-app-warning placeholder:text-app-warning/50 bg-app-bg">