feat(web): candidates page on tailwind

This commit is contained in:
kpa39l
2026-10-28 13:01:49 +00:00
parent 5ea7228797
commit 4783ea25f3
4 changed files with 103 additions and 109 deletions
+27 -37
View File
@@ -2,9 +2,9 @@
{% block page %}candidates{% endblock %}
{% block title %}Кандидаты{% endblock %}
{% block content %}
<div class="d-flex justify-content-between align-items-center mb-2">
<h4 class="mb-0">Кандидаты</h4>
<div class="text-muted small">
<div class="flex items-center justify-between mb-3 gap-2">
<h4 class="text-xl font-semibold m-0">Кандидаты</h4>
<div class="text-neutral-500 text-sm">
{% if selected %}
#{{ selected.id }} · {{ selected.source_name or selected.tg_channel or '?' }}
{% endif %}
@@ -12,51 +12,41 @@
</div>
{% if error %}
<div class="alert alert-danger py-2">❌ {{ error }}</div>
<div class="alert alert-error mb-3">❌ {{ error }}</div>
{% endif %}
<form class="row g-2 mb-2" method="get" action="/candidates"
<form class="flex flex-wrap items-center gap-2 mb-3" method="get" action="/candidates"
hx-get="/candidates" hx-target="#list-panel" hx-swap="outerHTML"
hx-trigger="submit, change delay:600ms from:select, keyup delay:500ms from:input[name='q']">
<div class="col-auto">
<input type="text" name="q" value="{{ q }}" class="form-control form-control-sm" placeholder="поиск…">
</div>
<div class="col-auto">
<select name="status" class="form-select form-select-sm">
{% for val, label in [('', 'Все'), ('new', '💎 Новые'), ('rejected', '🗑 Отклонённые'), ('published', '✅ Опубл.')] %}
<option value="{{ val }}" {% if status == val %}selected{% endif %}>{{ label }}{% if counts.get(val) %} ({{ counts[val] }}){% endif %}</option>
{% endfor %}
</select>
</div>
<div class="col-auto">
<select name="direction" class="form-select form-select-sm">
<option value="">Все направления</option>
{% for d in directions %}
<option value="{{ d }}" {% if direction == d %}selected{% endif %}>{{ d }}</option>
{% endfor %}
</select>
</div>
<div class="col-auto">
<select name="own" class="form-select form-select-sm">
<option value="">Все посты</option>
<option value="1" {% if own == '1' %}selected{% endif %}>⭐ Свои</option>
<option value="0" {% if own == '0' %}selected{% endif %}>Внешние</option>
</select>
</div>
<div class="col-auto">
<button class="btn btn-sm btn-outline-secondary" type="submit">Применить</button>
</div>
<input type="text" name="q" value="{{ q }}" class="input input-sm w-56 max-w-full" placeholder="поиск…">
<select name="status" class="select select-sm w-48 max-w-full">
{% for val, label in [('', 'Все'), ('new', '💎 Новые'), ('rejected', '🗑 Отклонённые'), ('published', '✅ Опубл.')] %}
<option value="{{ val }}" {% if status == val %}selected{% endif %}>{{ label }}{% if counts.get(val) %} ({{ counts[val] }}){% endif %}</option>
{% endfor %}
</select>
<select name="direction" class="select select-sm w-48 max-w-full">
<option value="">Все направления</option>
{% for d in directions %}
<option value="{{ d }}" {% if direction == d %}selected{% endif %}>{{ d }}</option>
{% endfor %}
</select>
<select name="own" class="select select-sm w-40 max-w-full">
<option value="">Все посты</option>
<option value="1" {% if own == '1' %}selected{% endif %}>⭐ Свои</option>
<option value="0" {% if own == '0' %}selected{% endif %}>Внешние</option>
</select>
<button class="btn btn-sm btn-outline" type="submit">Применить</button>
</form>
{% set selected_qs = '&selected=' ~ selected.id if selected else '' %}
<div class="row g-0">
<div class="grid grid-cols-1 md:grid-cols-3 gap-2 items-start">
<!-- ЛЕВАЯ ПАНЕЛЬ: список + группировка + массовые операции -->
<div class="col-md-4">
<div class="md:col-span-1 min-w-0">
{% include "_candidates_list.html" %}
</div>
<!-- ПРАВАЯ ПАНЕЛЬ: детали выбранного (partial самодостаточен: col-md-8 + id + hx-атрибуты) -->
<!-- ПРАВАЯ ПАНЕЛЬ: детали выбранного (partial самодостаточен: md:col-span-2 + id + hx-атрибуты) -->
{% include "_detail_candidates.html" %}
</div>
{% endblock %}
{% endblock %}