Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions backend/src/middlewares/multer.middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const acceptedMIMETypesByItem: Record<string, Record<string, MIMEType[]>> = {
},
plannings: {
tc: [MIMEType.PDF],
tci: [MIMEType.PDF],
bachelor_ia: [MIMEType.PDF],
fise: [MIMEType.PDF],
fisea: [MIMEType.PDF],
Expand Down
1 change: 1 addition & 0 deletions frontend/src/components/Admin/adminExportImport.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ export const AdminImportPlannings = () => {
</CardHeader>
<CardContent className="space-y-4">
<AdminFileImport category="plannings" item="tc" title="Tronc Commun" />
<AdminFileImport category="plannings" item="tci" title="Tronc Commun International" />
<AdminFileImport category="plannings" item="bachelor_ia" title="Bachelor IA" />
<AdminFileImport category="plannings" item="fise" title="Branche FISE" />
<AdminFileImport category="plannings" item="fisea" title="Branche FISEA" />
Expand Down
35 changes: 16 additions & 19 deletions frontend/src/components/Plannings/planningSection.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useEffect, useState } from "react";
import { useEffect, useState } from 'react';

import { Card, CardContent, CardHeader, CardTitle } from "../ui/card";
import { Card, CardContent, CardHeader, CardTitle } from '../ui/card';

type Planning = {
name: string;
Expand All @@ -9,38 +9,40 @@ type Planning = {

const plannings: Planning[] = [
{
name: "Planning TC",
name: 'Planning TC',
url: `${import.meta.env.VITE_API_URL}/uploads/plannings/tc.pdf`,
},
{
name: "Planning Bachelor IA",
name: 'Planning TCI',
url: `${import.meta.env.VITE_API_URL}/uploads/plannings/tci.pdf`,
},
{
name: 'Planning Bachelor IA',
url: `${import.meta.env.VITE_API_URL}/uploads/plannings/bachelor_ia.pdf`,
},
{
name: "Planning Branche (non-alternant)",
name: 'Planning Branche (non-alternant)',
url: `${import.meta.env.VITE_API_URL}/uploads/plannings/fise.pdf`,
},
{
name: "Planning Branche FISEA (alternants)",
name: 'Planning Branche FISEA (alternants)',
url: `${import.meta.env.VITE_API_URL}/uploads/plannings/fisea.pdf`,
},
{
name: "Planning Master",
name: 'Planning Master',
url: `${import.meta.env.VITE_API_URL}/uploads/plannings/master.pdf`,
},
];

export const PlanningSection = () => {
const [availablePlannings, setAvailablePlannings] = useState<
Record<string, boolean>
>({});
const [availablePlannings, setAvailablePlannings] = useState<Record<string, boolean>>({});

useEffect(() => {
const checkAvailability = async () => {
const availability: Record<string, boolean> = {};
for (const planning of plannings) {
try {
const response = await fetch(planning.url, { method: "HEAD" });
const response = await fetch(planning.url, { method: 'HEAD' });
availability[planning.name] = response.ok;
} catch {
availability[planning.name] = false;
Expand All @@ -59,17 +61,13 @@ export const PlanningSection = () => {
📅 Plannings de la semaine d'Intégration
</CardTitle>
<p className="text-lg md:text-xl text-gray-700">
Retrouve ici tous les plannings (TC, Branche, FISEA, Master) et
télécharge-les.
Retrouve ici tous les plannings (TC, Branche, FISEA, Master) et télécharge-les.
</p>
</CardHeader>

<CardContent className="space-y-12">
{plannings.map((planning) => (
<Card
key={planning.name}
className="w-full max-w-3xl mx-auto"
>
<Card key={planning.name} className="w-full max-w-3xl mx-auto">
{/* Titre planning centré */}
<CardHeader>
<CardTitle className="text-3xl font-bold text-gray-800 text-center">
Expand All @@ -94,8 +92,7 @@ export const PlanningSection = () => {
<a
href={planning.url}
download
className="px-6 py-2 bg-blue-600 text-white font-medium rounded-xl hover:bg-blue-700 transition"
>
className="px-6 py-2 bg-blue-600 text-white font-medium rounded-xl hover:bg-blue-700 transition">
Télécharger le planning
</a>
</div>
Expand Down
Loading