feat(web): base layout and login on tailwind

This commit is contained in:
kpa39l
2026-10-28 12:58:37 +00:00
parent ed3b043724
commit 5ea7228797
3 changed files with 31 additions and 39 deletions
File diff suppressed because one or more lines are too long
+17 -26
View File
@@ -6,34 +6,25 @@
<title>VESTI — {% block title %}Управление{% endblock %}</title>
<link href="/static/css/style.css" rel="stylesheet">
<link href="/static/bootstrap.min.css" rel="stylesheet">
<style>
body { padding-top: 4.5rem; background: #f5f6fa; }
.card { box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.post-text { white-space: pre-wrap; font-size: .9rem; }
/* список кандидатов: выбранный пост — светло-голубая заливка карточки */
.list-group-item.active-row { background-color: #dcecfc; }
.list-group-item.active-row:hover { background-color: #d0e4f8; }
[x-cloak] { display: none !important; }
</style>
</head>
<body data-page="{% block page %}x{% endblock %}">
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top">
<div class="container-fluid">
<a class="navbar-brand" href="/candidates">📰 VESTI</a>
<div class="navbar-nav">
<a class="nav-link" href="/candidates">Кандидаты</a>
<a class="nav-link" href="/selected">⭐ Отобранные</a>
<a class="nav-link" href="/published">Опубликовано</a>
<a class="nav-link" href="/metrics">Метрики</a>
<a class="nav-link" href="/crawlers">Краулеры</a>
<a class="nav-link" href="/sources">Источники</a>
<a class="nav-link text-danger" href="/logout">Выйти</a>
</div>
<body class="bg-neutral-100 text-neutral-900" data-page="{% block page %}x{% endblock %}">
<header class="sticky top-0 z-40 bg-neutral-900 text-neutral-100 shadow-sm">
<div class="flex flex-wrap items-center gap-x-4 gap-y-1 px-4 py-2">
<a class="font-semibold no-underline text-white whitespace-nowrap" href="/candidates">📰 VESTI</a>
<nav class="flex flex-wrap items-center gap-x-3 gap-y-1 text-sm">
<a class="no-underline text-neutral-300 hover:text-white" href="/candidates">Кандидаты</a>
<a class="no-underline text-neutral-300 hover:text-white" href="/selected">⭐ Отобранные</a>
<a class="no-underline text-neutral-300 hover:text-white" href="/published">Опубликовано</a>
<a class="no-underline text-neutral-300 hover:text-white" href="/metrics">Метрики</a>
<a class="no-underline text-neutral-300 hover:text-white" href="/crawlers">Краулеры</a>
<a class="no-underline text-neutral-300 hover:text-white" href="/sources">Источники</a>
<a class="no-underline text-red-400 hover:text-red-300" href="/logout">Выйти</a>
</nav>
</div>
</nav>
<div class="container-fluid mt-2 px-3">
</header>
<main class="px-4 py-3">
{% block content %}{% endblock %}
</div>
</main>
{% block scripts %}{% endblock %}
<script>
// Табы «Оригинал/Перевод» — клиентское состояние (Alpine). Стартовая вкладка: перевод, если есть кнопка «Перевод».
@@ -67,4 +58,4 @@ function bulkSel() {
<script src="/static/htmx.min.js"></script>
<script src="/static/alpine.min.js" defer></script>
</body>
</html>
</html>
+13 -12
View File
@@ -4,23 +4,24 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>VESTI — Вход</title>
<link href="/static/css/style.css" rel="stylesheet">
<link href="/static/bootstrap.min.css" rel="stylesheet">
</head>
<body class="bg-light d-flex align-items-center" style="min-height:100vh">
<div class="container" style="max-width:380px">
<div class="card shadow-sm">
<div class="card-body p-4">
<h4 class="card-title mb-3">📰 VESTI — вход</h4>
{% if request.query_params.get('error') %}<div class="alert alert-danger py-2">Неверный пароль</div>{% endif %}
<form method="post" action="/login">
<div class="mb-3">
<label class="form-label">Пароль</label>
<input type="password" name="password" class="form-control" autofocus required>
<body class="bg-neutral-100 flex items-center justify-center min-h-screen">
<div class="w-full max-w-sm px-4">
<div class="card card-outline shadow-sm">
<div class="card-content">
<h4 class="card-title text-lg mb-4">📰 VESTI — вход</h4>
{% if request.query_params.get('error') %}<div class="alert alert-error mb-4">Неверный пароль</div>{% endif %}
<form method="post" action="/login" class="flex flex-col gap-4">
<div class="flex flex-col gap-2">
<label class="text-sm font-medium" for="password">Пароль</label>
<input id="password" type="password" name="password" class="input" autofocus required>
</div>
<button class="btn btn-primary w-100">Войти</button>
<button class="btn btn-primary w-full">Войти</button>
</form>
</div>
</div>
</div>
</body>
</html>
</html>