feat(frontend): integrate tailwind pipeline and update templates
This commit is contained in:
@ -4,50 +4,51 @@
|
||||
|
||||
{% block content %}
|
||||
<section class="panel">
|
||||
<div class="row-between wrap-gap">
|
||||
<div class="flex flex-wrap items-start justify-between gap-3">
|
||||
<div>
|
||||
<h1>{{ player.full_name }}</h1>
|
||||
<p class="muted-text">
|
||||
{{ player.nominal_position.name|default:"No nominal position" }}
|
||||
· {{ player.inferred_role.name|default:"No inferred role" }}
|
||||
</p>
|
||||
<p class="mt-1 text-sm text-slate-600">{{ player.nominal_position.name|default:"No nominal position" }} · {{ player.inferred_role.name|default:"No inferred role" }}</p>
|
||||
</div>
|
||||
<div class="row-gap">
|
||||
<div class="flex flex-wrap items-center gap-2">
|
||||
{% if request.user.is_authenticated %}
|
||||
{% include "scouting/partials/favorite_button.html" with player=player is_favorite=is_favorite next_url=request.get_full_path %}
|
||||
{% endif %}
|
||||
<a class="button ghost" href="{% url 'players:index' %}">Back to search</a>
|
||||
<a class="btn-secondary" href="{% url 'players:index' %}">Back to search</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="detail-grid mt-16">
|
||||
<div class="detail-card">
|
||||
<h2>Summary</h2>
|
||||
<p><strong>Nationality:</strong> {{ player.nationality.name|default:"-" }}</p>
|
||||
<p><strong>Origin competition:</strong> {{ player.origin_competition.name|default:"-" }}</p>
|
||||
<p><strong>Origin team:</strong> {{ player.origin_team.name|default:"-" }}</p>
|
||||
<p><strong>Birth date:</strong> {{ player.birth_date|date:"Y-m-d"|default:"-" }}</p>
|
||||
<p><strong>Age:</strong> {{ age|default:"-" }}</p>
|
||||
<p><strong>Height:</strong> {{ player.height_cm|default:"-" }} cm</p>
|
||||
<p><strong>Weight:</strong> {{ player.weight_kg|default:"-" }} kg</p>
|
||||
<p><strong>Dominant hand:</strong> {{ player.get_dominant_hand_display|default:"-" }}</p>
|
||||
<div class="mt-4 grid gap-3 md:grid-cols-3">
|
||||
<div class="rounded-lg border border-slate-200 p-4">
|
||||
<h2 class="text-base">Summary</h2>
|
||||
<dl class="mt-2 space-y-1 text-sm">
|
||||
<div><dt class="inline font-semibold">Nationality:</dt> <dd class="inline">{{ player.nationality.name|default:"-" }}</dd></div>
|
||||
<div><dt class="inline font-semibold">Origin competition:</dt> <dd class="inline">{{ player.origin_competition.name|default:"-" }}</dd></div>
|
||||
<div><dt class="inline font-semibold">Origin team:</dt> <dd class="inline">{{ player.origin_team.name|default:"-" }}</dd></div>
|
||||
<div><dt class="inline font-semibold">Birth date:</dt> <dd class="inline">{{ player.birth_date|date:"Y-m-d"|default:"-" }}</dd></div>
|
||||
<div><dt class="inline font-semibold">Age:</dt> <dd class="inline">{{ age|default:"-" }}</dd></div>
|
||||
<div><dt class="inline font-semibold">Height:</dt> <dd class="inline">{{ player.height_cm|default:"-" }} cm</dd></div>
|
||||
<div><dt class="inline font-semibold">Weight:</dt> <dd class="inline">{{ player.weight_kg|default:"-" }} kg</dd></div>
|
||||
<div><dt class="inline font-semibold">Dominant hand:</dt> <dd class="inline">{{ player.get_dominant_hand_display|default:"-" }}</dd></div>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<div class="detail-card">
|
||||
<h2>Current Assignment</h2>
|
||||
<div class="rounded-lg border border-slate-200 p-4">
|
||||
<h2 class="text-base">Current Assignment</h2>
|
||||
{% if current_assignment %}
|
||||
<p><strong>Team:</strong> {{ current_assignment.team.name|default:"-" }}</p>
|
||||
<p><strong>Competition:</strong> {{ current_assignment.competition.name|default:"-" }}</p>
|
||||
<p><strong>Season:</strong> {{ current_assignment.season.label|default:"-" }}</p>
|
||||
<p><strong>Games:</strong> {{ current_assignment.games_played }}</p>
|
||||
<dl class="mt-2 space-y-1 text-sm">
|
||||
<div><dt class="inline font-semibold">Team:</dt> <dd class="inline">{{ current_assignment.team.name|default:"-" }}</dd></div>
|
||||
<div><dt class="inline font-semibold">Competition:</dt> <dd class="inline">{{ current_assignment.competition.name|default:"-" }}</dd></div>
|
||||
<div><dt class="inline font-semibold">Season:</dt> <dd class="inline">{{ current_assignment.season.label|default:"-" }}</dd></div>
|
||||
<div><dt class="inline font-semibold">Games:</dt> <dd class="inline">{{ current_assignment.games_played }}</dd></div>
|
||||
</dl>
|
||||
{% else %}
|
||||
<p>No active assignment available.</p>
|
||||
<div class="empty-state mt-2">No active assignment available.</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="detail-card">
|
||||
<h2>Aliases</h2>
|
||||
<ul>
|
||||
<div class="rounded-lg border border-slate-200 p-4">
|
||||
<h2 class="text-base">Aliases</h2>
|
||||
<ul class="mt-2 list-inside list-disc text-sm text-slate-700">
|
||||
{% for alias in player.aliases.all %}
|
||||
<li>{{ alias.alias }}{% if alias.source %} ({{ alias.source }}){% endif %}</li>
|
||||
{% empty %}
|
||||
@ -58,50 +59,33 @@
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="panel mt-16">
|
||||
<section class="panel mt-4">
|
||||
<h2>Team History</h2>
|
||||
{% if season_rows %}
|
||||
<div class="table-wrap">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Season</th>
|
||||
<th>Team</th>
|
||||
<th>Competition</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<div class="table-wrap mt-3">
|
||||
<table class="data-table">
|
||||
<thead><tr><th>Season</th><th>Team</th><th>Competition</th></tr></thead>
|
||||
<tbody class="divide-y divide-slate-100 bg-white">
|
||||
{% for row in season_rows %}
|
||||
<tr>
|
||||
<td>{{ row.season.label|default:"-" }}</td>
|
||||
<td>{{ row.team.name|default:"-" }}</td>
|
||||
<td>{{ row.competition.name|default:"-" }}</td>
|
||||
</tr>
|
||||
<tr><td>{{ row.season.label|default:"-" }}</td><td>{{ row.team.name|default:"-" }}</td><td>{{ row.competition.name|default:"-" }}</td></tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% else %}
|
||||
<p>No team history available.</p>
|
||||
<div class="empty-state mt-3">No team history available.</div>
|
||||
{% endif %}
|
||||
</section>
|
||||
|
||||
<section class="panel mt-16">
|
||||
<section class="panel mt-4">
|
||||
<h2>Career History</h2>
|
||||
{% if career_entries %}
|
||||
<div class="table-wrap">
|
||||
<table>
|
||||
<div class="table-wrap mt-3">
|
||||
<table class="data-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Season</th>
|
||||
<th>Team</th>
|
||||
<th>Competition</th>
|
||||
<th>Role</th>
|
||||
<th>From</th>
|
||||
<th>To</th>
|
||||
</tr>
|
||||
<tr><th>Season</th><th>Team</th><th>Competition</th><th>Role</th><th>From</th><th>To</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tbody class="divide-y divide-slate-100 bg-white">
|
||||
{% for entry in career_entries %}
|
||||
<tr>
|
||||
<td>{{ entry.season.label|default:"-" }}</td>
|
||||
@ -116,44 +100,28 @@
|
||||
</table>
|
||||
</div>
|
||||
{% else %}
|
||||
<p>No career entries available.</p>
|
||||
<div class="empty-state mt-3">No career entries available.</div>
|
||||
{% endif %}
|
||||
</section>
|
||||
|
||||
<section class="panel mt-16">
|
||||
<section class="panel mt-4">
|
||||
<h2>Season-by-Season Stats</h2>
|
||||
{% if season_rows %}
|
||||
<div class="table-wrap">
|
||||
<table>
|
||||
<div class="table-wrap mt-3">
|
||||
<table class="data-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Season</th>
|
||||
<th>Team</th>
|
||||
<th>Competition</th>
|
||||
<th>Games</th>
|
||||
<th>MPG</th>
|
||||
<th>PPG</th>
|
||||
<th>RPG</th>
|
||||
<th>APG</th>
|
||||
<th>SPG</th>
|
||||
<th>BPG</th>
|
||||
<th>TOPG</th>
|
||||
<th>FG%</th>
|
||||
<th>3P%</th>
|
||||
<th>FT%</th>
|
||||
<th>Impact</th>
|
||||
<th>Season</th><th>Team</th><th>Competition</th><th>Games</th><th>MPG</th><th>PPG</th><th>RPG</th><th>APG</th><th>SPG</th><th>BPG</th><th>TOPG</th><th>FG%</th><th>3P%</th><th>FT%</th><th>Impact</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tbody class="divide-y divide-slate-100 bg-white">
|
||||
{% for row in season_rows %}
|
||||
<tr>
|
||||
<td>{{ row.season.label|default:"-" }}</td>
|
||||
<td>{{ row.team.name|default:"-" }}</td>
|
||||
<td>{{ row.competition.name|default:"-" }}</td>
|
||||
<td>{{ row.games_played }}</td>
|
||||
<td>
|
||||
{% if row.mpg is not None %}{{ row.mpg|floatformat:1 }}{% else %}-{% endif %}
|
||||
</td>
|
||||
<td>{% if row.mpg is not None %}{{ row.mpg|floatformat:1 }}{% else %}-{% endif %}</td>
|
||||
<td>{% if row.stats %}{{ row.stats.points }}{% else %}-{% endif %}</td>
|
||||
<td>{% if row.stats %}{{ row.stats.rebounds }}{% else %}-{% endif %}</td>
|
||||
<td>{% if row.stats %}{{ row.stats.assists }}{% else %}-{% endif %}</td>
|
||||
@ -170,7 +138,7 @@
|
||||
</table>
|
||||
</div>
|
||||
{% else %}
|
||||
<p>No season stats available.</p>
|
||||
<div class="empty-state mt-3">No season stats available.</div>
|
||||
{% endif %}
|
||||
</section>
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user