2026-04-03 14:42:43 +02:00
< ? php use App\Domain\Recettes\Recette ;
use App\Infrastructure\View as V ; ?>
< div class = " main-body " >
< div class = " content " >
< div class = " recette-add-form-all " >
< form id = " recette-form-complete " class = " recette-form recette-form-add " action = " /api/recettes/create " method = " POST " >
2026-04-07 11:49:07 +02:00
< legend >< h1 > Nouvelle Recette : </ h1 ></ legend >
2026-04-03 14:42:43 +02:00
< div class = " recette-form-group form-group " >
< label for = " nom " > Titre : </ label >
< input type = " text " class = " form-control " id = " recette-form-nom " name = " nom " placeholder = " Titre de votre recette " >
</ div >
< div class = " recette-form-group form-group " >
< label for = " temps " > Temps ( en min ) : </ label >
< input type = " number " class = " form-control " id = " recette-form-temps " name = " temps " placeholder = " Temps de préparation " >
</ div >
< div class = " recette-form-group form-group " >
< label for = " image " > Photo du plat : </ label >
2026-04-07 11:49:07 +02:00
< input type = " file " class = " form-control " id = " recette-form-photo " name = " image " placeholder = " ajouter votre image " accept = " image/jpeg, image/png " >
2026-04-03 14:42:43 +02:00
</ div >
< div class = " recette-form-group form-group " id = " recette-form-div-ingr " >
< label for = " ingr " > Ingredients </ label >
< select multiple class = " form-control " id = " recette-form-ingr " name = " ingr " placeholder = " Ingredients " >
< ? php foreach ( V :: arg ( 'ingredients' ) as $ingr ) : ?>
< option value = " <?php echo $ingr->getID (); ?> " >< ? php echo $ingr -> nom_ingredient ; ?> </option>
< ? php endforeach ; ?>
</ select >
</ div >
< div class = " recette-form-group form-group " id = " recette-form-div-tag " >
< label for = " tag " > Tag </ label >
< select multiple class = " form-control " id = " recette-form-tag " name = " tag " placeholder = " Tag " >
< ? php foreach ( V :: arg ( 'tags' ) as $tag ) : ?>
< option value = " <?php echo $tag->getID (); ?> " >< ? php echo $tag -> nom_tag ; ?> </option>
< ? php endforeach ; ?>
</ select >
</ div >
< div class = " recette-form-group form-group " id = " recette-form-div-desc " >
< label for = " description " > Description </ label >
2026-04-07 11:49:07 +02:00
< textarea type = " texte " class = " form-control " id = " recette-form-description " name = " description " placeholder = " Markdown supporté pour les titres de niveau 1,2, le gras ainsi que l'italique " ></ textarea >
2026-04-03 14:42:43 +02:00
</ div >
2026-04-07 11:49:07 +02:00
< button type = 'submit' class = 'btn btn-primary' > Envoyer la recette </ button >
2026-04-03 14:42:43 +02:00
</ form >
< div class = " recette-form-add-additional " >
< form id = " recette-form-ingr-add " class = " recette-form recette-form-add-ingr " action = " " method = " POST " >
2026-04-07 11:49:07 +02:00
< legend >< h2 > Nouvel Ingrédient :</ h2 ></ legend >
2026-04-03 14:42:43 +02:00
< div class = " recette-form-group form-group " >
< label for = " name " > Nom de l ' Ingrédient </ label >
< input type = " texte " class = " form-control " id = " recette-form-ingr-nom " name = " name " placeholder = " Nom de l'ingrédient " value = " " >
</ div >
< div class = " recette-form-group form-group " >
< label for = " image " > Photo de l ' Ingrédient </ label >
< input type = " file " class = " form-control " id = " recette-form-ingr-photo " name = " image " >
</ div >
< button id = " submit-ingr " type = 'submit' class = 'btn btn-primary' > Confirmer </ button >
< div id = " recette-form-div-err-ingr " class = " err " >
Erreur
</ div >
</ form >
< form id = " recette-form-tag-add " class = " recette-form recette-form-add-tag " action = " " method = " POST " >
2026-04-07 11:49:07 +02:00
< legend >< h2 > Nouveau Tag : </ h2 ></ legend >
2026-04-03 14:42:43 +02:00
< div class = " recette-form-group form-group " >
< label for = " tag " > Tags </ label >
< input type = " text " class = " form-control " id = " recette-form-tag-nom " name = " name " placeholder = " Nom de l'ingrédient " >
</ div >
< button type = 'submit' class = 'btn btn-primary' > Confirmer </ button >
< div id = " recette-form-div-err-tag " class = " err " >
Erreur
</ div >
</ form >
</ div >
</ div >
</ div >
</ div >
< script >
const IS_EDIT = false ; const RECETTE_ID = 0 ;
</ script >
< script src = " <?php V::assetUrl( 'js/form.js' ); ?> " defer ></ script >