securité cours + correction bug accueil
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
@import url('https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap');
|
@import url('https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap');
|
||||||
|
|
||||||
h1 {
|
.MuiTypography-h1 {
|
||||||
font-size: 3.2em;
|
font-size: 3.2em;
|
||||||
line-height: 1.1;
|
line-height: 1.1;
|
||||||
font-family: "Nunito", sans-serif !important;
|
font-family: "Nunito", sans-serif !important;
|
||||||
@@ -21,6 +21,10 @@ span {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.MuiTypography-h2{
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
.css-1ulggnf h2,
|
.css-1ulggnf h2,
|
||||||
.MuiTypography-span,
|
.MuiTypography-span,
|
||||||
.MuiTypography-h6{
|
.MuiTypography-h6{
|
||||||
@@ -28,25 +32,3 @@ span {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.c4lv-remember {
|
|
||||||
background-color: #d7d9eb;
|
|
||||||
margin: 24px auto 8px auto;
|
|
||||||
padding: 24px 30px;
|
|
||||||
max-width: 75%;
|
|
||||||
border: 2px solid #315397;
|
|
||||||
border-radius: 16px;
|
|
||||||
color: #315397;
|
|
||||||
font-family: Poppins, sans-serif;
|
|
||||||
font-size: 1rem;
|
|
||||||
font-weight: 400;
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
.c4lv-remember::before {
|
|
||||||
content: "🧠 À retenir";
|
|
||||||
display: block;
|
|
||||||
margin-bottom: 10px;
|
|
||||||
font-size: 1.5em;
|
|
||||||
font-weight: 600;
|
|
||||||
color: #315397;
|
|
||||||
}
|
|
||||||
@@ -18,6 +18,8 @@ import {
|
|||||||
Tab,
|
Tab,
|
||||||
} from "@mui/material";
|
} from "@mui/material";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
|
import { useNavigate } from "react-router-dom";
|
||||||
|
import { getToken } from "../../auth";
|
||||||
import '../../assets/styleCours.css';
|
import '../../assets/styleCours.css';
|
||||||
|
|
||||||
const API_URL = "https://www.formations.octopusdesign.fr/webservice/rest/server.php";
|
const API_URL = "https://www.formations.octopusdesign.fr/webservice/rest/server.php";
|
||||||
@@ -37,9 +39,17 @@ const ListeCours = () => {
|
|||||||
const [assignmentQuery, setAssignmentQuery] = useState("");
|
const [assignmentQuery, setAssignmentQuery] = useState("");
|
||||||
const [showOnlyMedia, setShowOnlyMedia] = useState(false);
|
const [showOnlyMedia, setShowOnlyMedia] = useState(false);
|
||||||
const [tabIndex, setTabIndex] = useState(0);
|
const [tabIndex, setTabIndex] = useState(0);
|
||||||
|
const navigate = useNavigate();
|
||||||
|
|
||||||
|
// ✅ Redirection si non connecté
|
||||||
|
useEffect(() => {
|
||||||
|
if (!getToken()) {
|
||||||
|
navigate("/admin/login");
|
||||||
|
}
|
||||||
|
}, [navigate]);
|
||||||
|
|
||||||
const itemsPerPage = 5;
|
const itemsPerPage = 5;
|
||||||
const pdfRef = useRef();
|
const pdfRef = useRef();
|
||||||
|
|
||||||
const pageHasMedia = (html) => /<img|<video|<audio|pluginfile\.php/.test(html);
|
const pageHasMedia = (html) => /<img|<video|<audio|pluginfile\.php/.test(html);
|
||||||
|
|
||||||
const fetchCours = async () => {
|
const fetchCours = async () => {
|
||||||
|
|||||||
@@ -67,19 +67,18 @@ const GestionPageAccueil = () => {
|
|||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
setHeroTitle(data.acf?.hero_title || "");
|
setHeroTitle(data.acf?.hero_title || "");
|
||||||
setHeroText(data.acf?.hero_text || "");
|
setHeroText(data.acf?.hero_text || "");
|
||||||
|
setMissions(data.acf?.mission || []);
|
||||||
|
|
||||||
// ✅ Image Hero
|
// ✅ Image Hero
|
||||||
if (data.acf?.img_hero) {
|
|
||||||
if (data.acf?.img_hero_url) {
|
if (data.acf?.img_hero_url) {
|
||||||
setHeroImage(data.acf.img_hero_url);
|
setHeroImage(data.acf.img_hero_url);
|
||||||
} else {
|
} else if (data.acf?.img_hero) {
|
||||||
const mediaResponse = await fetch(
|
const mediaResponse = await fetch(
|
||||||
`https://preprod.octopusdesign.fr/api-octopus/server/wp-json/wp/v2/media/${data.acf.img_hero}`
|
`https://preprod.octopusdesign.fr/api-octopus/server/wp-json/wp/v2/media/${data.acf.img_hero}`
|
||||||
);
|
);
|
||||||
const mediaData = await mediaResponse.json();
|
const mediaData = await mediaResponse.json();
|
||||||
setHeroImage(mediaData.source_url);
|
setHeroImage(mediaData.source_url);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// ✅ GDC Construct
|
// ✅ GDC Construct
|
||||||
setConstructTitle(data.acf?.gdc_construct?.construct_title || "");
|
setConstructTitle(data.acf?.gdc_construct?.construct_title || "");
|
||||||
|
|||||||
-4949
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user