42 lines
1.7 KiB
HTML
42 lines
1.7 KiB
HTML
<!doctype html>
|
|
<html lang="fr">
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
<title>Détail tournoi — Super Sunday</title>
|
|
<link rel="stylesheet" href="/assets/style.css?v=8" />
|
|
</head>
|
|
<body>
|
|
<header>
|
|
<h1>Détail du tournoi</h1>
|
|
<nav>
|
|
<a href="/">Accueil</a>
|
|
<a href="/events" class="active">Événements</a>
|
|
<a href="/admin">Admin</a>
|
|
</nav>
|
|
</header>
|
|
<main class="container">
|
|
<h2 class="hero-title" id="ttitle">Tournoi</h2>
|
|
<p class="muted" id="tsub"></p>
|
|
<h3 class="section-title">Participants</h3>
|
|
<div id="participants"></div>
|
|
<h3 class="section-title">Matches</h3>
|
|
<div id="matchlist"></div>
|
|
</main>
|
|
<script type="module">
|
|
import { getTournament,listParticipants,listMatches } from '/assets/api.js?v=8';
|
|
(async()=>{
|
|
const id=Number(new URLSearchParams(location.search).get('id')||'0');
|
|
if(!id) return;
|
|
const t=await getTournament(id);
|
|
document.getElementById('ttitle').textContent=t.name||'Tournoi';
|
|
document.getElementById('tsub').textContent=[t.location||'—',t.start_date].filter(Boolean).join(' • ');
|
|
const ps=await listParticipants(id);
|
|
document.getElementById('participants').innerHTML=ps.map(p=>`<div class="card">${p.full_name}</div>`).join('')||'<div class="empty">Aucun participant</div>';
|
|
const ms=await listMatches(id);
|
|
document.getElementById('matchlist').innerHTML=ms.map(m=>`<div class="card"><strong>${m.team_a}</strong> vs <strong>${m.team_b}</strong> — <span class="muted">${m.court||'—'}</span></div>`).join('')||'<div class="empty">Aucun match</div>';
|
|
})();
|
|
</script>
|
|
</body>
|
|
</html>
|