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:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user