{% extends 'base.html.twig' %} {% block title %}Profil de {{ joueur.prenom }} {{ joueur.nom }} - Arras 6{% endblock %} {% block stylesheets %} {{ parent() }} {% endblock %} {% block body %}
{# --- BOUTON RETOUR --- #}
Retour à l'équipe
{# --- BANNIÈRE DU PROFIL --- #}
{# 📸 AFFICHAGE DE LA PHOTO (Même logique que sur la page équipe) #} {% if joueur.photo %} {{ joueur.prenom }} {% else %} {% endif %}

{{ joueur.prenom }} {{ joueur.nom|upper }}

S: {{ joueur.classementSimple|default('NC') }} D: {{ joueur.classementDouble|default('NC') }} M: {{ joueur.classementMixte|default('NC') }}
{# --- COLONNE GAUCHE : STATS GLOBALES --- #}
⚡ Statistiques globales
Total matchs {{ stats.total }}
Victoires {{ stats.victoires }}
Défaites {{ stats.defaites }}
{% set ratioGlobal = stats.total > 0 ? (stats.victoires / stats.total * 100)|round : 0 %}
Taux de victoire {{ ratioGlobal }}%
{# --- COLONNE DROITE : GRAPHIQUES ET TABLEAU --- #}
{# Bloc Graphiques #}
📊 Performance par format
{# --- Graphique SIMPLE --- #}
{% set totalS = stats.simple.total %} {% set victoiresS = stats.simple.v %} {% set defaitesS = totalS - victoiresS %} {% set pctS = totalS > 0 ? (victoiresS / totalS * 100)|round : 0 %}
{{ pctS }}%

Simple
{{ victoiresS }}V / {{ defaitesS }}D

{# --- Graphique DOUBLE --- #}
{% set totalD = stats.double.total %} {% set victoiresD = stats.double.v %} {% set defaitesD = totalD - victoiresD %} {% set pctD = totalD > 0 ? (victoiresD / totalD * 100)|round : 0 %}
{{ pctD }}%

Double
{{ victoiresD }}V / {{ defaitesD }}D

{# --- Graphique MIXTE --- #}
{% set totalM = stats.mixte.total %} {% set victoiresM = stats.mixte.v %} {% set defaitesM = totalM - victoiresM %} {% set pctM = totalM > 0 ? (victoiresM / totalM * 100)|round : 0 %}
{{ pctM }}%

Mixte
{{ victoiresM }}V / {{ defaitesM }}D

{# Tableau Historique #}
🗓️ Derniers matchs ({{ stats.total }})
{# On affiche les 10 derniers matchs #} {% for match in matchs|reverse|slice(0, 10) %} {% else %} {% endfor %}
Date Format Adversaire Score Résultat
{{ match.rencontre and match.rencontre.dateRencontre ? match.rencontre.dateRencontre|date('d/m') : '-' }} {% if match.typeMatch|lower == 'simple' %} {% elseif match.typeMatch|lower == 'double' %} {% else %}{% endif %} {{ match.typeMatch|capitalize }}
{{ match.nomAdversaire }}
{{ match.opponentTeam }}
{{ match.score|replace({' ': ' '}) }} {% if match.resultat|lower == 'victoire' %} V {% else %} D {% endif %}

Aucun match enregistré.
{# Ajout de Chart.js et configuration #} {% endblock %}