recette2
cherif 2025-02-13 17:44:25 +01:00
parent f493bcf751
commit 358a3645f8
1 changed files with 32 additions and 42 deletions

View File

@ -6,7 +6,7 @@ import axios from "axios";
import Box from '@mui/material/Box'; import Box from '@mui/material/Box';
import { useHistory } from "react-router-dom"; import { useHistory } from "react-router-dom";
import { FcIdea } from "react-icons/fc";
import img_loading_spin from "./../mysy_img/mysy_spin_loading.gif"; import img_loading_spin from "./../mysy_img/mysy_spin_loading.gif";
import img_paypal from "./../mysy_img/paypal.png" import img_paypal from "./../mysy_img/paypal.png"
import moment from "moment"; import moment from "moment";
@ -283,17 +283,7 @@ function HebergementLms(props) {
if (parseFloat(img_width) > 130 && parseFloat(img_width) < 260 && if (parseFloat(img_width) > 130 && parseFloat(img_width) < 260 &&
parseFloat(img_height) > 60 && parseFloat(img_height) < 150) { parseFloat(img_height) > 60 && parseFloat(img_height) < 150) {
//console.log(" img_height est = ", img_height, " < à 1500 ");
// Verification que le nom du fichier est alpha numerique
/*var regExp = /^[A-Za-z0-9]+$/;
if (!regExp.test(event.target.files[0].name)) {
sethandleSubmission_logo_message(" Le nom de l'image comporte des caractères non alphanumériques");
sethandleSubmission_logo_api("false");
setLoading(false);
return
}*/
if (String(event.target.files[0].name).length > 50) { if (String(event.target.files[0].name).length > 50) {
@ -530,7 +520,7 @@ function HebergementLms(props) {
let file_size = event.target.files[0].size; let file_size = event.target.files[0].size;
let file_type = event.target.files[0].type; let file_type = event.target.files[0].type;
console.log("file_size = ", file_size, " file_type = ", file_type, " naturalWidth = ", fileUploaded.naturalWidth); // console.log("file_size = ", file_size, " file_type = ", file_type, " naturalWidth = ", fileUploaded.naturalWidth);
if (file_size > 1000000) { if (file_size > 1000000) {
alert("Le fichier ne doit pas dépasser un 1 Méga octets"); alert("Le fichier ne doit pas dépasser un 1 Méga octets");
return; return;
@ -557,17 +547,10 @@ function HebergementLms(props) {
//console.log(" img_width = ", img_width); //console.log(" img_width = ", img_width);
_URL.revokeObjectURL(objectUrl); _URL.revokeObjectURL(objectUrl);
if (parseFloat(img_width) > 1500 && parseFloat(img_width) < 1930 && if (parseFloat(img_width) > 1500 && parseFloat(img_width) < 1930 &&
parseFloat(img_height) > 150 && parseFloat(img_height) < 195) { parseFloat(img_height) > 150 && parseFloat(img_height) < 250) {
//console.log(" img_height est = ", img_height, " < à 1500 "); //console.log(" img_height est = ", img_height, " < à 1500 ");
// Verification que le nom du fichier est alpha numerique
/*var regExp = /^[A-Za-z0-9]+$/;
if (!regExp.test(event.target.files[0].name)) {
sethandleSubmission_bg_message(" Le nom de l'image comporte des caractères non alphanumériques");
sethandleSubmission_bg_api("false");
setLoading(false);
return
}*/
if (String(event.target.files[0].name).length > 50) { if (String(event.target.files[0].name).length > 50) {
@ -826,7 +809,7 @@ function HebergementLms(props) {
</div>} </div>}
<div style={{ "width": "250px", textAlign:'left' , "marginTop": "1rem", marginBottom: '1rem' }} onClick={(e) => { <div style={{ "width": "250px", textAlign: 'left', "marginTop": "1rem", marginBottom: '1rem' }} onClick={(e) => {
e.preventDefault(); e.preventDefault();
}}> }}>
@ -957,7 +940,18 @@ Le nom du fichier ne contient que des caractères alphanumériques </i>">
<div className="div_row" style={{ "border": "None" }}> <div className="div_row" style={{ "border": "None" }}>
&nbsp; &nbsp;
</div> </div>
{<div className="div_row" style={{ "border": "None", "color": "orange", "textAlign": "center" }}> <div className="div_row" style={{ "border": "None", "color": "orange", "textAlign": "center" }}>
<div className="div_row" style={{ "border": "None" }}>
&nbsp;
<div className="div_row" style={{
"border": "None", "color": "#0000FF", "textAlign": "center", fontFamily: 'DM Sans',
fontSize: '14px'
}}>
<FcIdea style={{ fontSize: '20px' }} /> &nbsp; Pour avoir une meilleure corrélation entre les dimensions du logo et les dimensions de la bannière, il est conseillé de respecter la règle suivante : <br />
<il> Hauteur de la bannière = Hauteur de logo + 100px </il>
</div>
</div>
<div className="div_row_gauche " style={{ "textAlign": 'left', 'marginLeft': '15px' }}> <div className="div_row_gauche " style={{ "textAlign": 'left', 'marginLeft': '15px' }}>
<Button variant="contained" className="btn_modif" onClick={Annule_logo_img}>Annuler <Button variant="contained" className="btn_modif" onClick={Annule_logo_img}>Annuler
@ -972,7 +966,7 @@ Le nom du fichier ne contient que des caractères alphanumériques </i>">
</div> </div>
</div>} </div>
<div className="div_row" style={{ "border": "None" }}> <div className="div_row" style={{ "border": "None" }}>
&nbsp; &nbsp;
</div> </div>
@ -991,7 +985,7 @@ Le nom du fichier ne contient que des caractères alphanumériques </i>">
</Button>*/} </Button>*/}
</div>} </div>}
<div style={{ "width": "250px", marginLeft:'auto', marginRight:'auto' , "marginTop": "1rem", marginBottom: '1rem' }} onClick={(e) => { <div style={{ "width": "250px", marginLeft: 'auto', marginRight: 'auto', "marginTop": "1rem", marginBottom: '1rem' }} onClick={(e) => {
e.preventDefault(); e.preventDefault();
}}> }}>
@ -1077,22 +1071,7 @@ Le nom du fichier ne contient que des caractères alphanumériques </i>">
&nbsp; &nbsp;
</div> </div>
{/*
<Button variant="outlined" onClick={changeHandler2_bg} className="detail_class_submenu" style={{
"background": "#c8cfd5",
"minWidth": "15rem", "color": "black", "width": "auto"
}}
id='menu_import_formation' name='menu_import_formation'>Choisir une image bannière &nbsp; <br />
</Button><br />
<nav className="koUpdateData" style={{ "color": "orange" }}>
<Tooltip className="tooltip_css" id="tooltip_1" />
<a data-tooltip-id="tooltip_1" data-tooltip-html="Respecter ces critères vous aide à avoir un meilleur affichage">
<i> Important : Taille de la bannière : longueur entre 1500px et 1930px et largeur entre 150px et 195px, au format PNG <br />
Le nom du fichier ne contient que des caractères alphanumériques </i>
</a>
</nav>*/}
{bg_file_name && <nav className="okUpdateData"><i>{bg_file_name}</i></nav>} {bg_file_name && <nav className="okUpdateData"><i>{bg_file_name}</i></nav>}
<input type="file" <input type="file"
@ -1117,11 +1096,22 @@ Le nom du fichier ne contient que des caractères alphanumériques </i>">
<br /> <br />
<div className="div_row" style={{ "border": "None" }}>
&nbsp;
</div>
<div className="div_row"> <div className="div_row">
<div className="div_row" style={{ "border": "None" }}> <div className="div_row" style={{ "border": "None" }}>
&nbsp; &nbsp;
<div className="div_row" style={{
"border": "None", "color": "#0000FF", "textAlign": "center", fontFamily: 'DM Sans',
fontSize: '14px'
}}>
<FcIdea style={{ fontSize: '20px' }} /> &nbsp; Pour avoir une meilleure corrélation entre les dimensions du logo et les dimensions de la bannière, il est conseillé de respecter la règle suivante : <br />
<il> Hauteur de la bannière = Hauteur de logo + 100px </il>
</div>
</div> </div>
{<div className="div_row" style={{ "border": "None", "color": "orange", "textAlign": "center" }}> <div className="div_row" style={{ "border": "None", "color": "orange", "textAlign": "center" }}>
<div className="div_row_gauche " style={{ "textAlign": 'left', 'marginLeft': '15px' }}> <div className="div_row_gauche " style={{ "textAlign": 'left', 'marginLeft': '15px' }}>
<Button variant="contained" className="btn_modif" onClick={Annule_bg_img}>Annuler <Button variant="contained" className="btn_modif" onClick={Annule_bg_img}>Annuler
@ -1135,7 +1125,7 @@ Le nom du fichier ne contient que des caractères alphanumériques </i>">
</div> </div>
</div>} </div>
<div className="div_row" style={{ "border": "None" }}> <div className="div_row" style={{ "border": "None" }}>
&nbsp; &nbsp;
</div> </div>