From 1160ce544f39fb3dd06bccef657de8715c00a5b2 Mon Sep 17 00:00:00 2001 From: cherif Date: Thu, 27 Apr 2023 18:14:50 +0200 Subject: [PATCH] 25/04/23 - 21h --- src/components/HebergementLms.js | 223 ++++++++------ src/components/Partner.js | 22 +- src/mysy_img/downarrow.png | Bin 0 -> 2073 bytes src/mysy_img/menu_open.png | Bin 0 -> 1299 bytes src/mysy_img/menu_open_1.png | Bin 0 -> 1062 bytes src/mysy_img/uparrow.png | Bin 0 -> 1700 bytes src/styles/components/_hebergementlms.scss | 339 +++++++++++++++++++-- src/styles/components/_partner.scss | 6 +- 8 files changed, 466 insertions(+), 124 deletions(-) create mode 100644 src/mysy_img/downarrow.png create mode 100644 src/mysy_img/menu_open.png create mode 100644 src/mysy_img/menu_open_1.png create mode 100644 src/mysy_img/uparrow.png diff --git a/src/components/HebergementLms.js b/src/components/HebergementLms.js index b312ba0..0c6f7e1 100644 --- a/src/components/HebergementLms.js +++ b/src/components/HebergementLms.js @@ -151,6 +151,7 @@ function HebergementLms(props) { useEffect(() => { + window.scrollTo(0, 0); GetLms_Themes(); submenu_design(); }, []) @@ -171,6 +172,9 @@ function HebergementLms(props) { const [img_logo_file, setimg_logo_file] = useState(); const [img_bg_file, setimg_bg_file] = useState(); + const [img_logo_file2, setimg_logo_file2] = useState(); + const [img_bg_file2, setimg_bg_file2] = useState(); + const handleSubmission_logo = event => { clear_message(); @@ -188,7 +192,7 @@ function HebergementLms(props) { //image/png if (String(file_type) !== "image/png") { - alert("Le fichier n'est pas au formation PNG"); + alert("Le fichier n'est pas au format PNG"); return; } @@ -205,52 +209,19 @@ function HebergementLms(props) { img_height = this.height; img_width = this.width; _URL.revokeObjectURL(objectUrl); + console.log(" img_width = ", img_width, " img_height = ", img_height) - if (parseFloat(img_width) > 200 && parseFloat(img_width) < 280 && - parseFloat(img_height) > 60 && parseFloat(img_height) < 80) { + if (parseFloat(img_width) > 150 && parseFloat(img_width) < 280 && + parseFloat(img_height) > 60 && parseFloat(img_height) < 90) { //console.log(" img_height est = ", img_height, " < à 1500 "); setlogo_file_name(event.target.files[0].name); setimg_logo_file(URL.createObjectURL(event.target.files[0])); + setimg_logo_file2(event.target.files[0]); - - const formData = new FormData(); - formData.append('File', fileUploaded); - //formData.append('token', 'K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA'); - const stored_cookie = getCookie('tokenmysypart'); - formData.append("token", stored_cookie); - - - fetch( - process.env.REACT_APP_API_URL + "myclass/api/Lms_Add_Logo_File/", - { - method: 'POST', - body: formData, - } - ) - .then((response) => response.json()) - .then((result) => { - //console.log('Success:', result['message']); - - if (String(result['status']) === String("true")) { - sethandleSubmission_logo_api("true"); - - } - else { - sethandleSubmission_logo_api("false"); - sethandleSubmission_logo_message(result['message']); - } - setLoading(false); - - }) - .catch((error) => { - console.error('Error:', result); - sethandleSubmission_logo_api("false"); - sethandleSubmission_logo_message(result['message']); - setLoading(false); - }); } else { - sethandleSubmission_logo_message(" La taille de l'image est incorrecte"); + + sethandleSubmission_logo_message(" La taille de l'image est incorrecte."); sethandleSubmission_logo_api("false"); setLoading(false); return; @@ -263,6 +234,58 @@ function HebergementLms(props) { }; + const [Send_logo_Img_api, setSend_logo_Img_api] = useState(); + const [Send_logo_Img_result, setSend_logo_Img_result] = useState(); + const [Send_logo_Img_message, setSend_logo_Img_message] = useState(); + + function Send_logo_Img() { + clear_message(); + + + setLoading(true); + + + const formData = new FormData(); + formData.append('File', img_logo_file2); + //formData.append('token', 'K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA'); + const stored_cookie = getCookie('tokenmysypart'); + formData.append("token", stored_cookie); + + + fetch( + process.env.REACT_APP_API_URL + "myclass/api/Lms_Add_Logo_File/", + { + method: 'POST', + body: formData, + } + ) + .then((response) => response.json()) + .then((result) => { + //console.log('Success:', result['message']); + + if (String(result['status']) === String("true")) { + setSend_logo_Img_api("true"); + alert(" La mise à jour du logo a été correctement effectuée. ") + + } + else { + setSend_logo_Img_api("false"); + setSend_logo_Img_message(result['message']); + } + setLoading(false); + + }) + .catch((error) => { + console.error('Error:', result); + setSend_logo_Img_api("false"); + setSend_logo_Img_message(result['message']); + setLoading(false); + }); + + } + + + const changeHandler2_logo = (event) => { clear_message(); hiddenFileInput_logo.current.click(); @@ -288,7 +311,7 @@ function HebergementLms(props) { //image/png if (String(file_type) !== "image/png") { - alert("Le fichier n'est pas au formation PNG"); + alert("Le fichier n'est pas au format PNG"); return; } @@ -313,44 +336,9 @@ function HebergementLms(props) { setbg_file_name(event.target.files[0].name); setimg_bg_file(URL.createObjectURL(event.target.files[0])); + setimg_bg_file2(event.target.files[0]); - const formData = new FormData(); - formData.append('File', fileUploaded); - //formData.append('token', 'K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA'); - const stored_cookie = getCookie('tokenmysypart'); - formData.append("token", stored_cookie); - - - fetch( - process.env.REACT_APP_API_URL + "myclass/api/Lms_Add_BG_File/", - { - method: 'POST', - body: formData, - } - ) - .then((response) => response.json()) - .then((result) => { - //console.log('Success:', result['message']); - - if (String(result['status']) === String("true")) { - sethandleSubmission_logo_api("true"); - - } - else { - sethandleSubmission_bg_api("false"); - sethandleSubmission_bg_message(result['message']); - } - setLoading(false); - - }) - .catch((error) => { - console.error('Error:', result); - sethandleSubmission_logo_api("false"); - sethandleSubmission_logo_message(result['message']); - setLoading(false); - }); - } else { sethandleSubmission_bg_message(" La taille de l'image est incorrecte"); sethandleSubmission_bg_api("false"); @@ -367,6 +355,55 @@ function HebergementLms(props) { }; + const [SendBackground_Img_api, setSendBackground_Img_api] = useState(); + const [SendBackground_Img_result, setSendBackground_Img_result] = useState(); + const [SendBackground_Img_message, setSendBackground_Img_message] = useState(); + + function SendBackground_Img() { + clear_message(); + + setLoading(true); + + const formData = new FormData(); + formData.append('File', img_bg_file2); + //formData.append('token', 'K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA'); + const stored_cookie = getCookie('tokenmysypart'); + formData.append("token", stored_cookie); + + + fetch( + process.env.REACT_APP_API_URL + "myclass/api/Lms_Add_BG_File/", + { + method: 'POST', + body: formData, + } + ) + .then((response) => response.json()) + .then((result) => { + //console.log('Success:', result['message']); + + if (String(result['status']) === String("true")) { + setSendBackground_Img_api("true"); + alert(" L'image bannière a été correctement mise à jour") + + } + else { + setSendBackground_Img_api("false"); + setSendBackground_Img_message(result['message']); + } + setLoading(false); + + }) + .catch((error) => { + console.error('Error:', result); + setSendBackground_Img_api("false"); + setSendBackground_Img_message(result['message']); + setLoading(false); + }); + + + }; + const changeHandler2_bg = (event) => { clear_message(); hiddenFileInput_bg.current.click(); @@ -376,6 +413,8 @@ function HebergementLms(props) { function clear_message() { sethandleSubmission_logo_message(); sethandleSubmission_logo_api(); + setSendBackground_Img_api(); + setSendBackground_Img_message(); } const [submenu, setsubmenu] = useState("design"); @@ -404,10 +443,13 @@ function HebergementLms(props) { } {String(menu) === String("default") &&
-

Espace de parametrage de l'environnement d'hébergement

+

Parametrage de l'environnement LMS


} + + +
@@ -477,8 +519,9 @@ function HebergementLms(props) { "minWidth": "15rem", "color": "black", "width": "auto" }} id='menu_import_formation' name='menu_import_formation'>Choisir une image  
- (Le logo doit être de taille 250 x 70 px et au format PNG) +
+ {logo_file_name && } } - {String(handleSubmission_logo_api) === "false" && - } + {String(Send_logo_Img_api) === "true" &&
La mise à jour a été correctement faite
} + + {String(Send_logo_Img_api) === "false" &&
{Send_logo_Img_message}
} +
@@ -512,7 +557,7 @@ function HebergementLms(props) {
- @@ -536,9 +581,11 @@ function HebergementLms(props) { "background": "#c8cfd5", "minWidth": "15rem", "color": "black", "width": "auto" }} - id='menu_import_formation' name='menu_import_formation'>Choisir une image GB  
- (Le BG doit être de taille 1920 x 195 px et au format PNG) + id='menu_import_formation' name='menu_import_formation'>Choisir une image bannière  
+
+ + {bg_file_name && } } + + {String(SendBackground_Img_api) === "true" &&
La mise à jour a été correctement faite
} + + {String(SendBackground_Img_api) === "false" &&
{SendBackground_Img_message}
} + +
@@ -568,7 +621,7 @@ function HebergementLms(props) {
- diff --git a/src/components/Partner.js b/src/components/Partner.js index 39f60f0..5468f9e 100644 --- a/src/components/Partner.js +++ b/src/components/Partner.js @@ -14,6 +14,11 @@ import PartenairStat from "./PartenairStat"; import { Helmet } from "react-helmet"; import bannerimg2 from "../mysy_img/MYSY-LOGO-BLUE.png"; import logowhite from "../mysy_img/MYSY-LOGO-WHITE.png"; + +import downarrow from "../mysy_img/downarrow.png"; +import uparrow from "../mysy_img/uparrow.png"; + + import Footer from "./Fotter"; import { confirmAlert } from 'react-confirm-alert'; // Import import { useCookies } from "react-cookie"; @@ -616,7 +621,7 @@ const Partner = (props) => {
} - +
{parntername && {parntername} - {String(partnerPackService).toUpperCase()} ({parnternbformation})} {!parntername && Partenaire }

