Skip to content

Commit 065b63f

Browse files
Merge pull request symfony#2 from BekhechiWahib/email-template
Email template fix
2 parents fdd38c2 + b0e20b4 commit 065b63f

File tree

9 files changed

+400
-86
lines changed

9 files changed

+400
-86
lines changed

Gestion_PFE_Frontend_React/package-lock.json

Lines changed: 238 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Gestion_PFE_Frontend_React/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,14 @@
1717
"@tinymce/tinymce-react": "^5.1.1",
1818
"axios": "^1.7.7",
1919
"formik": "^2.4.6",
20+
"moment": "^2.30.1",
2021
"papaparse": "^5.4.1",
2122
"quill": "^2.0.3",
2223
"react": "^18.3.1",
24+
"react-big-calendar": "^1.16.3",
2325
"react-circular-progressbar": "^2.1.0",
26+
"react-dnd": "^16.0.1",
27+
"react-dnd-html5-backend": "^16.0.1",
2428
"react-dom": "^18.3.1",
2529
"react-icons": "^5.3.0",
2630
"react-router-dom": "^6.27.0",

Gestion_PFE_Frontend_React/src/components/circle_progression_bar.jsx

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
import React from "react";
2-
import { CircularProgressbar, buildStyles } from "react-circular-progressbar";
2+
import { CircularProgressbar,CircularProgressbarWithChildren, buildStyles } from "react-circular-progressbar";
33
import "react-circular-progressbar/dist/styles.css";
44

