120 lines
4.6 KiB
HTML
120 lines
4.6 KiB
HTML
<!doctype html>
|
|
<html lang="fr">
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
<title>Super Sunday — Admin</title>
|
|
<link rel="stylesheet" href="/assets/style.css?v=10" />
|
|
<style>
|
|
.form-row{display:grid;grid-template-columns:1fr 1fr;gap:12px}
|
|
.grid-2{display:grid;grid-template-columns:1fr 1fr;gap:16px}
|
|
.actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
|
|
.muted-sm{color:#9fb0c7;font-size:13px}
|
|
.toast{position:fixed;right:16px;bottom:16px;padding:12px 16px;
|
|
background:#0f1b33;border:1px solid rgba(255,255,255,.2);color:#eaf3ff;
|
|
border-radius:14px;box-shadow:0 8px 24px rgba(0,0,0,.35);display:none;min-width:260px}
|
|
.toast.show{display:block;animation:toastIn .18s ease-out}
|
|
@keyframes toastIn{from{transform:translateY(6px);opacity:.0}to{transform:translateY(0);opacity:1}}
|
|
.spinner{display:inline-block;width:16px;height:16px;border-radius:50%;
|
|
border:2px solid rgba(255,255,255,.25);border-top-color:#8fedff;animation:spin .6s linear infinite;margin-left:8px}
|
|
@keyframes spin{to{transform:rotate(360deg)}}
|
|
.help{font-size:12px;color:#cfe1ff;margin-top:4px}
|
|
.sel{display:flex;gap:8px}
|
|
.sel select{min-width:160px}
|
|
.hide{display:none !important}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<header>
|
|
<h1>Admin — Super Sunday</h1>
|
|
<nav>
|
|
<a href="/">Accueil</a>
|
|
<a href="/events">Événements</a>
|
|
<a href="/admin" class="active">Admin</a>
|
|
</nav>
|
|
</header>
|
|
|
|
<main class="container">
|
|
<!-- Login -->
|
|
<section id="loginSection" class="card">
|
|
<h2 class="section-title">Connexion</h2>
|
|
<div class="form-row">
|
|
<input id="email" placeholder="Email (ex: admin@supersunday.local)" />
|
|
<input id="password" type="password" placeholder="Mot de passe (ex: changeme)" />
|
|
</div>
|
|
<div class="actions">
|
|
<button id="loginBtn" class="btn">Se connecter</button>
|
|
<button id="logoutBtn" class="btn-outline">Se déconnecter</button>
|
|
<span id="loginStatus" class="muted"></span>
|
|
</div>
|
|
<p class="muted-sm">Identifiants dans <code>backend/.env</code> (ADMIN_EMAIL / ADMIN_PASSWORD).</p>
|
|
</section>
|
|
|
|
<section id="adminSection" class="grid-2 hide">
|
|
<!-- Create tournament -->
|
|
<div class="card">
|
|
<h3 class="section-title">Créer un tournoi</h3>
|
|
<input id="t_name" placeholder="Nom du tournoi" />
|
|
<input id="t_location" placeholder="Lieu" />
|
|
<div class="form-row">
|
|
<input id="t_start" type="date" placeholder="Date début" />
|
|
<input id="t_end" type="date" placeholder="Date fin" />
|
|
</div>
|
|
<div class="actions">
|
|
<button id="createTournamentBtn" class="btn">Créer</button>
|
|
<div id="createTournamentSpin" class="spinner hide"></div>
|
|
</div>
|
|
<div id="createTournamentErr" class="help"></div>
|
|
</div>
|
|
|
|
<!-- Add participant -->
|
|
<div class="card">
|
|
<h3 class="section-title">Ajouter un joueur</h3>
|
|
<div class="sel">
|
|
<select id="p_tid"></select>
|
|
<input id="p_fullname" placeholder="Nom complet" />
|
|
</div>
|
|
<div class="actions">
|
|
<button id="addParticipantBtn" class="btn">Ajouter</button>
|
|
<div id="addParticipantSpin" class="spinner hide"></div>
|
|
</div>
|
|
<div id="addParticipantErr" class="help"></div>
|
|
</div>
|
|
|
|
<!-- Score match -->
|
|
<div class="card">
|
|
<h3 class="section-title">Scorer un match</h3>
|
|
<div class="sel">
|
|
<select id="s_tid"></select>
|
|
<select id="s_mid"></select>
|
|
</div>
|
|
<div class="form-row">
|
|
<input id="m_a" type="number" placeholder="Score A" min="0" />
|
|
<input id="m_b" type="number" placeholder="Score B" min="0" />
|
|
</div>
|
|
<div class="actions">
|
|
<label><input id="m_done" type="checkbox" /> Terminé</label>
|
|
<button id="scoreBtn" class="btn">Valider</button>
|
|
<div id="scoreSpin" class="spinner hide"></div>
|
|
</div>
|
|
<div id="scoreErr" class="help"></div>
|
|
</div>
|
|
|
|
<!-- Quick view tournaments -->
|
|
<div class="card">
|
|
<h3 class="section-title">Tournois (aperçu)</h3>
|
|
<div class="actions">
|
|
<button id="refreshTournaments" class="btn-outline">Rafraîchir</button>
|
|
</div>
|
|
<div id="listTournaments" class="muted"></div>
|
|
</div>
|
|
</section>
|
|
</main>
|
|
|
|
<div id="toast" class="toast" role="status" aria-live="polite"></div>
|
|
|
|
<script type="module" src="/assets/api.js?v=10"></script>
|
|
<script type="module" src="/assets/admin.ux.js?v=10"></script>
|
|
</body>
|
|
</html>
|