feat: Liaison parents-enfants avec gestion des tuteurs

Les parents doivent pouvoir suivre la scolarité de leurs enfants (notes,
emploi du temps, devoirs). Cela nécessite un lien formalisé entre le
compte parent et le compte élève, géré par les administrateurs.

Le lien est établi soit manuellement via l'interface d'administration,
soit automatiquement lors de l'activation du compte parent lorsque
l'invitation inclut un élève cible. Ce lien conditionne l'accès aux
données scolaires de l'enfant (autorisations vérifiées par un voter
dédié).
This commit is contained in:
2026-02-12 08:38:19 +01:00
parent e930c505df
commit 44ebe5e511
91 changed files with 10071 additions and 39 deletions

View File

@@ -0,0 +1,54 @@
<script lang="ts">
import { page } from '$app/stores';
import GuardianList from '$lib/components/organisms/GuardianList/GuardianList.svelte';
let studentId = $derived($page.params.id ?? '');
</script>
<svelte:head>
<title>Fiche élève - Classeo</title>
</svelte:head>
<div class="student-detail">
<header class="page-header">
<a href="/admin/users" class="back-link">&larr; Retour</a>
<h1>Fiche élève</h1>
</header>
<GuardianList {studentId} />
</div>
<style>
.student-detail {
max-width: 48rem;
margin: 0 auto;
padding: 1.5rem;
display: flex;
flex-direction: column;
gap: 1.5rem;
}
.page-header {
display: flex;
flex-direction: column;
gap: 0.5rem;
}
.back-link {
font-size: 0.875rem;
color: #6b7280;
text-decoration: none;
width: fit-content;
}
.back-link:hover {
color: #3b82f6;
}
.page-header h1 {
margin: 0;
font-size: 1.5rem;
font-weight: 700;
color: #1f2937;
}
</style>

View File

@@ -5,6 +5,7 @@
import DashboardTeacher from '$lib/components/organisms/Dashboard/DashboardTeacher.svelte';
import DashboardStudent from '$lib/components/organisms/Dashboard/DashboardStudent.svelte';
import DashboardAdmin from '$lib/components/organisms/Dashboard/DashboardAdmin.svelte';
import ChildSelector from '$lib/components/organisms/ChildSelector/ChildSelector.svelte';
import { getActiveRole, getIsLoading } from '$features/roles/roleContext.svelte';
type DashboardView = 'parent' | 'teacher' | 'student' | 'admin';
@@ -42,8 +43,15 @@
// Use demo data for now (no real data available yet)
const hasRealData = false;
// Selected child for parent dashboard (will drive data fetching when real API is connected)
let _selectedChildId = $state<string | null>(null);
// Demo child name for personalized messages
const childName = 'Emma';
let childName = $state('Emma');
function handleChildSelected(childId: string) {
_selectedChildId = childId;
}
function handleToggleSerenity(enabled: boolean) {
serenityEnabled = enabled;
@@ -81,6 +89,9 @@
{/if}
{#if dashboardView === 'parent'}
{#if hasRoleContext}
<ChildSelector onChildSelected={handleChildSelected} />
{/if}
<DashboardParent
demoData={typedDemoData}
{isFirstLogin}