Files
ESBSC-CONVOC/templates/layout.php
2026-11-11 09:24:28 +01:00

14 lines
3.1 KiB
PHP

<?php $brand=\App\ClubSettings::get();$season=\App\Seasons::selected();$archived=$season!==\App\Seasons::active(); ?>
<!doctype html>
<html lang="fr"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title><?=e($title)?> · <?=e($brand['short_name'])?></title><link rel="stylesheet" href="/assets/app.css"><link rel="stylesheet" href="/assets/v3.css"><link rel="stylesheet" href="/assets/v4.css"><link rel="stylesheet" href="/brand.css"><script defer src="/assets/app.js"></script></head>
<body class="<?= $user?'authenticated':'guest' ?> <?=$archived?'archive-mode':''?>">
<?php if($user): ?><aside class="sidebar"><a class="brand" href="/"><?php if($brand['logo']): ?><img class="brand-logo" src="<?=e($brand['logo'])?>" alt="Logo du club"><?php endif ?><span><?=e($brand['short_name'])?><small>ESPACE DIRIGEANTS</small></span></a><form class="season-picker" method="post" action="/seasons/select"><?=csrf()?><label>Saison<select name="season"><?php foreach(\App\DB::all('SELECT name FROM seasons ORDER BY name DESC') as $s): ?><option <?=$s['name']===$season?'selected':''?>><?=e($s['name'])?></option><?php endforeach ?></select></label><button>Afficher</button></form><div class="nav-label">SUIVI SPORTIF</div><nav>
<?php foreach(['/' => 'Vue du week-end','/players'=>'Joueurs','/staff'=>'Staff','/convocations'=>'Convocations','/matches'=>'Calendriers','/discipline'=>'Discipline','/fmi'=>'FMI PDF','/stats'=>'Statistiques','/licences'=>'Licences','/regulations'=>'Règlements','/check'=>'Vérifier une liste','/reports'=>'Rapports'] as $url=>$label): ?><a class="<?=parse_url($_SERVER['REQUEST_URI'],PHP_URL_PATH)===$url?'current':''?>" href="<?=e($url)?>"><?=e($label)?></a><?php endforeach ?>
<?php if(\App\Auth::canWrite($user)): ?><div class="nav-label">GESTION</div><a href="/imports">Imports et actualisation</a><a href="/spond">Disponibilités Spond</a><a href="/audit">Historique</a><?php endif ?>
<?php if($user['role']==='admin'): ?><a href="/users">Utilisateurs</a><a href="/settings">Réglages du club</a><?php endif ?><a href="/seasons">Saisons</a></nav><div class="account"><strong><?=e($user['name'])?></strong><small><?=e(['admin'=>'Administrateur','secretary'=>'Secrétariat','coach'=>'Dirigeant / entraîneur','viewer'=>'Lecture seule'][$user['role']])?></small><a href="/password">Mot de passe</a><form method="post" action="/logout"><?=csrf()?><button class="quiet">Se déconnecter</button></form></div></aside><?php endif ?>
<main><header class="page-head"><div><p class="eyebrow"><?=e($brand['name'])?></p><h1><?=e($title)?></h1></div><?php if($user): ?><span class="today"><?=date('d/m/Y')?></span><?php endif ?></header>
<?php if(isset($_SESSION['notice'])): ?><div class="notice success"><?=e($_SESSION['notice'])?></div><?php unset($_SESSION['notice']);endif ?>
<?php if($user&&$archived): ?><p class="archive-banner">Saison <?=e($season)?> en consultation. Les modifications sont réservées à la saison active.</p><?php endif ?>
<?=$content?>
<footer><?=e($brand['short_name'])?> · V4.0.0-rc1 · Aide au contrôle : données inconnues et exceptions nécessitent une vérification humaine.</footer></main></body></html>