@@ -652,14 +657,15 @@ const Partner = (props) => {

- {String(deplie_hebergement) === "1" &&
- Espace Hébergement (++) + {String(deplie_hebergement) === "1" &&
+ Espace Hébergement
}
- {String(deplie_hebergement) !== "1" &&
- Espace Hébergement (--) + + {String(deplie_hebergement) !== "1" &&
+ Espace Hébergement
{String(has_partner_lms_url) === "1" &&
{ @@ -668,12 +674,12 @@ const Partner = (props) => { partner_lms_url, '_blank' ); - }}>  MON HEBERGEMENT
} + }}>   MON HEBERGEMENT
} {String(has_partner_lms_url) === "1" &&

- {String(menu) !== "statistique" &&
  CONFIGURATION
} - {String(menu) === "statistique" &&
   Configuration
} + {String(menu) !== "statistique" &&
   CONFIGURATION
} + {String(menu) === "statistique" &&
    CONFIGURATION
}
}
} diff --git a/src/mysy_img/downarrow.png b/src/mysy_img/downarrow.png new file mode 100644 index 0000000000000000000000000000000000000000..8b512712098c4701647e8454b4b74e11d846af8f GIT binary patch literal 2073 zcmb`Gc~nzJ6o==%yevd1)S^@|7$rg}WFxE*S;G=37%&BFYawJ;ATbFBuwqQnic~;F zWbJXIQjtxIRcM7Oifd6^KoJ$RvWb9JORY!;+Me3=4^Q8D_uVshe)pUE?#yHe!h%f6 zv&aAdQ+_Zn0(#bjk#O)Ed()&AI!x{x>I*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YJ9{{}u{azz&e|RI+o9x*mpDt5sj$s#hI5FYUr&ARH8>so z()7C#d>~WCOJNHb%p`TZN+i)T#Uf3-N~_jLS1FlN1>eop-<8RB;F3n0UVmG66pzj92LwYy1Vz-i|Z? literal 0 HcmV?d00001 diff --git a/src/mysy_img/menu_open.png b/src/mysy_img/menu_open.png new file mode 100644 index 0000000000000000000000000000000000000000..31113f012c2541353a3eb127fcd117416a26ab78 GIT binary patch literal 1299 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I3?%1nZ+ru!SkfJR9T^xl_H+M9WCijWi-X*q z7}lMWc?skwBzpw;GB8xBF)%c=FfjZA3N^f7U???UV0e|lz+g3lfkC`r&aOZkpv3Lj*ZqFSM z6K%!#=ce;));%iwR1c`lIH+-0Q()#1t)9Q%^Vve4<^z?Skf-3%+9KOGd(+<3KwrPqMZaHMoDAg$^$Z}lc7~9;0Mk)UVDOs)) z&ZQLRY^prF%6{GKt0I1`)2&4=uKg);KH=vjOP%^c&eQR++|N#1)E9G~z8~6gm{Cir zZei5npHzWHmz%9-MeqW zfqP6GwwHPC^zSg(vnPn>PHK$AJ+`FW6e*q@iM|DFQQ98@bDj4xnf9=5pPV`4hIAE| z>7Mh`*sj@yY)t&OG3VZci2qkEUjOcuIXgz@*!lHLf(`4z*Q}ar!tO9^aix~`;|KF{TrUq=Ml~qP+W_m^mgQ=m>feQhFKsDk>=0MeiXQq^7 zfRxD8Fy8?xkwjABo0*$hQdyA70CtsrL0-E3rZ7J=b9_U9su&DSElf;|jVz2!?Om#N z0+k3OnG>8@mC9hEXK3i{!lvI6;x#X;^) z4C~IxyaaL-l0AZa85pY67#JE_7#My5g&JNkFq8sKd6mGxU^Rn*LA+qju0R{0#DoB! z5LX~Qc)TZKN9?;Kri|Bb z;^Q(ud`gb|Q4o=m{c;-n{C}ylffLLRZp&F@BH;IBaX9w z`Ddx{rE}4IhF@nF$j@wSY~fcrYv5PRbHx_uLDdr1h?11Vl2ohYqEsNoU}Ruqple{P zY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