feat: Regrouper les cartes du dashboard admin par section thématique
Some checks failed
CI / Backend Tests (push) Has been cancelled
CI / Frontend Tests (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
CI / Naming Conventions (push) Has been cancelled
CI / Build Check (push) Has been cancelled

Le dashboard admin affichait 16 cartes dans une grille unique sans
organisation logique, obligeant l'administrateur à scanner visuellement
toutes les cartes pour trouver la fonctionnalité souhaitée.

Les cartes sont désormais regroupées en 5 sections cohérentes
(Personnes, Organisation, Année scolaire, Paramètres, Imports)
qui reflètent la structure du menu de navigation latéral.
This commit is contained in:
2026-03-18 01:30:43 +01:00
parent 876307a99d
commit 706ec43473
3 changed files with 142 additions and 105 deletions

View File

@@ -11,6 +11,58 @@
hasRealData?: boolean;
establishmentName?: string;
} = $props();
type ActionCard = { href: string; icon: string; label: string; hint: string };
type DashboardSectionDef = { id: string; title: string; cards: ActionCard[] };
const dashboardSections: DashboardSectionDef[] = [
{
id: 'personnes',
title: 'Personnes',
cards: [
{ href: '/admin/users', icon: '👥', label: 'Gérer les utilisateurs', hint: 'Inviter et gérer' },
{ href: '/admin/parent-invitations', icon: '✉️', label: 'Invitations parents', hint: "Codes d'invitation" },
{ href: '/admin/students', icon: '🎒', label: 'Gérer les élèves', hint: 'Inscrire et affecter' }
]
},
{
id: 'organisation',
title: 'Organisation',
cards: [
{ href: '/admin/classes', icon: '🏫', label: 'Configurer les classes', hint: 'Créer et gérer' },
{ href: '/admin/subjects', icon: '📚', label: 'Gérer les matières', hint: 'Créer et gérer' },
{ href: '/admin/assignments', icon: '📋', label: 'Affectations', hint: 'Enseignants et classes' },
{ href: '/admin/replacements', icon: '🔄', label: 'Remplacements', hint: 'Enseignants absents' },
{ href: '/admin/schedule', icon: '🕐', label: 'Emploi du temps', hint: 'Cours et créneaux' }
]
},
{
id: 'annee-scolaire',
title: 'Année scolaire',
cards: [
{ href: '/admin/academic-year/periods', icon: '📅', label: 'Périodes scolaires', hint: 'Trimestres et semestres' },
{ href: '/admin/calendar', icon: '🗓️', label: 'Calendrier scolaire', hint: 'Fériés et vacances' }
]
},
{
id: 'parametres',
title: 'Paramètres',
cards: [
{ href: '/admin/image-rights', icon: '📷', label: "Droit à l'image", hint: 'Autorisations élèves' },
{ href: '/admin/pedagogy', icon: '🎓', label: 'Pédagogie', hint: 'Mode de notation' },
{ href: '/admin/branding', icon: '🎨', label: 'Identité visuelle', hint: 'Logo et couleurs' },
{ href: '/admin/homework-rules', icon: '📏', label: 'Règles de devoirs', hint: 'Timing et contraintes' }
]
},
{
id: 'imports',
title: 'Imports',
cards: [
{ href: '/admin/import/students', icon: '📤', label: 'Importer des élèves', hint: 'CSV ou XLSX' },
{ href: '/admin/import/teachers', icon: '📤', label: 'Importer des enseignants', hint: 'CSV ou XLSX' }
]
}
];
</script>
<div class="dashboard-admin">
@@ -23,91 +75,20 @@
{/if}
</header>
<div class="quick-actions">
<h2 class="sr-only">Actions de configuration</h2>
<div class="action-cards">
<a class="action-card" href="/admin/users">
<span class="action-icon">👥</span>
<span class="action-label">Gérer les utilisateurs</span>
<span class="action-hint">Inviter et gérer</span>
</a>
<a class="action-card" href="/admin/parent-invitations">
<span class="action-icon">✉️</span>
<span class="action-label">Invitations parents</span>
<span class="action-hint">Codes d'invitation</span>
</a>
<a class="action-card" href="/admin/classes">
<span class="action-icon">🏫</span>
<span class="action-label">Configurer les classes</span>
<span class="action-hint">Créer et gérer</span>
</a>
<a class="action-card" href="/admin/students">
<span class="action-icon">🎒</span>
<span class="action-label">Gérer les élèves</span>
<span class="action-hint">Inscrire et affecter</span>
</a>
<a class="action-card" href="/admin/subjects">
<span class="action-icon">📚</span>
<span class="action-label">Gérer les matières</span>
<span class="action-hint">Créer et gérer</span>
</a>
<a class="action-card" href="/admin/assignments">
<span class="action-icon">📋</span>
<span class="action-label">Affectations</span>
<span class="action-hint">Enseignants et classes</span>
</a>
<a class="action-card" href="/admin/replacements">
<span class="action-icon">🔄</span>
<span class="action-label">Remplacements</span>
<span class="action-hint">Enseignants absents</span>
</a>
<a class="action-card" href="/admin/schedule">
<span class="action-icon">🕐</span>
<span class="action-label">Emploi du temps</span>
<span class="action-hint">Cours et créneaux</span>
</a>
<a class="action-card" href="/admin/academic-year/periods">
<span class="action-icon">📅</span>
<span class="action-label">Périodes scolaires</span>
<span class="action-hint">Trimestres et semestres</span>
</a>
<a class="action-card" href="/admin/calendar">
<span class="action-icon">🗓️</span>
<span class="action-label">Calendrier scolaire</span>
<span class="action-hint">Fériés et vacances</span>
</a>
<a class="action-card" href="/admin/image-rights">
<span class="action-icon">📷</span>
<span class="action-label">Droit à l'image</span>
<span class="action-hint">Autorisations élèves</span>
</a>
<a class="action-card" href="/admin/pedagogy">
<span class="action-icon">🎓</span>
<span class="action-label">Pédagogie</span>
<span class="action-hint">Mode de notation</span>
</a>
<a class="action-card" href="/admin/branding">
<span class="action-icon">🎨</span>
<span class="action-label">Identité visuelle</span>
<span class="action-hint">Logo et couleurs</span>
</a>
<a class="action-card" href="/admin/homework-rules">
<span class="action-icon">📏</span>
<span class="action-label">Règles de devoirs</span>
<span class="action-hint">Timing et contraintes</span>
</a>
<a class="action-card" href="/admin/import/students">
<span class="action-icon">📤</span>
<span class="action-label">Importer des élèves</span>
<span class="action-hint">CSV ou XLSX</span>
</a>
<a class="action-card" href="/admin/import/teachers">
<span class="action-icon">📤</span>
<span class="action-label">Importer des enseignants</span>
<span class="action-hint">CSV ou XLSX</span>
</a>
</div>
</div>
{#each dashboardSections as section (section.id)}
<section class="dashboard-section" aria-labelledby="section-{section.id}">
<h2 id="section-{section.id}" class="section-title">{section.title}</h2>
<div class="action-cards">
{#each section.cards as card (card.href)}
<a class="action-card" href={card.href}>
<span class="action-icon">{card.icon}</span>
<span class="action-label">{card.label}</span>
<span class="action-hint">{card.hint}</span>
</a>
{/each}
</div>
</section>
{/each}
<div class="dashboard-grid">
<DashboardSection
@@ -182,20 +163,19 @@
color: #6b7280;
}
.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border: 0;
.dashboard-section {
display: flex;
flex-direction: column;
gap: 0.75rem;
}
.quick-actions {
margin-bottom: 0.5rem;
.section-title {
margin: 0;
font-size: 1.1rem;
font-weight: 600;
color: #374151;
padding-bottom: 0.5rem;
border-bottom: 1px solid #e5e7eb;
}
.action-cards {

View File

@@ -207,14 +207,6 @@
}
}
function ruleTypeLabel(type: string): string {
return type === 'minimum_delay'
? 'Délai minimum'
: type === 'no_monday_after'
? 'Pas de devoir pour lundi'
: type;
}
function formatDate(dateStr: string): string {
const d = new Date(dateStr);
return d.toLocaleDateString('fr-FR', {