feat: add scouting search sorting and pagination
This commit is contained in:
@ -8,18 +8,30 @@
|
||||
<h1>Scout Search</h1>
|
||||
|
||||
<form method="get">
|
||||
<fieldset>
|
||||
<legend>Result Controls</legend>
|
||||
{{ form.sort.label_tag }} {{ form.sort }}
|
||||
<p>
|
||||
Context stat sorts use the matching season context selected by the current
|
||||
season/team/competition/stat filters.
|
||||
</p>
|
||||
{% if not context_sorting_enabled %}
|
||||
<p>Context stat sorting becomes active once context or stat filters are applied.</p>
|
||||
{% endif %}
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<legend>Player Filters</legend>
|
||||
{{ form.name.label_tag }} {{ form.name }}
|
||||
{{ form.position.label_tag }} {{ form.position }}
|
||||
{{ form.role.label_tag }} {{ form.role }}
|
||||
{{ form.specialty.label_tag }} {{ form.specialty }}
|
||||
{{ form.min_age.label_tag }} {{ form.min_age }}
|
||||
{{ form.max_age.label_tag }} {{ form.max_age }}
|
||||
{{ form.min_height_cm.label_tag }} {{ form.min_height_cm }}
|
||||
{{ form.max_height_cm.label_tag }} {{ form.max_height_cm }}
|
||||
{{ form.min_weight_kg.label_tag }} {{ form.min_weight_kg }}
|
||||
{{ form.max_weight_kg.label_tag }} {{ form.max_weight_kg }}
|
||||
{{ form.position.label_tag }} {{ form.position }}
|
||||
{{ form.role.label_tag }} {{ form.role }}
|
||||
{{ form.specialty.label_tag }} {{ form.specialty }}
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
@ -46,7 +58,7 @@
|
||||
<button type="submit">Search</button>
|
||||
</form>
|
||||
|
||||
<h2>Results ({{ players|length }})</h2>
|
||||
<h2>Results ({{ total_results }})</h2>
|
||||
<ul>
|
||||
{% for player in players %}
|
||||
<li>
|
||||
@ -74,5 +86,19 @@
|
||||
<li>No players found.</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
{% if page_obj.paginator.num_pages > 1 %}
|
||||
<nav aria-label="Pagination">
|
||||
{% if page_obj.has_previous %}
|
||||
<a href="?{% if query_without_page %}{{ query_without_page }}&{% endif %}page={{ page_obj.previous_page_number }}">Previous</a>
|
||||
{% endif %}
|
||||
|
||||
<span>Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }}</span>
|
||||
|
||||
{% if page_obj.has_next %}
|
||||
<a href="?{% if query_without_page %}{{ query_without_page }}&{% endif %}page={{ page_obj.next_page_number }}">Next</a>
|
||||
{% endif %}
|
||||
</nav>
|
||||
{% endif %}
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user