Montant total des frais de scolarité :
@@ -1136,7 +1136,7 @@ export default function CreateSubscriptionPage() {
className={`px-6 py-2 rounded-md shadow ${
isSubmitDisabled()
? 'bg-gray-300 text-gray-500 cursor-not-allowed'
- : 'bg-emerald-500 text-white hover:bg-emerald-600'
+ : 'bg-primary text-white hover:bg-primary'
}`}
primary
disabled={isSubmitDisabled()}
diff --git a/Front-End/src/app/[locale]/admin/subscriptions/page.js b/Front-End/src/app/[locale]/admin/subscriptions/page.js
index d69931a..64d26d1 100644
--- a/Front-End/src/app/[locale]/admin/subscriptions/page.js
+++ b/Front-End/src/app/[locale]/admin/subscriptions/page.js
@@ -1,7 +1,7 @@
'use client';
import React, { useState, useEffect } from 'react';
import Table from '@/components/Table';
-import Tab from '@/components/Tab';
+import SidebarTabs from '@/components/SidebarTabs';
import Textarea from '@/components/Textarea';
import { useTranslations } from 'next-intl';
import StatusLabel from '@/components/StatusLabel';
@@ -55,6 +55,7 @@ import {
HISTORICAL_FILTER,
} from '@/utils/constants';
import AlertMessage from '@/components/AlertMessage';
+import EmptyState from '@/components/EmptyState';
import { useNotification } from '@/context/NotificationContext';
import { exportToCSV } from '@/utils/exportCSV';
@@ -167,43 +168,86 @@ export default function Page({ params: { locale } }) {
// Export CSV
const handleExportCSV = () => {
- const dataToExport = activeTab === CURRENT_YEAR_FILTER
- ? registrationFormsDataCurrentYear
- : activeTab === NEXT_YEAR_FILTER
- ? registrationFormsDataNextYear
- : registrationFormsDataHistorical;
+ const dataToExport =
+ activeTab === CURRENT_YEAR_FILTER
+ ? registrationFormsDataCurrentYear
+ : activeTab === NEXT_YEAR_FILTER
+ ? registrationFormsDataNextYear
+ : registrationFormsDataHistorical;
const exportColumns = [
- { key: 'student', label: 'Nom', transform: (value) => value?.last_name || '' },
- { key: 'student', label: 'Prénom', transform: (value) => value?.first_name || '' },
- { key: 'student', label: 'Date de naissance', transform: (value) => value?.birth_date || '' },
- { key: 'student', label: 'Email contact', transform: (value) => value?.guardians?.[0]?.associated_profile_email || '' },
- { key: 'student', label: 'Téléphone contact', transform: (value) => value?.guardians?.[0]?.phone || '' },
- { key: 'student', label: 'Nom responsable 1', transform: (value) => value?.guardians?.[0]?.last_name || '' },
- { key: 'student', label: 'Prénom responsable 1', transform: (value) => value?.guardians?.[0]?.first_name || '' },
- { key: 'student', label: 'Nom responsable 2', transform: (value) => value?.guardians?.[1]?.last_name || '' },
- { key: 'student', label: 'Prénom responsable 2', transform: (value) => value?.guardians?.[1]?.first_name || '' },
+ {
+ key: 'student',
+ label: 'Nom',
+ transform: (value) => value?.last_name || '',
+ },
+ {
+ key: 'student',
+ label: 'Prénom',
+ transform: (value) => value?.first_name || '',
+ },
+ {
+ key: 'student',
+ label: 'Date de naissance',
+ transform: (value) => value?.birth_date || '',
+ },
+ {
+ key: 'student',
+ label: 'Email contact',
+ transform: (value) =>
+ value?.guardians?.[0]?.associated_profile_email || '',
+ },
+ {
+ key: 'student',
+ label: 'Téléphone contact',
+ transform: (value) => value?.guardians?.[0]?.phone || '',
+ },
+ {
+ key: 'student',
+ label: 'Nom responsable 1',
+ transform: (value) => value?.guardians?.[0]?.last_name || '',
+ },
+ {
+ key: 'student',
+ label: 'Prénom responsable 1',
+ transform: (value) => value?.guardians?.[0]?.first_name || '',
+ },
+ {
+ key: 'student',
+ label: 'Nom responsable 2',
+ transform: (value) => value?.guardians?.[1]?.last_name || '',
+ },
+ {
+ key: 'student',
+ label: 'Prénom responsable 2',
+ transform: (value) => value?.guardians?.[1]?.first_name || '',
+ },
{ key: 'school_year', label: 'Année scolaire' },
- { key: 'status', label: 'Statut', transform: (value) => {
- const statusMap = {
- 0: 'En attente',
- 1: 'En cours',
- 2: 'Envoyé',
- 3: 'À relancer',
- 4: 'À valider',
- 5: 'Validé',
- 6: 'Archivé',
- };
- return statusMap[value] || value;
- }},
+ {
+ key: 'status',
+ label: 'Statut',
+ transform: (value) => {
+ const statusMap = {
+ 0: 'En attente',
+ 1: 'En cours',
+ 2: 'Envoyé',
+ 3: 'À relancer',
+ 4: 'À valider',
+ 5: 'Validé',
+ 6: 'Archivé',
+ };
+ return statusMap[value] || value;
+ },
+ },
{ key: 'formatted_last_update', label: 'Dernière mise à jour' },
];
- const yearLabel = activeTab === CURRENT_YEAR_FILTER
- ? currentSchoolYear
- : activeTab === NEXT_YEAR_FILTER
- ? nextSchoolYear
- : 'historique';
+ const yearLabel =
+ activeTab === CURRENT_YEAR_FILTER
+ ? currentSchoolYear
+ : activeTab === NEXT_YEAR_FILTER
+ ? nextSchoolYear
+ : 'historique';
const filename = `inscriptions_${yearLabel}_${new Date().toISOString().split('T')[0]}`;
exportToCSV(dataToExport, exportColumns, filename);
};
@@ -506,7 +550,7 @@ export default function Page({ params: { locale } }) {
{
icon: (
-
+
),
onClick: () =>
@@ -536,7 +580,7 @@ export default function Page({ params: { locale } }) {
{
icon: (
-
+
),
onClick: () =>
@@ -575,7 +619,7 @@ export default function Page({ params: { locale } }) {
{
icon: (
-
+
),
onClick: () => {
@@ -690,7 +734,7 @@ export default function Page({ params: { locale } }) {
{
icon: (
-
+
),
onClick: () => openSepaUploadModal(row),
@@ -800,161 +844,139 @@ export default function Page({ params: { locale } }) {
},
];
- let emptyMessage;
- if (activeTab === CURRENT_YEAR_FILTER && searchTerm === '') {
- emptyMessage = (
-
{
+ if (searchTerm !== '') {
+ return (
+
+ );
+ }
+ if (tabFilter === CURRENT_YEAR_FILTER) {
+ return (
+ router.push(FE_ADMIN_SUBSCRIPTIONS_CREATE_URL)}
+ />
+ );
+ }
+ if (tabFilter === NEXT_YEAR_FILTER) {
+ return (
+ router.push(FE_ADMIN_SUBSCRIPTIONS_CREATE_URL)}
+ />
+ );
+ }
+ return (
+
);
- } else if (activeTab === NEXT_YEAR_FILTER && searchTerm === '') {
- emptyMessage = (
- (
+
+
+
+
+
+
+
+
+ {profileRole !== 0 && (
+
+ )}
+
+
+
+
- );
- } else if (activeTab === HISTORICAL_FILTER && searchTerm === '') {
- emptyMessage = (
-
- );
- }
+
+ );
if (isLoading) {
return ;
}
return (
-
-
-
- {/* Tab pour l'année scolaire en cours */}
-
- {currentSchoolYear}
-
- ({totalCurrentYear})
-
- >
- }
- active={activeTab === CURRENT_YEAR_FILTER}
- onClick={() => setActiveTab(CURRENT_YEAR_FILTER)}
- />
-
- {/* Tab pour l'année scolaire prochaine */}
-
- {nextSchoolYear}
-
- ({totalNextYear})
-
- >
- }
- active={activeTab === NEXT_YEAR_FILTER}
- onClick={() => setActiveTab(NEXT_YEAR_FILTER)}
- />
-
- {/* Tab pour l'historique */}
-
- {t('historical')}
-
- ({totalHistorical})
-
- >
- }
- active={activeTab === HISTORICAL_FILTER}
- onClick={() => setActiveTab(HISTORICAL_FILTER)}
- />
-
-
-
-
- {activeTab === CURRENT_YEAR_FILTER ||
- activeTab === NEXT_YEAR_FILTER ||
- activeTab === HISTORICAL_FILTER ? (
-
-
-
-
-
-
-
-
- {profileRole !== 0 && (
-
- )}
-
-
-
-
-
- ) : null}
-
+
+
0 ? ` (${totalCurrentYear})` : ''}`,
+ content: renderTabContent(
+ registrationFormsDataCurrentYear,
+ currentSchoolYearPage,
+ totalCurrentSchoolYearPages,
+ CURRENT_YEAR_FILTER
+ ),
+ },
+ {
+ id: NEXT_YEAR_FILTER,
+ label: `${nextSchoolYear}${totalNextYear > 0 ? ` (${totalNextYear})` : ''}`,
+ content: renderTabContent(
+ registrationFormsDataNextYear,
+ currentSchoolNextYearPage,
+ totalNextSchoolYearPages,
+ NEXT_YEAR_FILTER
+ ),
+ },
+ {
+ id: HISTORICAL_FILTER,
+ label: `${t('historical')}${totalHistorical > 0 ? ` (${totalHistorical})` : ''}`,
+ content: renderTabContent(
+ registrationFormsDataHistorical,
+ currentSchoolHistoricalYearPage,
+ totalHistoricalPages,
+ HISTORICAL_FILTER
+ ),
+ },
+ ]}
+ onTabChange={(newTab) => setActiveTab(newTab)}
+ />
- {/* Ajout du logo */}
- {t('welcomeParents')}
- {t('pleaseLogin')}
+
+
+
{t('welcomeParents')}
+
{t('pleaseLogin')}
);
diff --git a/Front-End/src/app/[locale]/parents/layout.js b/Front-End/src/app/[locale]/parents/layout.js
index 22319ae..92e7e05 100644
--- a/Front-End/src/app/[locale]/parents/layout.js
+++ b/Front-End/src/app/[locale]/parents/layout.js
@@ -100,7 +100,7 @@ export default function Layout({ children }) {
{/* Main container */}
{children}
diff --git a/Front-End/src/app/[locale]/parents/page.js b/Front-End/src/app/[locale]/parents/page.js
index 42d497f..576225a 100644
--- a/Front-End/src/app/[locale]/parents/page.js
+++ b/Front-End/src/app/[locale]/parents/page.js
@@ -282,10 +282,10 @@ export default function ParentHomePage() {
<>
@@ -309,7 +309,7 @@ export default function ParentHomePage() {
title="Événements à venir"
description="Prochains événements de l'établissement"
/>
-
+
{upcomingEvents.slice(0, 3).map((event, index) => (
))}
@@ -343,7 +343,7 @@ export default function ParentHomePage() {
return (
{/* En-tête de la carte (toujours visible) */}
-
+
{student.last_name} {student.first_name}
@@ -399,7 +399,7 @@ export default function ParentHomePage() {
{child.status === 2 && (