Improve whitelist UX: inline label edit and label prompt from stats
Whitelist page: each entry now shows an editable label field inline (uses INSERT OR REPLACE so it acts as update). Stats page: the whitelist button expands a small dropdown with a label input before confirming. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
ea58a860b8
commit
30561c44de
@@ -70,11 +70,21 @@
|
|||||||
<button type="submit" class="text-xs text-red-400 hover:text-red-300 px-2 py-1 rounded border border-red-900 hover:border-red-700">✕ Retirer</button>
|
<button type="submit" class="text-xs text-red-400 hover:text-red-300 px-2 py-1 rounded border border-red-900 hover:border-red-700">✕ Retirer</button>
|
||||||
</form>
|
</form>
|
||||||
{% else %}
|
{% else %}
|
||||||
<form action="/whitelist/add" method="post" class="inline">
|
<details class="inline-block text-left">
|
||||||
|
<summary class="text-xs text-slate-400 hover:text-green-400 px-2 py-1 rounded border border-slate-700 hover:border-green-700 cursor-pointer list-none">🛡 Whitelister</summary>
|
||||||
|
<div class="absolute z-10 mt-1 p-3 rounded-lg shadow-xl" style="background:#1e293b;border:1px solid #334155;min-width:220px;">
|
||||||
|
<form action="/whitelist/add" method="post" class="space-y-2">
|
||||||
<input type="hidden" name="plate" value="{{ row.plate }}">
|
<input type="hidden" name="plate" value="{{ row.plate }}">
|
||||||
<input type="hidden" name="back" value="/stats">
|
<input type="hidden" name="back" value="/stats">
|
||||||
<button type="submit" class="text-xs text-slate-400 hover:text-green-400 px-2 py-1 rounded border border-slate-700 hover:border-green-700">🛡 Whitelister</button>
|
<div class="text-xs text-slate-400 mb-1">Libellé pour <strong class="text-green-400">{{ row.plate }}</strong></div>
|
||||||
|
<input type="text" name="label" placeholder="Ex: Ma voiture"
|
||||||
|
class="w-full text-sm"
|
||||||
|
style="background:#0f172a;border:1px solid #475569;color:#e2e8f0;border-radius:6px;padding:5px 8px;">
|
||||||
|
<button type="submit" class="w-full text-xs py-1.5 rounded"
|
||||||
|
style="background:#166534;color:#4ade80;border:1px solid #16a34a;">✓ Confirmer</button>
|
||||||
</form>
|
</form>
|
||||||
|
</div>
|
||||||
|
</details>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -57,12 +57,22 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for e in entries %}
|
{% for e in entries %}
|
||||||
<tr class="border-b border-slate-800 hover:bg-slate-800/40">
|
<tr class="border-b border-slate-700">
|
||||||
<td class="px-4 py-3">
|
<td class="px-4 py-3">
|
||||||
<span class="plate font-bold px-3 py-1 rounded text-sm" style="background:#14532d;color:#4ade80;border:1px solid #16a34a;">{{ e.plate }}</span>
|
<span class="plate font-bold px-3 py-1 rounded text-sm" style="background:#14532d;color:#4ade80;border:1px solid #16a34a;">{{ e.plate }}</span>
|
||||||
</td>
|
</td>
|
||||||
<td class="px-4 py-3 text-slate-300">{{ e.label or '—' }}</td>
|
<td class="px-4 py-3" colspan="2">
|
||||||
<td class="px-4 py-3 text-slate-500 text-xs hidden sm:table-cell">{{ e.added_str }}</td>
|
<form action="/whitelist/add" method="post" class="flex gap-2 items-center flex-wrap">
|
||||||
|
<input type="hidden" name="plate" value="{{ e.plate }}">
|
||||||
|
<input type="hidden" name="back" value="/whitelist">
|
||||||
|
<input type="text" name="label" value="{{ e.label or '' }}" placeholder="Libellé…"
|
||||||
|
class="flex-1 text-sm font-medium"
|
||||||
|
style="min-width:120px;background:#0f172a;border:1px solid #475569;color:#e2e8f0;border-radius:6px;padding:4px 8px;">
|
||||||
|
<button type="submit" class="text-xs px-3 py-1 rounded whitespace-nowrap"
|
||||||
|
style="background:#1e3a5f;color:#60a5fa;border:1px solid #2563eb;">✓ Sauvegarder</button>
|
||||||
|
</form>
|
||||||
|
</td>
|
||||||
|
<td class="px-4 py-3 text-slate-500 text-xs hidden sm:table-cell whitespace-nowrap">{{ e.added_str }}</td>
|
||||||
<td class="px-4 py-3 text-right">
|
<td class="px-4 py-3 text-right">
|
||||||
<form action="/whitelist/remove/{{ e.plate }}" method="post" class="inline"
|
<form action="/whitelist/remove/{{ e.plate }}" method="post" class="inline"
|
||||||
onsubmit="return confirm('Retirer {{ e.plate }} de la liste blanche ?')">
|
onsubmit="return confirm('Retirer {{ e.plate }} de la liste blanche ?')">
|
||||||
|
|||||||
Reference in New Issue
Block a user