Make invalid search input explicit in UI and API

This commit is contained in:
Alfredo Di Stasio
2026-03-10 15:53:55 +01:00
parent 92c804a474
commit 2586f15ae8
6 changed files with 150 additions and 17 deletions

View File

@ -6,6 +6,19 @@
<section class="panel">
<h1>Player Search</h1>
<p class="mt-1 text-sm text-slate-600">Filter players by profile, origin, context, and production metrics.</p>
{% if search_has_errors %}
<div class="mt-4 rounded-md border border-rose-200 bg-rose-50 p-3 text-sm text-rose-800">
<p class="font-medium">Please correct the highlighted filters.</p>
{% for field in search_form %}
{% for error in field.errors %}
<p>{{ field.label }}: {{ error }}</p>
{% endfor %}
{% endfor %}
{% for error in search_form.non_field_errors %}
<p>{{ error }}</p>
{% endfor %}
</div>
{% endif %}
<form
method="get"