Make invalid search input explicit in UI and API
This commit is contained in:
@ -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"
|
||||
|
||||
@ -7,6 +7,20 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if search_has_errors %}
|
||||
<div class="mt-3 rounded-md border border-rose-200 bg-rose-50 p-3 text-sm text-rose-800">
|
||||
<p class="font-medium">Search filters are invalid.</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 %}
|
||||
|
||||
{% if request.user.is_authenticated %}
|
||||
{% include "scouting/partials/save_search_form.html" %}
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user