<?php use App\Core\Csrf; use App\Core\Permission; ?>
<link rel="stylesheet" href="/public/assets/css/cda-v6-1-icons.css">
<section class="page-intro"><div><span class="page-kicker">Paramètres Studio</span><h2>Bibliothèque d’icônes</h2><p>Icônes communes aux disciplines, cours, groupes, professeurs et inscriptions.</p></div><a class="button button-secondary" href="/public/parametres/pedagogie">Retour</a></section>
<?php if(Permission::can('parametres.icones.manage')): ?><section class="icon-create-card"><h3>Ajouter une icône</h3><form method="post" action="/public/parametres/icones" class="icon-create-form"><?= Csrf::field() ?><label><span>Code</span><input required name="code" placeholder="ACC"></label><label><span>Libellé</span><input required name="libelle" placeholder="Accordéon"></label><label><span>Catégorie</span><select name="categorie"><option value="instruments">Instruments</option><option value="musique">Musique</option><option value="voix">Voix</option><option value="arts">Arts</option><option value="scene">Scène</option><option value="general">Général</option></select></label><label><span>Icône</span><input required name="valeur_icone" placeholder="🪗"></label><label><span>Couleur</span><input type="color" name="couleur_defaut" value="#64748B"></label><label><span>Ordre</span><input type="number" name="ordre_affichage" value="100"></label><button class="button button-primary">Ajouter</button></form></section><?php endif; ?>
<?php foreach($iconGroups as $cat=>$icons): ?><section class="icon-library-section"><header><h3><?= htmlspecialchars(ucfirst((string)$cat)) ?></h3><span><?= count($icons) ?> icône(s)</span></header><div class="icon-library-grid"><?php foreach($icons as $icon): ?><article style="--discipline-color:<?= htmlspecialchars((string)($icon['couleur_defaut']?:'#64748B')) ?>"><div class="discipline-icon-preview"><?= htmlspecialchars((string)$icon['valeur_icone']) ?></div><strong><?= htmlspecialchars((string)$icon['libelle']) ?></strong><small><?= htmlspecialchars((string)$icon['code']) ?></small><?php if(Permission::can('parametres.icones.manage')): ?><form method="post" action="/public/parametres/icones/archiver" onsubmit="return confirm('Archiver cette icône ?');"><?= Csrf::field() ?><input type="hidden" name="id" value="<?= (int)$icon['id'] ?>"><button>Archiver</button></form><?php endif; ?></article><?php endforeach; ?></div></section><?php endforeach; ?>
