97 lines
3.0 KiB
HTML
97 lines
3.0 KiB
HTML
{% load player_query %}
|
|
|
|
<div class="row-between wrap-gap">
|
|
<h2>Results</h2>
|
|
<div class="muted-text">
|
|
{{ page_obj.paginator.count }} player{{ page_obj.paginator.count|pluralize }} found
|
|
</div>
|
|
</div>
|
|
|
|
{% if request.user.is_authenticated %}
|
|
{% include "scouting/partials/save_search_form.html" %}
|
|
{% endif %}
|
|
|
|
{% if players %}
|
|
<div class="table-wrap">
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Player</th>
|
|
<th>Nationality</th>
|
|
<th>Pos / Role</th>
|
|
<th>Height / Weight</th>
|
|
<th>Games</th>
|
|
<th>MPG</th>
|
|
<th>PPG</th>
|
|
<th>RPG</th>
|
|
<th>APG</th>
|
|
{% if request.user.is_authenticated %}<th>Watchlist</th>{% endif %}
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for player in players %}
|
|
<tr>
|
|
<td>
|
|
<a href="{% url 'players:detail' player.pk %}">{{ player.full_name }}</a>
|
|
</td>
|
|
<td>{{ player.nationality.name|default:"-" }}</td>
|
|
<td>
|
|
{{ player.nominal_position.code|default:"-" }}
|
|
/ {{ player.inferred_role.name|default:"-" }}
|
|
</td>
|
|
<td>{{ player.height_cm|default:"-" }} / {{ player.weight_kg|default:"-" }}</td>
|
|
<td>{{ player.games_played_value|floatformat:0 }}</td>
|
|
<td>{{ player.mpg_value|floatformat:1 }}</td>
|
|
<td>{{ player.ppg_value|floatformat:1 }}</td>
|
|
<td>{{ player.rpg_value|floatformat:1 }}</td>
|
|
<td>{{ player.apg_value|floatformat:1 }}</td>
|
|
{% if request.user.is_authenticated %}
|
|
<td>
|
|
{% if player.id in favorite_player_ids %}
|
|
{% include "scouting/partials/favorite_button.html" with player=player is_favorite=True next_url=request.get_full_path %}
|
|
{% else %}
|
|
{% include "scouting/partials/favorite_button.html" with player=player is_favorite=False next_url=request.get_full_path %}
|
|
{% endif %}
|
|
</td>
|
|
{% endif %}
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="pagination row-gap mt-16">
|
|
{% if page_obj.has_previous %}
|
|
{% query_transform page=page_obj.previous_page_number as prev_query %}
|
|
<a
|
|
class="button ghost"
|
|
href="?{{ prev_query }}"
|
|
hx-get="?{{ prev_query }}"
|
|
hx-target="#player-results"
|
|
hx-swap="innerHTML"
|
|
hx-push-url="true"
|
|
>
|
|
Previous
|
|
</a>
|
|
{% endif %}
|
|
|
|
<span>Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }}</span>
|
|
|
|
{% if page_obj.has_next %}
|
|
{% query_transform page=page_obj.next_page_number as next_query %}
|
|
<a
|
|
class="button ghost"
|
|
href="?{{ next_query }}"
|
|
hx-get="?{{ next_query }}"
|
|
hx-target="#player-results"
|
|
hx-swap="innerHTML"
|
|
hx-push-url="true"
|
|
>
|
|
Next
|
|
</a>
|
|
{% endif %}
|
|
</div>
|
|
{% else %}
|
|
<p>No players matched the current filters.</p>
|
|
{% endif %}
|