diff --git a/Back-End/Subscriptions/serializers.py b/Back-End/Subscriptions/serializers.py
index f506981..e3aeabd 100644
--- a/Back-End/Subscriptions/serializers.py
+++ b/Back-End/Subscriptions/serializers.py
@@ -381,16 +381,20 @@ class RegistrationFormSerializer(serializers.ModelSerializer):
class StudentByParentSerializer(serializers.ModelSerializer):
id = serializers.IntegerField(required=False)
+ associated_class_name = serializers.SerializerMethodField()
class Meta:
model = Student
- fields = ['id', 'last_name', 'first_name', 'level', 'photo']
+ fields = ['id', 'last_name', 'first_name', 'level', 'photo', 'associated_class_name']
def __init__(self, *args, **kwargs):
super(StudentByParentSerializer, self).__init__(*args, **kwargs)
for field in self.fields:
self.fields[field].required = False
+ def get_associated_class_name(self, obj):
+ return obj.associated_class.atmosphere_name if obj.associated_class else None
+
class RegistrationFormByParentSerializer(serializers.ModelSerializer):
student = StudentByParentSerializer(many=False, required=True)
diff --git a/Front-End/src/app/[locale]/parents/page.js b/Front-End/src/app/[locale]/parents/page.js
index 428d08f..ac61d05 100644
--- a/Front-End/src/app/[locale]/parents/page.js
+++ b/Front-End/src/app/[locale]/parents/page.js
@@ -2,7 +2,7 @@
import React, { useEffect, useState } from 'react';
import { useRouter } from 'next/navigation';
import Table from '@/components/Table';
-import { Edit3, Users, Download, Eye, Upload } from 'lucide-react';
+import { Edit3, Users, Download, Eye, Upload, CalendarDays } from 'lucide-react';
import StatusLabel from '@/components/StatusLabel';
import FileUpload from '@/components/FileUpload';
import { FE_PARENTS_EDIT_SUBSCRIPTION_URL } from '@/utils/Url';
@@ -15,6 +15,12 @@ import { BASE_URL } from '@/utils/Url';
import { useEstablishment } from '@/context/EstablishmentContext';
import { useCsrfToken } from '@/context/CsrfContext';
import { useClasses } from '@/context/ClassesContext';
+import {
+ PlanningProvider,
+ PlanningModes
+} from '@/context/PlanningContext';
+import SectionHeader from '@/components/SectionHeader';
+import ParentPlanningSection from '@/components/ParentPlanningSection';
export default function ParentHomePage() {
const [children, setChildren] = useState([]);
@@ -22,6 +28,8 @@ export default function ParentHomePage() {
const [uploadingStudentId, setUploadingStudentId] = useState(null); // ID de l'étudiant pour l'upload
const [uploadedFile, setUploadedFile] = useState(null); // Fichier uploadé
const [uploadState, setUploadState] = useState('off'); // État "on" ou "off" pour l'affichage du composant
+ const [showPlanning, setShowPlanning] = useState(false);
+ const [planningClassName, setPlanningClassName] = useState(null);
const router = useRouter();
const csrfToken = useCsrfToken();
const [reloadFetch, setReloadFetch] = useState(false);
@@ -97,6 +105,11 @@ export default function ParentHomePage() {
}
};
+ const showClassPlanning = (student) => {
+ setPlanningClassName(`${student.associated_class_name} - ${getNiveauLabel(student.level)}`);
+ setShowPlanning(true);
+ };
+
const childrenColumns = [
{
name: 'photo',
@@ -127,6 +140,12 @@ export default function ParentHomePage() {
},
{ name: 'Nom', transform: (row) => `${row.student.last_name}` },
{ name: 'Prénom', transform: (row) => `${row.student.first_name}` },
+ {
+ name: 'Classe',
+ transform: (row) => (
+
{(row.student.associated_class_name)}
+ ),
+ },
{
name: 'Niveau',
transform: (row) => (
@@ -192,7 +211,6 @@ export default function ParentHomePage() {
>
- {/* Nouvelle action Upload */}