53 lines
2.5 KiB
HTML
53 lines
2.5 KiB
HTML
{% extends "base.html" %}
|
||
{% block page %}candidates{% endblock %}
|
||
{% block title %}Кандидаты{% endblock %}
|
||
{% block content %}
|
||
<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 %}
|
||
</div>
|
||
</div>
|
||
|
||
{% if error %}
|
||
<div class="alert alert-error mb-3">❌ {{ error }}</div>
|
||
{% endif %}
|
||
|
||
<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']">
|
||
<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', '💎 Новые'), ('queued', '🗓 В плане'), ('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="grid grid-cols-1 md:grid-cols-3 gap-2 items-start">
|
||
<!-- ЛЕВАЯ ПАНЕЛЬ: список + группировка + массовые операции -->
|
||
<div class="md:col-span-1 min-w-0">
|
||
{% include "_candidates_list.html" %}
|
||
</div>
|
||
|
||
<!-- ПРАВАЯ ПАНЕЛЬ: детали выбранного (partial самодостаточен: md:col-span-2 + id + hx-атрибуты) -->
|
||
{% include "_detail_candidates.html" %}
|
||
</div>
|
||
{% endblock %}
|