5+
56
const CircularProgress = ({ percentage ,color}) => {
67
return (
8+
9+
710
<div style={{ width: "150px", height: "150px" }}>
811
<CircularProgressbar
912
value={percentage}
@@ -18,4 +21,29 @@ const CircularProgress = ({ percentage ,color}) => {
1821
);
1922
};
2023

24+
25+
2126
export default CircularProgress;
27+
28+
29+
30+
/*
31+
const CircularProgress = ({ percentage ,color}) => {
32+
return (
33+
34+
35+
<div style={{ width: "150px", height: "150px" }}>
36+
<CircularProgressbar
37+
value={percentage}
38+
text={`${percentage}%`}
39+
styles={buildStyles({
40+
textColor: color, // Couleur du texte
41+
pathColor: color, // Couleur de la barre
42+
trailColor: "#d6d6d6", // Couleur de l'arrière-plan
43+
})}
44+
/>
45+
</div>
46+
);
47+
};*/
48+
49+
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { Calendar, momentLocalizer } from 'react-big-calendar';
2+
import moment from 'moment';
3+
import 'react-big-calendar/lib/css/react-big-calendar.css';
4+
import 'react-big-calendar/lib/addons/dragAndDrop/styles.css'; // Style pour drag-and-drop
5+
import withDragAndDrop from 'react-big-calendar/lib/addons/dragAndDrop';
6+
const localizer = momentLocalizer(moment);
7+
const DragAndDropCalendar = withDragAndDrop(Calendar); // Active le DnD
8+
9+
const MyCalendar = ({ events, onEventDrop }) => {
10+
return (
11+
<DragAndDropCalendar
12+
localizer={localizer}
13+
events={events}
14+
startAccessor="start"
15+
endAccessor="end"
16+
style={{ height: 500 }}
17+
onEventDrop={onEventDrop} // Drag-and-drop handler
18+
draggableAccessor={() => true} // Rend les événements déplaçables
19+
/>
20+
);
21+
};
22+
23+
export default MyCalendar;

Gestion_PFE_Frontend_React/src/index.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,8 @@ textarea:hover {
318318

319319

320320

321+
322+
321323

322324

323325

Gestion_PFE_Frontend_React/src/views/dashboard admin/pages/home_page.jsx

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,42 @@ import '../styles/home_page.css';
88

99
import { ClipLoader } from 'react-spinners';
1010
import { FaBell, FaSearch } from 'react-icons/fa';
11-
11+
import MyCalendar from '../../../components/my_calendar';
12+
import { DndProvider } from 'react-dnd';
13+
import { HTML5Backend } from 'react-dnd-html5-backend';
1214

1315

1416

1517
function HomePage(){
18+
19+
20+
21+
const [events, setEvents] = useState([
22+
{
23+
title: 'Réunion',
24+
start: new Date(2024, 11, 10, 10, 0),
25+
end: new Date(2024, 11, 10, 11, 0),
26+
},
27+
{
28+
title: 'Déjeuner',
29+
start: new Date(2024, 11, 11, 12, 0),
30+
end: new Date(2024, 11, 11, 13, 0),
31+
},
32+
]);
33+
34+
const handleEventDrop = ({ event, start, end }) => {
35+
const updatedEvents = events.map((evt) =>
36+
evt === event ? { ...evt, start, end } : evt
37+
);
38+
setEvents(updatedEvents);
39+
};
40+
41+
42+
43+
44+
45+
46+
1647
return (
1748
<>
1849
<div className="appBar">
@@ -48,6 +79,11 @@ function HomePage(){
4879
<ClipLoader color="#00BFFF" loading={true} size={40} />
4980
<p>Chargement...</p>
5081
</div>
82+
83+
<DndProvider backend={HTML5Backend}>
84+
<MyCalendar events={events} onEventDrop={handleEventDrop} />
85+
</DndProvider>
86+
5187
</>
5288
);
5389
}

Gestion_PFE_Frontend_React/src/views/dashboard admin/pages/page_envoi_config_email.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ const EvoieConfigEmail = () => {
130130
/>
131131

132132
<p>Description :</p>
133-
<textarea
133+
<textarea
134134
className="auto-expand"
135135
rows={1} // Hauteur initiale : 1 ligne
136136
maxLength={150} // Limite du nombre total de caractères (optionnel)

Gestion_PFE_Frontend_React/src/views/dashboard admin/pages/page_gestion_email.jsx

Lines changed: 42 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -11,38 +11,39 @@ function PageGestionEmail (){
1111
const [isSelected,setSelected]=useState(false);
1212
const [isSelected2,setSelected2]=useState(false);
1313

14+
15+
16+
17+
18+
19+
20+
21+
const calculatePercentPfeStatus = () => {
22+
const validCount = dataTheme.filter((pfe) => pfe.est_valider === "valide").length;
23+
return ((validCount / dataTheme.length) * 100).toFixed(2);
24+
};
25+
26+
const getPercentageColor = (percentage) => {
27+
if (percentage < 30) return "red";
28+
if (percentage < 70) return "orange";
29+
return "green";
30+
};
31+
32+
33+
34+
35+
36+
1437
return (
1538
<div className="gestion-email">
1639
<header className="header-email-page">
17-
<div
18-
className="email-type-template"
19-
onClick={() => {
20-
setSelected(true);
21-
}}
22-
onMouseLeave={() => {
23-
setSelected(false);
24-
}} >
25-
Email Template
26-
{isSelected ? (
27-
<ul>
28-
<li>
29-
<Link to={''}>appel a proposition</Link>
30-
31-
</li>
32-
<li>
33-
<Link to={''}>appel a encadrement</Link>
34-
35-
</li>
36-
<li>
37-
<Link to={''}>appel a proposition de stage</Link>
38-
39-
</li>
40-
</ul>
41-
) : null}
40+
41+
<div className="email-type-template" >
42+
<Link to={`${window.location.pathname}/configuration?type-email=proposition-encadrement`}> Email Template</Link>
4243
</div>
4344

44-
<div
45-
className="email-type-control"
45+
{/*<div
46+
className="email-template-configue"
4647
onClick={() => {
4748
setSelected2(true);
4849
}}
@@ -53,7 +54,7 @@ function PageGestionEmail (){
5354
{isSelected2 ? (
5455
<ul>
5556
<li>
56-
<Link to={`${window.location.pathname}/configuration?type-email=proposition-pfe`}>Email de proposition PFE</Link>
57+
{ //!pour les parametre dans l'url <Link to={`${window.location.pathname}/configuration?type-email=proposition-pfe`}>Email de proposition PFE</Link>}
5758
</li>
5859
<li>
5960
<Link to={`${window.location.pathname}/configuration?type-email=proposition-encadrement`}>Email de proposition Encadrement</Link>
@@ -64,24 +65,25 @@ function PageGestionEmail (){
6465
</ul>
6566
) : null}
6667
</div>
68+
*/}
6769

6870

6971
</header>
7072

7173
<div className="header-email">
72-
<div>
73-
<CircularProgress percentage={35} color={"red"} />
74-
<p>Proposition PFE soumise</p>
75-
</div>
76-
<div>
77-
<CircularProgress percentage={65} color={"orange"} />
78-
<p>Proposition encadrement soumise</p>
79-
</div>
80-
<div>
81-
<CircularProgress percentage={100} color={"green"} />
82-
<p>Proposition soumise</p>
83-
</div>
74+
<div className="progress-item">
75+
<CircularProgress percentage={65} color="red" />
76+
<p>Proposition PFE soumise</p>
77+
</div>
78+
<div className="progress-item">
79+
<CircularProgress percentage={25} color="orange" />
80+
<p>Proposition encadrement soumise</p>
8481
</div>
82+
<div className="progress-item">
83+
<CircularProgress percentage={100} color="green" />
84+
<p>Proposition soumise</p>
85+
</div>
86+
</div>
8587

8688
<main className="email-main-part">
8789
<div className="non-proposition">

Gestion_PFE_Frontend_React/src/views/dashboard admin/styles/page_gestion_email.css

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66

77
.header-email-page {
8-
background-color: #dfdfdf;
8+
background-color: #ffffff;
99
display: flex;
1010
align-items: center;
1111

@@ -14,18 +14,17 @@
1414
.header-email-page div{
1515
background-color: #cfcfcf;
1616
position: relative;
17-
padding: 5px;
1817
margin-right: 5px;
1918
width: fit-content;
20-
border-left: 1px solid #2c3e50a9;
21-
border-right: 1px solid #2c3e50a9;
19+
2220
cursor: pointer;
2321

2422
}
2523

2624

2725
.header-email-page div:hover{
2826
background-color: #b5b5b5;
27+
transition: background-color 0.5s ease;
2928
}
3029

3130

@@ -50,29 +49,33 @@
5049

5150
.header-email-page div a {
5251
text-decoration: none;
53-
color: #333;
54-
display: block; /* Assure que les liens remplissent entièrement leur conteneur */
55-
padding: 5px 10px; /* Ajoute un peu d'espacement interne */
56-
white-space: nowrap; /* Empêche les liens de se diviser en plusieurs lignes */
52+
background-color: #2c3e50;
53+
width: 100%;
54+
color: #ffffff;
55+
display: block;
56+
padding: 20px 25px;
57+
white-space: nowrap;
58+
5759
}
5860
.header-email-page div a:hover {
59-
background-color: #dadada;
61+
background-color: #375778;
62+
transition: background-color 0.7s ease;
6063
}
6164

6265

6366
.header-email{
6467
display: flex;
65-
justify-content: space-evenly; /* Espacement égal entre les sections */
66-
align-items: center; /* Alignement vertical au centre */
68+
justify-content: space-evenly;
69+
align-items: center;
6770
width: 100%;
68-
min-width: 1000px;
69-
padding: 20px; /* Ajout d'un peu d'espace autour */
71+
72+
padding: 20px;
7073
}
7174
.header-email div {
7275
display: flex;
73-
flex-direction: column; /* Empile la barre et le texte verticalement */
74-
align-items: center; /* Aligne la barre et le texte horizontalement au centre */
75-
text-align: center; /* Centrage du texte */
76+
flex-direction: column;
77+
align-items: center;
78+
text-align: center;
7679
gap: 10px;
7780
color: white;
7881
padding: 10px;
@@ -85,6 +88,11 @@
8588
}
8689

8790

91+
92+
93+
94+
95+
8896
/*==============================================================================*/
8997

9098
.email-main-part{

0 commit comments

Comments
 (0)