Ajout des strates dans les moments | Ajout des pictos et des valeurs nutritionelles dans les produits | Remplacement de tout les CKEditor par le composant VueJS | Ajout des anciennes données lors du retour au moment d'une création à cause d'une erreur (ex : si j'avais entré "Test" dans titre, il sera toujours la après que l'erreur soit affichée) pour tout les BO
This commit is contained in:
parent
88c30318c4
commit
708349af56
43 changed files with 3496 additions and 2970 deletions
|
|
@ -25,6 +25,13 @@ class ArticlesController extends Controller
|
|||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$request->validate([
|
||||
'title' => 'required|max:100',
|
||||
'picture' => 'required|image|mimes:jpeg,png,jpg|max:2048|dimensions:width=340,height=340',
|
||||
'picture_r' => 'required|image|mimes:jpeg,png,jpg|max:2048|dimensions:width=780,height=508',
|
||||
'content' => 'required',
|
||||
]);
|
||||
|
||||
$title = $request->title;
|
||||
$slug = Str::slug($title);
|
||||
$picture = $request->picture;
|
||||
|
|
@ -46,13 +53,6 @@ class ArticlesController extends Controller
|
|||
]);
|
||||
}
|
||||
|
||||
$request->validate([
|
||||
'title' => 'required|max:100',
|
||||
'picture' => 'required|image|mimes:jpeg,png,jpg|max:2048|dimensions:width=340,height=340',
|
||||
'picture_r' => 'required|image|mimes:jpeg,png,jpg|max:2048|dimensions:width=780,height=508',
|
||||
'content' => 'required|max:8000',
|
||||
]);
|
||||
|
||||
$imageName = Str::slug($title) .'-le-gaulois-' . date('d-m-Y') . '.' . $picture->extension();
|
||||
$picture->move(public_path('images/articles/' . date('Y') . '/' . date('m')), $imageName);
|
||||
$imageName_r = Str::slug($title) .'-le-gaulois-' . date('d-m-Y') . '_r.' . $picture_r->extension();
|
||||
|
|
@ -98,6 +98,11 @@ class ArticlesController extends Controller
|
|||
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
$request->validate([
|
||||
'title' => 'required|max:100',
|
||||
'content' => 'required',
|
||||
]);
|
||||
|
||||
$title = $request->title;
|
||||
$slug = Str::slug($title);
|
||||
$picture = $request->picture;
|
||||
|
|
@ -119,11 +124,6 @@ class ArticlesController extends Controller
|
|||
]);
|
||||
}
|
||||
|
||||
$request->validate([
|
||||
'title' => 'required|max:100',
|
||||
'content' => 'required|max:8000',
|
||||
]);
|
||||
|
||||
if ($picture !== NULL && $picture_r !== NULL){
|
||||
$request->validate([
|
||||
'picture' => 'image|mimes:jpeg,png,jpg|max:2048|dimensions:width=340,height=340',
|
||||
|
|
|
|||
|
|
@ -6,9 +6,11 @@ use App\Http\Controllers\Controller;
|
|||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Str;
|
||||
use App\Models\Moments;
|
||||
use App\Models\Products;
|
||||
use App\Models\MomentStrates;
|
||||
use App\Models\Recipes;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use Symfony\Component\HttpFoundation\File\File;
|
||||
|
||||
class MomentsController extends Controller
|
||||
{
|
||||
|
|
@ -38,14 +40,30 @@ class MomentsController extends Controller
|
|||
public function create()
|
||||
{
|
||||
$r = Recipes::all();
|
||||
$strates = json_encode([]);
|
||||
return view('bo.moments.create', compact('r'))
|
||||
->with('colors', $this->colors)
|
||||
->with('featuredTypes', $this->featuredTypes)
|
||||
->with('strates', $strates)
|
||||
;
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$request->validate([
|
||||
'title' => 'required|max:150',
|
||||
'description' => 'required|max:400',
|
||||
'color' => 'required|max:7',
|
||||
'picture' => 'image|mimes:jpeg,png,jpg|max:2048|dimensions:width=750,height=400',
|
||||
'picture_bg' => 'image|mimes:jpeg,png,jpg|max:2048|dimensions:width=1200,height=750',
|
||||
'picture_bg_r' => 'image|mimes:jpeg,png,jpg|max:2048|dimensions:width=500,height=300',
|
||||
'featured_title' => 'required|max:150',
|
||||
'voucher_picture' => 'image|mimes:jpeg,png,jpg|max:2048|dimensions:width=580,height=330',
|
||||
]);
|
||||
$featuredText = $request->featured_text;
|
||||
if (empty($featuredText))
|
||||
return back()->withInput()->withErrors("Le texte de la remontée est recquis.");
|
||||
|
||||
$title = $request->title;
|
||||
$description = $request->description;
|
||||
$color = $request->color;
|
||||
|
|
@ -56,24 +74,12 @@ class MomentsController extends Controller
|
|||
$starMoment = $request->star_moment === null ? 0 : 1;
|
||||
$status = 0;
|
||||
$featuredTitle = $request->featured_title;
|
||||
$featuredText = $request->featured_text;
|
||||
$featuredType = $request->featured_type;
|
||||
$featuredIds = $request->featured_ids;
|
||||
$featuredStatus = $request->featured_status === null ? 0 : 1;
|
||||
$voucherPicture = $request->voucher_picture;
|
||||
$voucherStatus = $request->voucher_status === null ? 0 : 1;
|
||||
|
||||
$request->validate([
|
||||
'title' => 'required|max:150',
|
||||
'description' => 'required|max:400',
|
||||
'color' => 'required|max:7',
|
||||
'picture' => 'image|mimes:jpeg,png,jpg|max:2048|dimensions:width=750,height=400',
|
||||
'picture_bg' => 'image|mimes:jpeg,png,jpg|max:2048|dimensions:width=1200,height=750',
|
||||
'picture_bg_r' => 'image|mimes:jpeg,png,jpg|max:2048|dimensions:width=500,height=300',
|
||||
'featured_title' => 'required|max:150',
|
||||
'featured_text' => 'required|max:4000',
|
||||
'voucher_picture' => 'image|mimes:jpeg,png,jpg|max:2048|dimensions:width=580,height=330',
|
||||
]);
|
||||
$strates = json_decode($request->strates);
|
||||
|
||||
$featuredIdsString = '';
|
||||
foreach ($featuredIds as $featuredId) {
|
||||
|
|
@ -109,6 +115,52 @@ class MomentsController extends Controller
|
|||
$m->voucher_status = $voucherStatus;
|
||||
$m->save();
|
||||
|
||||
$compteur = 0;
|
||||
foreach($strates as $strate) {
|
||||
$validator = Validator::make(get_object_vars($strate), [
|
||||
'title' => 'required|max:255',
|
||||
'picture' => 'required',
|
||||
'content' => 'required',
|
||||
]);
|
||||
|
||||
if ($validator->fails()) {
|
||||
$m->delete();
|
||||
return back()->with('strates', json_encode($strates))->withInput()->withErrors("Les données de la strate " . $compteur . " sont incorrects, veuillez réessayer.");
|
||||
}
|
||||
|
||||
$compteur++;
|
||||
$s = new MomentStrates();
|
||||
$s->moment_id = $m->id;
|
||||
$s->title = $strate->title;
|
||||
|
||||
// Gestion de l'image
|
||||
$image = base64_decode(preg_replace('#^data:image/\w+;base64,#i', '', $strate->picture));
|
||||
$extension = explode('/', mime_content_type($strate->picture))[1];
|
||||
if (!in_array($extension, ['png', 'jpg', 'jpeg'])) {
|
||||
$m->delete();
|
||||
return back()->with('strates', json_encode($strates))->withInput()->withErrors("L'image de la strate " . $compteur . " n'est pas au bon format (formats acceptés : png, jpg, jpeg), veuillez réessayer.");
|
||||
}
|
||||
// Création d'un fichier temporaire pour ensuite le move si il est ok
|
||||
$tmpFilePath=sys_get_temp_dir().'/'.uniqid();
|
||||
file_put_contents($tmpFilePath, $image);
|
||||
$tmpFile = new File($tmpFilePath);
|
||||
$imgSize = getimagesize($tmpFilePath);
|
||||
if ($imgSize[0] >= 220 || $imgSize[1] >= 220) {
|
||||
$m->delete();
|
||||
return back()->with('strates', json_encode($strates))->withInput()->withErrors("L'image de la strate " . $compteur . " a des dimensions incorrects, veuillez réessayer.");
|
||||
}
|
||||
$imageName = 'strate' . $compteur . '.' . $extension;
|
||||
$tmpFile->move(public_path("images/moments/$m->id"), $imageName);
|
||||
|
||||
$s->picture = 'images/moments/' . $m->id . '/' . $imageName;
|
||||
$s->picture_label = $strate->picture_label;
|
||||
$s->content = $strate->content;
|
||||
$s->button_label = $strate->button_label;
|
||||
$s->button_link = $strate->button_link;
|
||||
$s->status = $strate->status === null ? 0 : 1;
|
||||
$s->save();
|
||||
}
|
||||
|
||||
return redirect()->route('bo.moments.index');
|
||||
}
|
||||
|
||||
|
|
@ -116,14 +168,26 @@ class MomentsController extends Controller
|
|||
{
|
||||
$m = Moments::findOrFail($id);
|
||||
$r = Recipes::all();
|
||||
$strates = count($m->strates) > 0 ? json_encode($m->strates) : json_encode([]);
|
||||
return view('bo.moments.edit', compact('m', 'r'))
|
||||
->with('colors', $this->colors)
|
||||
->with('featuredTypes', $this->featuredTypes)
|
||||
->with('strates', $strates)
|
||||
;
|
||||
}
|
||||
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
$request->validate([
|
||||
'title' => 'required|max:150',
|
||||
'description' => 'required|max:400',
|
||||
'color' => 'required|max:7',
|
||||
'featured_title' => 'required|max:150',
|
||||
]);
|
||||
|
||||
if ($request->featured_text === null)
|
||||
return back()->withInput()->withErrors("Le champ texte de la remontée est obligatoire.");
|
||||
|
||||
$title = $request->title;
|
||||
$description = $request->description;
|
||||
$color = $request->color;
|
||||
|
|
@ -140,15 +204,7 @@ class MomentsController extends Controller
|
|||
$featuredStatus = $request->featured_status === null ? 0 : 1;
|
||||
$voucherPicture = $request->voucher_picture;
|
||||
$voucherStatus = $request->voucher_status === null ? 0 : 1;
|
||||
|
||||
$request->validate([
|
||||
'title' => 'required|max:150',
|
||||
'description' => 'required|max:400',
|
||||
'color' => 'required|max:7',
|
||||
'featured_title' => 'required|max:150',
|
||||
'featured_text' => 'required|max:4000',
|
||||
]);
|
||||
|
||||
$strates = json_decode($request->strates);
|
||||
|
||||
if ($picture !== null) {
|
||||
$request->validate([
|
||||
|
|
@ -226,6 +282,62 @@ class MomentsController extends Controller
|
|||
if ($voucherPicture !== null)
|
||||
$m->voucher_picture = date('Y') . '/' . date('m') . '/' . $imageNameVoucher;
|
||||
$m->voucher_status = $voucherStatus;
|
||||
|
||||
$compteur = 0;
|
||||
$ids = [];
|
||||
foreach($strates as $strate) {
|
||||
$validator = Validator::make(get_object_vars($strate), [
|
||||
'title' => 'required|max:255',
|
||||
'content' => 'required',
|
||||
]);
|
||||
|
||||
if ($validator->fails())
|
||||
return back()->with('strates', json_encode($strates))->withInput()->withErrors("Les données de la strate " . $compteur . " sont incorrects, veuillez réessayer.");
|
||||
|
||||
$compteur++;
|
||||
if ($strate->id !== null) {
|
||||
$s = MomentStrates::find($strate->id);
|
||||
$ids[] = $strate->id;
|
||||
} else
|
||||
$s = new MomentStrates();
|
||||
$s->moment_id = $m->id;
|
||||
$s->title = $strate->title;
|
||||
|
||||
// Gestion de l'image
|
||||
if (($strate->id !== null && MomentStrates::find($strate->id)->picture !== $strate->picture) || ($strate->id === null && $strate->picture !== null)) {
|
||||
$image = base64_decode(preg_replace('#^data:image/\w+;base64,#i', '', $strate->picture));
|
||||
$extension = explode('/', mime_content_type($strate->picture))[1];
|
||||
if (!in_array($extension, ['png', 'jpg', 'jpeg']))
|
||||
return back()->with('strates', json_encode($strates))->withInput()->withErrors("L'image de la strate " . $compteur . " n'est pas au bon format (formats acceptés : png, jpg, jpeg), veuillez réessayer.");
|
||||
// Création d'un fichier temporaire pour ensuite le move si il est ok
|
||||
$tmpFilePath=sys_get_temp_dir().'/'.uniqid();
|
||||
file_put_contents($tmpFilePath, $image);
|
||||
$tmpFile = new File($tmpFilePath);
|
||||
$imgSize = getimagesize($tmpFilePath);
|
||||
if ($imgSize[0] >= 220 || $imgSize[1] >= 220)
|
||||
return back()->with('strates', json_encode($strates))->withInput()->withErrors("L'image de la strate " . $compteur . " a des dimensions incorrects, veuillez réessayer.");
|
||||
$imageName = 'strate' . $compteur . '.' . $extension;
|
||||
$tmpFile->move(public_path("images/moments/$m->id"), $imageName);
|
||||
$s->picture = 'images/moments/' . $m->id . '/' . $imageName;
|
||||
}
|
||||
|
||||
$s->picture_label = $strate->picture_label;
|
||||
$s->content = $strate->content;
|
||||
$s->button_label = $strate->button_label;
|
||||
$s->button_link = $strate->button_link;
|
||||
$s->status = $strate->status === null ? 0 : 1;
|
||||
$s->save();
|
||||
}
|
||||
|
||||
if (count($ids) > 0) {
|
||||
$idsExists = [];
|
||||
foreach ($m->strates as $strateExist)
|
||||
$idsExists[] = $strateExist->id;
|
||||
foreach ($idsExists as $idStrate)
|
||||
if (!in_array($idStrate, $ids))
|
||||
$m->strates()->find($idStrate)->delete();
|
||||
}
|
||||
|
||||
$m->save();
|
||||
|
||||
// Mise en cache du moment si il est publié car c'est le dernier mis à jour obligatoirement
|
||||
|
|
@ -249,6 +361,16 @@ class MomentsController extends Controller
|
|||
if (file_exists(public_path('images/moments/') . $m->picture_bg_r))
|
||||
unlink(public_path('images/moments/') . $m->picture_bg_r);
|
||||
|
||||
foreach($m->strates as $strate) {
|
||||
if (file_exists(public_path() . '/' . $strate->picture))
|
||||
unlink(public_path() . '/' . $strate->picture);
|
||||
}
|
||||
|
||||
if (count($m->strates) > 0) {
|
||||
rmdir(public_path('images/moments/') . $m->id);
|
||||
$m->strates()->delete();
|
||||
}
|
||||
|
||||
$m->delete();
|
||||
|
||||
return redirect()->route('bo.moments.index');
|
||||
|
|
|
|||
|
|
@ -9,10 +9,10 @@ use App\Models\Products;
|
|||
use App\Models\ProductPictograms;
|
||||
use App\Models\Ranges;
|
||||
use App\Models\MeatTypes;
|
||||
use App\Models\Moments;
|
||||
use App\Models\Recipes;
|
||||
use App\Models\SalesFamilies;
|
||||
use App\Models\Countries;
|
||||
use App\Models\IncoNutritionalValues;
|
||||
use App\Models\Societies;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
|
|
@ -26,9 +26,13 @@ class ProductsController extends Controller
|
|||
|
||||
public function create()
|
||||
{
|
||||
// TODO : Ajouter les INCO a passer à la vue et les valeurs nutritionelles
|
||||
// Limitation aux champs dont on a besoin sur certaines requêtes pour ne pas surcharger ces dernières
|
||||
$pictograms = ProductPictograms::all();
|
||||
$pictosDatas = [];
|
||||
foreach ($pictograms as $picto)
|
||||
$pictosDatas[] = ['id' => $picto->id, 'src' => '/images/pictos/' . $picto->picture, 'alt' => $picto->name];
|
||||
$pictosSelected = [];
|
||||
|
||||
$ranges = Ranges::select('id', 'name')->get();
|
||||
$meatTypes = MeatTypes::all();
|
||||
$consumptionTimes = ConsumptionTimes::select('id', 'name')->get();
|
||||
|
|
@ -36,11 +40,31 @@ class ProductsController extends Controller
|
|||
$salesFamilies = SalesFamilies::all();
|
||||
$countries = Countries::all();
|
||||
$societies = Societies::all();
|
||||
return view('bo.products.create', compact('pictograms', 'ranges', 'meatTypes', 'consumptionTimes', 'recipes', 'salesFamilies', 'countries', 'societies'));
|
||||
return view('bo.products.create', compact('pictosDatas', 'pictosSelected', 'ranges', 'meatTypes', 'consumptionTimes', 'recipes', 'salesFamilies', 'countries', 'societies'));
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$request->validate([
|
||||
'name' => 'required|max:255',
|
||||
'portion_description' => 'required|max:255',
|
||||
'picture' => 'image|mimes:jpeg,png,jpg|max:2048|dimensions:width=324,height=328',
|
||||
'tags' => 'max:255',
|
||||
'subtitle' => 'required|max:255',
|
||||
'info1' => 'max:255',
|
||||
'info2' => 'max:255',
|
||||
'description' => 'max:255',
|
||||
'type_portion' => 'max:255',
|
||||
'theoretical_average_weight' => 'max:255',
|
||||
'other_format' => 'max:255',
|
||||
'consumption_label' => 'max:255',
|
||||
'production_season' => 'max:255',
|
||||
'allegations' => 'max:255',
|
||||
'computer_movement_type' => 'max:255',
|
||||
'video_link' => 'max:255',
|
||||
'picture_video' => 'image|mimes:jpeg,png,jpg|max:2048|dimensions:width=324,height=328',
|
||||
]);
|
||||
|
||||
$name = $request->name;
|
||||
$slug = Str::slug($name);
|
||||
$portionDescription = $request->portion_description;
|
||||
|
|
@ -74,31 +98,27 @@ class ProductsController extends Controller
|
|||
$videoLink = $request->video_link;
|
||||
$pictureVideo = $request->picture_video;
|
||||
$status = 0;
|
||||
$pictos = json_decode($request->pictos);
|
||||
|
||||
$request->validate([
|
||||
'name' => 'required|max:255',
|
||||
'portion_description' => 'required|max:255',
|
||||
'picture' => 'image|mimes:jpeg,png,jpg|max:2048|dimensions:width=324,height=328',
|
||||
'tags' => 'max:255',
|
||||
'subtitle' => 'required|max:255',
|
||||
'info1' => 'max:255',
|
||||
'info2' => 'max:255',
|
||||
'description' => 'max:255',
|
||||
'type_portion' => 'max:255',
|
||||
'theoretical_average_weight' => 'max:255',
|
||||
'other_format' => 'max:255',
|
||||
'preparation_advice' => 'max:2000',
|
||||
'ingredients' => 'max:2000',
|
||||
'tips' => 'max:2000',
|
||||
'portion_weight' => 'max:2000',
|
||||
'selling_argument' => 'max:2000',
|
||||
'consumption_label' => 'max:255',
|
||||
'production_season' => 'max:255',
|
||||
'allegations' => 'max:255',
|
||||
'computer_movement_type' => 'max:255',
|
||||
'video_link' => 'max:255',
|
||||
'picture_video' => 'image|mimes:jpeg,png,jpg|max:2048|dimensions:width=324,height=328',
|
||||
]);
|
||||
// Valeurs nutritionelles
|
||||
$energy = $request->energy;
|
||||
$energyPercent = $request->energy_percent;
|
||||
$energyKj = $request->energy_kj;
|
||||
$energyKjPercent = $request->energy_kj_percent;
|
||||
$protein = $request->protein;
|
||||
$proteinPercent = $request->protein_percent;
|
||||
$carbohydrates = $request->carbohydrates;
|
||||
$carbohydratesPercent = $request->carbohydrates_percent;
|
||||
$sugar = $request->sugar;
|
||||
$sugarPercent = $request->sugar_percent;
|
||||
$fat = $request->fat;
|
||||
$fatPercent = $request->fat_percent;
|
||||
$saturatedFattyAcids = $request->saturated_fatty_acids;
|
||||
$saturatedFattyAcidsPercent = $request->saturated_fatty_acids_percent;
|
||||
$dietaryFiber = $request->dietary_fiber;
|
||||
$dietaryFiberPercent = $request->dietary_fiber_percent;
|
||||
$salt = $request->salt;
|
||||
$saltPercent = $request->salt_percent;
|
||||
|
||||
$imageName = $slug . '-le-gaulois.' . $picture->extension();
|
||||
$picture->move(public_path('images/produits/') . date('Y') . '/' . date('m') . '/', $imageName);
|
||||
|
|
@ -150,14 +170,46 @@ class ProductsController extends Controller
|
|||
$p->star = 0;
|
||||
$p->save();
|
||||
|
||||
// Gestion des pictos
|
||||
$pictosIds = [];
|
||||
foreach ($pictos as $picto)
|
||||
$pictosIds[] = $picto->id;
|
||||
$p->pictograms()->sync($pictosIds);
|
||||
|
||||
// Gestion des valeurs nutritionelles
|
||||
$inv = new IncoNutritionalValues();
|
||||
$inv->product_id = $p->id;
|
||||
$inv->energy = $energy;
|
||||
$inv->energy_percent = $energyPercent;
|
||||
$inv->energy_kj = $energyKj;
|
||||
$inv->energy_kj_percent = $energyKjPercent;
|
||||
$inv->protein = $protein;
|
||||
$inv->protein_percent = $proteinPercent;
|
||||
$inv->carbohydrates = $carbohydrates;
|
||||
$inv->carbohydrates_percent = $carbohydratesPercent;
|
||||
$inv->sugar = $sugar;
|
||||
$inv->sugar_percent = $sugarPercent;
|
||||
$inv->fat = $fat;
|
||||
$inv->fat_percent = $fatPercent;
|
||||
$inv->saturated_fatty_acids = $saturatedFattyAcids;
|
||||
$inv->saturated_fatty_acids_percent = $saturatedFattyAcidsPercent;
|
||||
$inv->dietary_fiber = $dietaryFiber;
|
||||
$inv->dietary_fiber_percent = $dietaryFiberPercent;
|
||||
$inv->salt = $salt;
|
||||
$inv->salt_percent = $saltPercent;
|
||||
$inv->save();
|
||||
|
||||
return redirect()->route('bo.products.index');
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
// TODO : Ajouter les INCO a passer à la vue et les valeurs nutritionelles
|
||||
// Limitation aux champs dont on a besoin sur certaines requêtes pour ne pas surcharger ces dernières
|
||||
$pictograms = ProductPictograms::all();
|
||||
$pictosDatas = [];
|
||||
foreach ($pictograms as $picto)
|
||||
$pictosDatas[] = ['id' => $picto->id, 'src' => '/images/pictos/' . $picto->picture, 'alt' => $picto->name];
|
||||
|
||||
$ranges = Ranges::select('id', 'name')->get();
|
||||
$meatTypes = MeatTypes::all();
|
||||
$consumptionTimes = ConsumptionTimes::select('id', 'name')->get();
|
||||
|
|
@ -166,11 +218,39 @@ class ProductsController extends Controller
|
|||
$countries = Countries::all();
|
||||
$societies = Societies::all();
|
||||
$p = Products::findOrFail($id);
|
||||
return view('bo.products.edit', compact('p', 'pictograms', 'ranges', 'meatTypes', 'consumptionTimes', 'recipes', 'salesFamilies', 'countries', 'societies'));
|
||||
$pictosSelected = [];
|
||||
foreach ($p->pictograms as $pictoSelected)
|
||||
$pictosSelected[] = ['id' => $pictoSelected->id, 'src' => '/images/pictos/' . $pictoSelected->picture, 'alt' => $pictoSelected->name];
|
||||
return view('bo.products.edit', compact('p', 'pictosDatas', 'pictosSelected', 'pictograms', 'ranges', 'meatTypes', 'consumptionTimes', 'recipes', 'salesFamilies', 'countries', 'societies'));
|
||||
}
|
||||
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
$request->validate([
|
||||
'name' => 'required|max:255',
|
||||
'portion_description' => 'required|max:255',
|
||||
'picture' => 'image|mimes:jpeg,png,jpg|max:2048|dimensions:width=324,height=328',
|
||||
'tags' => 'max:255',
|
||||
'subtitle' => 'required|max:255',
|
||||
'info1' => 'max:255',
|
||||
'info2' => 'max:255',
|
||||
'description' => 'max:255',
|
||||
'type_portion' => 'max:255',
|
||||
'theoretical_average_weight' => 'max:255',
|
||||
'other_format' => 'max:255',
|
||||
'preparation_advice' => 'max:2000',
|
||||
'ingredients' => 'max:2000',
|
||||
'tips' => 'max:2000',
|
||||
'portion_weight' => 'max:2000',
|
||||
'selling_argument' => 'max:2000',
|
||||
'consumption_label' => 'max:255',
|
||||
'production_season' => 'max:255',
|
||||
'allegations' => 'max:255',
|
||||
'computer_movement_type' => 'max:255',
|
||||
'video_link' => 'max:255',
|
||||
'picture_video' => 'image|mimes:jpeg,png,jpg|max:2048|dimensions:width=324,height=328',
|
||||
]);
|
||||
|
||||
$name = $request->name;
|
||||
$slug = Str::slug($name);
|
||||
$portionDescription = $request->portion_description;
|
||||
|
|
@ -204,31 +284,27 @@ class ProductsController extends Controller
|
|||
$videoLink = $request->video_link;
|
||||
$pictureVideo = $request->picture_video;
|
||||
$status = $request->status === null ? 0 : 1;
|
||||
$pictos = json_decode($request->pictos);
|
||||
|
||||
$request->validate([
|
||||
'name' => 'required|max:255',
|
||||
'portion_description' => 'required|max:255',
|
||||
'picture' => 'image|mimes:jpeg,png,jpg|max:2048|dimensions:width=324,height=328',
|
||||
'tags' => 'max:255',
|
||||
'subtitle' => 'required|max:255',
|
||||
'info1' => 'max:255',
|
||||
'info2' => 'max:255',
|
||||
'description' => 'max:255',
|
||||
'type_portion' => 'max:255',
|
||||
'theoretical_average_weight' => 'max:255',
|
||||
'other_format' => 'max:255',
|
||||
'preparation_advice' => 'max:2000',
|
||||
'ingredients' => 'max:2000',
|
||||
'tips' => 'max:2000',
|
||||
'portion_weight' => 'max:2000',
|
||||
'selling_argument' => 'max:2000',
|
||||
'consumption_label' => 'max:255',
|
||||
'production_season' => 'max:255',
|
||||
'allegations' => 'max:255',
|
||||
'computer_movement_type' => 'max:255',
|
||||
'video_link' => 'max:255',
|
||||
'picture_video' => 'image|mimes:jpeg,png,jpg|max:2048|dimensions:width=324,height=328',
|
||||
]);
|
||||
// Valeurs nutritionelles
|
||||
$energy = $request->energy;
|
||||
$energyPercent = $request->energy_percent;
|
||||
$energyKj = $request->energy_kj;
|
||||
$energyKjPercent = $request->energy_kj_percent;
|
||||
$protein = $request->protein;
|
||||
$proteinPercent = $request->protein_percent;
|
||||
$carbohydrates = $request->carbohydrates;
|
||||
$carbohydratesPercent = $request->carbohydrates_percent;
|
||||
$sugar = $request->sugar;
|
||||
$sugarPercent = $request->sugar_percent;
|
||||
$fat = $request->fat;
|
||||
$fatPercent = $request->fat_percent;
|
||||
$saturatedFattyAcids = $request->saturated_fatty_acids;
|
||||
$saturatedFattyAcidsPercent = $request->saturated_fatty_acids_percent;
|
||||
$dietaryFiber = $request->dietary_fiber;
|
||||
$dietaryFiberPercent = $request->dietary_fiber_percent;
|
||||
$salt = $request->salt;
|
||||
$saltPercent = $request->salt_percent;
|
||||
|
||||
if ($picture !== null && $pictureVideo !== null) {
|
||||
$request->validate([
|
||||
|
|
@ -260,6 +336,35 @@ class ProductsController extends Controller
|
|||
$pictureVideo->move(public_path('images/produits/') . date('Y') . '/' . date('m') . '/', $imageNameVideo);
|
||||
}
|
||||
|
||||
// Gestion des valeurs nutritionelles
|
||||
$inv = $p->inco_nutritional_values;
|
||||
$inv->product_id = $p->id;
|
||||
$inv->energy = $energy;
|
||||
$inv->energy_percent = $energyPercent;
|
||||
$inv->energy_kj = $energyKj;
|
||||
$inv->energy_kj_percent = $energyKjPercent;
|
||||
$inv->protein = $protein;
|
||||
$inv->protein_percent = $proteinPercent;
|
||||
$inv->carbohydrates = $carbohydrates;
|
||||
$inv->carbohydrates_percent = $carbohydratesPercent;
|
||||
$inv->sugar = $sugar;
|
||||
$inv->sugar_percent = $sugarPercent;
|
||||
$inv->fat = $fat;
|
||||
$inv->fat_percent = $fatPercent;
|
||||
$inv->saturated_fatty_acids = $saturatedFattyAcids;
|
||||
$inv->saturated_fatty_acids_percent = $saturatedFattyAcidsPercent;
|
||||
$inv->dietary_fiber = $dietaryFiber;
|
||||
$inv->dietary_fiber_percent = $dietaryFiberPercent;
|
||||
$inv->salt = $salt;
|
||||
$inv->salt_percent = $saltPercent;
|
||||
$inv->save();
|
||||
|
||||
// Gestion des pictos
|
||||
$pictosIds = [];
|
||||
foreach ($pictos as $picto)
|
||||
$pictosIds[] = $picto->id;
|
||||
$p->pictograms()->sync($pictosIds);
|
||||
|
||||
$p->name = $name;
|
||||
$p->slug = $slug;
|
||||
$p->portion_description = $portionDescription;
|
||||
|
|
@ -312,6 +417,7 @@ class ProductsController extends Controller
|
|||
if ($p->picture_video !== null && file_exists(public_path('images/produits/') . $p->picture_video))
|
||||
unlink(public_path('images/produits/') . $p->picture_video);
|
||||
|
||||
$p->inco_nutritional_values()->delete();
|
||||
$p->delete();
|
||||
} else {
|
||||
return redirect()->back()->withErrors('Le produit que vous souhaitez supprimer est encore lié à une ou plusieurs recette(s).');
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ namespace App\Models;
|
|||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class INCONutritionalValues extends Model
|
||||
class IncoNutritionalValues extends Model
|
||||
{
|
||||
public function product() {
|
||||
return $this->belongsTo('App\Models\Products', 'product_id');
|
||||
|
|
|
|||
|
|
@ -7,6 +7,6 @@ use Illuminate\Database\Eloquent\Model;
|
|||
class ProductPictograms extends Model
|
||||
{
|
||||
public function products() {
|
||||
return $this->belongsToMany('App\Models\Products', "products_pictograms");
|
||||
return $this->belongsToMany('App\Models\Products', "products_pictograms", "id_pictogram", "id_product");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ use Illuminate\Database\Eloquent\Model;
|
|||
class Products extends Model
|
||||
{
|
||||
public function pictograms() {
|
||||
return $this->belongsToMany('App\Models\ProductPictograms', "products_pictograms");
|
||||
return $this->belongsToMany('App\Models\ProductPictograms', "products_pictograms", "id_product", "id_pictogram");
|
||||
}
|
||||
|
||||
public function range() {
|
||||
|
|
|
|||
|
|
@ -19,11 +19,11 @@ class CreateMomentStrates extends Migration
|
|||
$table->foreign('moment_id')->references('id')->on('moments');
|
||||
$table->string('title');
|
||||
$table->string('picture');
|
||||
$table->string('picture_label');
|
||||
$table->string('picture_label')->nullable();
|
||||
$table->text('content');
|
||||
$table->string('button_label');
|
||||
$table->string('button_link');
|
||||
$table->boolean('status');
|
||||
$table->string('button_label')->nullable();
|
||||
$table->string('button_link')->nullable();
|
||||
$table->boolean('status')->default(0);
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
|
|
|||
5249
package-lock.json
generated
5249
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -14,7 +14,7 @@
|
|||
"bootstrap": "^4.0.0",
|
||||
"cross-env": "^7.0",
|
||||
"jquery": "^3.2",
|
||||
"laravel-mix": "^5.0.1",
|
||||
"laravel-mix": "^5.0.9",
|
||||
"lodash": "^4.17.13",
|
||||
"popper.js": "^1.12",
|
||||
"resolve-url-loader": "^2.3.1",
|
||||
|
|
@ -24,8 +24,12 @@
|
|||
"vue-template-compiler": "^2.6.10"
|
||||
},
|
||||
"dependencies": {
|
||||
"@ckeditor/ckeditor5-build-classic": "^24.0.0",
|
||||
"@ckeditor/ckeditor5-vue2": "^1.0.5",
|
||||
"@fortawesome/fontawesome-free": "^5.15.1",
|
||||
"fibers": "^5.0.0",
|
||||
"hooper": "^0.3.4",
|
||||
"normalize.css": "^8.0.1"
|
||||
"normalize.css": "^8.0.1",
|
||||
"vue-select-image": "^1.9.0"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
4
public/css/app.css
vendored
4
public/css/app.css
vendored
File diff suppressed because one or more lines are too long
5
public/css/main.css
vendored
5
public/css/main.css
vendored
File diff suppressed because one or more lines are too long
2
public/js/app.js
vendored
2
public/js/app.js
vendored
File diff suppressed because one or more lines are too long
2
public/js/main.js
vendored
2
public/js/main.js
vendored
File diff suppressed because one or more lines are too long
16
resources/js/app.js
vendored
16
resources/js/app.js
vendored
|
|
@ -6,8 +6,13 @@
|
|||
|
||||
require('./bootstrap');
|
||||
require('./app-icon');
|
||||
require('vue-select-image/dist/vue-select-image.css')
|
||||
|
||||
// window.Vue = require('vue');
|
||||
window.Vue = require('vue');
|
||||
import CKEditor from '@ckeditor/ckeditor5-vue2';
|
||||
import VueSelectImage from 'vue-select-image';
|
||||
Vue.use( CKEditor );
|
||||
Vue.use( VueSelectImage )
|
||||
|
||||
/**
|
||||
* The following block of code may be used to automatically register your
|
||||
|
|
@ -21,6 +26,9 @@ require('./app-icon');
|
|||
// files.keys().map(key => Vue.component(key.split('/').pop().split('.')[0], files(key).default))
|
||||
|
||||
// Vue.component('example-component', require('./components/ExampleComponent.vue').default);
|
||||
Vue.component('moment-strates', require('./components/bo/MomentStratesComponent.vue').default);
|
||||
Vue.component('custom-ckeditor', require('./components/bo/CKEditorComponent.vue').default);
|
||||
Vue.component('pictos-selector', require('./components/bo/PictosSelectorComponent.vue').default);
|
||||
|
||||
/**
|
||||
* Next, we will create a fresh Vue application instance and attach it to
|
||||
|
|
@ -28,6 +36,6 @@ require('./app-icon');
|
|||
* or customize the JavaScript scaffolding to fit your unique needs.
|
||||
*/
|
||||
|
||||
// const app = new Vue({
|
||||
// el: '#app',
|
||||
// });
|
||||
const app = new Vue({
|
||||
el: '#app',
|
||||
});
|
||||
|
|
|
|||
31
resources/js/components/bo/CKEditorComponent.vue
Normal file
31
resources/js/components/bo/CKEditorComponent.vue
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
<template>
|
||||
<div>
|
||||
<ckeditor :editor="editor" v-model="dbtext"></ckeditor>
|
||||
<input type="hidden" :name="name" :value="dbtext">
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ClassicEditor from '@ckeditor/ckeditor5-build-classic';
|
||||
|
||||
export default {
|
||||
mounted() {
|
||||
console.log('CKEditorComponent Component mounted.');
|
||||
},
|
||||
props: [
|
||||
'name',
|
||||
'dbtext',
|
||||
],
|
||||
data() {
|
||||
return {
|
||||
editor: ClassicEditor
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
115
resources/js/components/bo/MomentStratesComponent.vue
Normal file
115
resources/js/components/bo/MomentStratesComponent.vue
Normal file
|
|
@ -0,0 +1,115 @@
|
|||
<template>
|
||||
<div>
|
||||
<div class="accordion" id="accordionStrates">
|
||||
<div v-for="(item, index) in datas" class="card">
|
||||
<div class="card-header" :id="'heading' + index">
|
||||
<h2 class="mb-0 row">
|
||||
<button class="btn btn-link btn-block text-left col-md-11" type="button" data-toggle="collapse" :data-target="'#collapse' + index" aria-expanded="true" :aria-controls="'collapse' + index">
|
||||
Strate {{ index + 1 }}
|
||||
</button>
|
||||
<button type="button" class="close col-md-1" aria-label="Close" @click="removeItem(index)">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<div :id="'collapse' + index" class="collapse" :aria-labelledby="'heading' + index" data-parent="#accordionStrates">
|
||||
<div class="card-body">
|
||||
<div class="form-group">
|
||||
<label class="col-form-label">Titre de la strate</label>
|
||||
<input type="text" class="form-control" v-model="item.title" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-form-label">Visuel de type JPEG/PNG - 2Mo max. - 220 x 220px max.</label><br/>
|
||||
<input type="file" accept="image/jpeg, image/png, image/jpg" @change="processImage($event, index)">
|
||||
<br v-if="item.moment_id !== null"/><img v-if="item.moment_id !== null" :src="'/' + item.picture">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-form-label">Label du visuel</label>
|
||||
<input type="text" class="form-control" v-model="item.picture_label">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-form-label">Texte</label><br/>
|
||||
<ckeditor :editor="editor" v-model="item.content"></ckeditor>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-form-label">Label du bouton</label>
|
||||
<input type="text" class="form-control" v-model="item.button_label">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-form-label">Lien du bouton</label>
|
||||
<input type="text" class="form-control" v-model="item.button_link">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-form-label">
|
||||
<input type="checkbox" name="status" v-model="item.status">
|
||||
Activer la strate
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br/>
|
||||
<div class="form-group text-center">
|
||||
<button type="button" class="btn btn-primary text-white" @click="newItem">Ajouter une strate</button>
|
||||
<input type="hidden" :name="name" :value="JSON.stringify(datas)">
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ClassicEditor from '@ckeditor/ckeditor5-build-classic';
|
||||
|
||||
export default {
|
||||
mounted() {
|
||||
console.log('MomentStrates Component mounted.');
|
||||
this.datas = JSON.parse(this.dbdatas);
|
||||
},
|
||||
props: [
|
||||
'name',
|
||||
'dbdatas',
|
||||
],
|
||||
data() {
|
||||
return {
|
||||
datas: [],
|
||||
response: null,
|
||||
processing: false,
|
||||
editor: ClassicEditor
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
||||
},
|
||||
methods: {
|
||||
newItem() {
|
||||
this.datas.push({id: null, moment_id: null, title: '', picture: null, picture_label: '', content: '', button_label: '', button_link: '', status: false});
|
||||
},
|
||||
removeItem(index) {
|
||||
if (confirm("Êtes-vous sûr(e) ?")) {
|
||||
this.datas.splice(index, 1);
|
||||
}
|
||||
},
|
||||
processImage(event, index) {
|
||||
var file = event.target.files[0];
|
||||
var reader = new FileReader();
|
||||
reader.readAsDataURL(file);
|
||||
reader.onload = function () {
|
||||
this.datas[index].picture = reader.result;
|
||||
}.bind(this);
|
||||
reader.onerror = function (error) {
|
||||
console.log('Error: ', error);
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.fade-enter-active, .fade-leave-active {
|
||||
transition: opacity .5s;
|
||||
}
|
||||
.fade-enter, .fade-leave-to {
|
||||
opacity: 0;
|
||||
}
|
||||
</style>
|
||||
68
resources/js/components/bo/PictosSelectorComponent.vue
Normal file
68
resources/js/components/bo/PictosSelectorComponent.vue
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
<template>
|
||||
<div>
|
||||
<vue-select-image
|
||||
:dataImages="pictosDatas"
|
||||
:is-multiple="true"
|
||||
:useLabel="true"
|
||||
:selectedImages="pictosSelected"
|
||||
rootClass="pictos-vue"
|
||||
w="95px"
|
||||
h="80px"
|
||||
@onselectmultipleimage="getValues">
|
||||
</vue-select-image>
|
||||
<input type="hidden" :name="name" :value="JSON.stringify(pictos)">
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
mounted() {
|
||||
console.log('PictosSelectorComponent Component mounted.');
|
||||
},
|
||||
props: [
|
||||
'name',
|
||||
'pictos-datas',
|
||||
'pictos-selected'
|
||||
],
|
||||
data() {
|
||||
return {
|
||||
pictos: [],
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
||||
},
|
||||
methods: {
|
||||
getValues(event) {
|
||||
this.pictos = event;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.pictos-vue {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.pictos-vue li {
|
||||
display: inline-block;
|
||||
list-style-type: none;
|
||||
}
|
||||
|
||||
.pictos-vue__lbl {
|
||||
display: block;
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
.pictos-vue__thumbnail {
|
||||
padding: 3px;
|
||||
border-radius: 4px;
|
||||
margin: 2px;
|
||||
}
|
||||
|
||||
.pictos-vue__thumbnail--selected {
|
||||
background-color: #4a3436;
|
||||
color: white;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -22,10 +22,10 @@
|
|||
</div>
|
||||
@endif
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" name="title" placeholder="Titre *" required>
|
||||
<input type="text" class="form-control" name="title" placeholder="Titre *" value="{{ old('title') }}" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" name="link" placeholder="Lien de la vidéo *" required>
|
||||
<input type="text" class="form-control" name="link" placeholder="Lien de la vidéo *" value="{{ old('link') }}" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Visuel de la vidéo * de type JPEG/PNG - 2Mo max. - 760 x 456px</label>
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
</div>
|
||||
@endif
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" name="title" placeholder="Titre *" required>
|
||||
<input type="text" class="form-control" name="title" placeholder="Titre *" value="{{ old('title') }}" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Visuel * de type JPEG/PNG - 2Mo max. - 340 x 340px</label></br>
|
||||
|
|
@ -34,29 +34,30 @@
|
|||
<input type="file" name="picture_r" accept="image/png, image/jpeg" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<textarea id="content" name="content" placeholder="Contenu *"></textarea>
|
||||
<label class="col-form-label">Contenu *</label>
|
||||
<custom-ckeditor name="content" dbtext="{{ old('content') }}"></custom-ckeditor>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-form-label col-md-3">Catégorie *</label>
|
||||
<select class="custom-select col-md-9" id="category" name="category">
|
||||
@foreach ($ac as $article_category)
|
||||
<option value="{{$article_category->id}}">{{$article_category->name}}</option>
|
||||
<option value="{{$article_category->id}}" @if (old('category') == $article_category->id)selected @endif>{{$article_category->name}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group" id="div_answers">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" name="question" placeholder="Question *">
|
||||
<input type="text" class="form-control" name="question" value="{{ old('question') }}" placeholder="Question *">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>
|
||||
<input type="checkbox" name="multiple_response">
|
||||
<input type="checkbox" name="multiple_response" @if (old('multiple_response') !== null)checked @endif>
|
||||
Autoriser la réponse multiple
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>
|
||||
<input type="checkbox" name="stop_poll">
|
||||
<input type="checkbox" name="stop_poll" @if (old('stop_poll') !== null)checked @endif>
|
||||
Arrêter le sondage
|
||||
</label>
|
||||
</div>
|
||||
|
|
@ -78,7 +79,7 @@
|
|||
</div>
|
||||
<div class="form-group">
|
||||
<label>
|
||||
<input type="checkbox" name="notification">
|
||||
<input type="checkbox" name="notification" @if (old('notification') !== null)checked @endif>
|
||||
Notification activé
|
||||
</label>
|
||||
</div>
|
||||
|
|
@ -94,13 +95,6 @@
|
|||
|
||||
@section('scripts')
|
||||
<script>
|
||||
ClassicEditor
|
||||
.create( document.querySelector( '#content' ) )
|
||||
.catch( error => {
|
||||
console.error( error );
|
||||
} );
|
||||
|
||||
|
||||
var addId = 0;
|
||||
// Compte le nombre de champs answer sur la page
|
||||
var nbAnswer = 0;
|
||||
|
|
|
|||
|
|
@ -51,7 +51,8 @@
|
|||
<img src="/images/articles/{{$a->picture_r}}" style="max-height: 200px;">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<textarea class="form-control" id="content" name="content" placeholder="Contenu *">{{$a->content}}</textarea>
|
||||
<label class="col-form-label">Contenu *</label>
|
||||
<custom-ckeditor name="content" dbtext="{{ $a->content }}"></custom-ckeditor>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-form-label col-md-3">Catégorie *</label>
|
||||
|
|
@ -143,12 +144,6 @@
|
|||
|
||||
@section('scripts')
|
||||
<script>
|
||||
ClassicEditor
|
||||
.create( document.querySelector( '#content' ) )
|
||||
.catch( error => {
|
||||
console.error( error );
|
||||
} );
|
||||
|
||||
var addId = 0;
|
||||
// Compte le nombre de champs answer sur la page
|
||||
var nbAnswer = 0;
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
<label class="col-form-label col-md-4">Produit associé *</label>
|
||||
<select class="custom-select col-md-8" name="product_id">
|
||||
@foreach ($p as $product)
|
||||
<option value="{{$product->id}}">{{$product->name}}</option>
|
||||
<option value="{{$product->id}}" @if (old('product_id') == $product->id)selected @endif>{{$product->name}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
|
|
@ -34,7 +34,7 @@
|
|||
<label class="col-form-label col-md-4">Genre *</label>
|
||||
<select class="custom-select col-md-8" name="type">
|
||||
@foreach ($profils as $idProfil => $profil)
|
||||
<option value="{{$idProfil}}">{{$profil}}</option>
|
||||
<option value="{{$idProfil}}" @if (old('type') == $idProfil)selected @endif>{{$profil}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
|
|
@ -43,13 +43,16 @@
|
|||
<input type="file" name="picture" accept="image/png, image/jpeg" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<textarea class="form-control" id="entree" name="entree" placeholder="Entrée *"></textarea>
|
||||
<label class="col-form-label">Entrée *</label>
|
||||
<custom-ckeditor name="entree" dbtext="{{ old('entree') }}"></custom-ckeditor>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<textarea class="form-control" id="meal" name="meal" placeholder="Plat *"></textarea>
|
||||
<label class="col-form-label">Plat *</label>
|
||||
<custom-ckeditor name="meal" dbtext="{{ old('meal') }}"></custom-ckeditor>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<textarea class="form-control" id="dessert" name="dessert" placeholder="Dessert *"></textarea>
|
||||
<label class="col-form-label">Dessert *</label>
|
||||
<custom-ckeditor name="dessert" dbtext="{{ old('dessert') }}"></custom-ckeditor>
|
||||
</div>
|
||||
<div class="form-group text-center">
|
||||
<input type="submit" class="btn btn-secondary" value="Ajouter">
|
||||
|
|
@ -60,23 +63,3 @@
|
|||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('scripts')
|
||||
<script>
|
||||
ClassicEditor
|
||||
.create( document.querySelector( '#entree' ) )
|
||||
.catch( error => {
|
||||
console.error( error );
|
||||
} );
|
||||
ClassicEditor
|
||||
.create( document.querySelector( '#meal' ) )
|
||||
.catch( error => {
|
||||
console.error( error );
|
||||
} );
|
||||
ClassicEditor
|
||||
.create( document.querySelector( '#dessert' ) )
|
||||
.catch( error => {
|
||||
console.error( error );
|
||||
} );
|
||||
</script>
|
||||
@endsection
|
||||
|
|
|
|||
|
|
@ -65,13 +65,16 @@
|
|||
<img src="/images/menus-equilibres/{{$m->picture}}" style="max-height: 200px;">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<textarea class="form-control" id="entree" name="entree" placeholder="Entrée *">{{$m->entree}}</textarea>
|
||||
<label class="col-form-label">Entrée *</label>
|
||||
<custom-ckeditor name="entree" dbtext="{{ $m->entree }}"></custom-ckeditor>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<textarea class="form-control" id="meal" name="meal" placeholder="Plat *">{{$m->meal}}</textarea>
|
||||
<label class="col-form-label">Plat *</label>
|
||||
<custom-ckeditor name="meal" dbtext="{{ $m->meal }}"></custom-ckeditor>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<textarea class="form-control" id="dessert" name="dessert" placeholder="Dessert *">{{$m->dessert}}</textarea>
|
||||
<label class="col-form-label">Dessert *</label>
|
||||
<custom-ckeditor name="dessert" dbtext="{{ $m->dessert }}"></custom-ckeditor>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>
|
||||
|
|
@ -92,23 +95,3 @@
|
|||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('scripts')
|
||||
<script>
|
||||
ClassicEditor
|
||||
.create( document.querySelector( '#entree' ) )
|
||||
.catch( error => {
|
||||
console.error( error );
|
||||
} );
|
||||
ClassicEditor
|
||||
.create( document.querySelector( '#meal' ) )
|
||||
.catch( error => {
|
||||
console.error( error );
|
||||
} );
|
||||
ClassicEditor
|
||||
.create( document.querySelector( '#dessert' ) )
|
||||
.catch( error => {
|
||||
console.error( error );
|
||||
} );
|
||||
</script>
|
||||
@endsection
|
||||
|
|
|
|||
|
|
@ -24,54 +24,54 @@
|
|||
@endif
|
||||
<div class="form-group">
|
||||
<label class="col-form-label">
|
||||
<input type="checkbox" name="display">
|
||||
<input type="checkbox" name="display" @if (old('display') !== null)checked @endif>
|
||||
Afficher l'éleveur sur le site
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input class="form-control" type="text" name="breeder_code" placeholder="Code éleveur *" required>
|
||||
<input class="form-control" type="text" name="breeder_code" placeholder="Code éleveur *" value="{{ old('breeder_code') }}" required>
|
||||
</div>
|
||||
<div class="form-group text-center">
|
||||
<a class="btn btn-primary text-white" onclick="addInput()" id="addInuav" role="button">Ajouter un code INUAV</a>
|
||||
</div>
|
||||
<div class="form-group row" id="inuavs"></div>
|
||||
<div class="form-group">
|
||||
<input class="form-control" type="text" name="last_name" placeholder="Nom de l'éleveur *" required>
|
||||
<input class="form-control" type="text" name="last_name" placeholder="Nom de l'éleveur *" value="{{ old('last_name') }}" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input class="form-control" type="text" name="first_name" placeholder="Prénom de l'éleveur *" required>
|
||||
<input class="form-control" type="text" name="first_name" placeholder="Prénom de l'éleveur *" value="{{ old('first_name') }}" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Photo de l'éleveur * de type JPEG/PNG - 2Mo max.</label></br>
|
||||
<input type="file" name="picture" accept="image/png, image/jpeg" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input class="form-control" type="text" name="postal_code" placeholder="Code postal de l'éleveur *" required>
|
||||
<input class="form-control" type="text" name="postal_code" placeholder="Code postal de l'éleveur *" value="{{ old('postal_code') }}" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input class="form-control" type="text" name="town" placeholder="Commune de l'éleveur *" required>
|
||||
<input class="form-control" type="text" name="town" placeholder="Commune de l'éleveur *" value="{{ old('town') }}" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input class="form-control" type="text" name="testimony" placeholder="Témoignage de l'éleveur *" required>
|
||||
<input class="form-control" type="text" name="testimony" placeholder="Témoignage de l'éleveur *" value="{{ old('testimony') }}" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input class="form-control" type="text" name="latitude" placeholder="Latitude *" required>
|
||||
<input class="form-control" type="text" name="latitude" placeholder="Latitude *" value="{{ old('latitude') }}" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input class="form-control" type="text" name="longitude" placeholder="Longitude *" required>
|
||||
<input class="form-control" type="text" name="longitude" placeholder="Longitude *" value="{{ old('longitude') }}" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input class="form-control" type="text" name="geo_type" placeholder="Type de géolocalisation">
|
||||
<input class="form-control" type="text" name="geo_type" placeholder="Type de géolocalisation" value="{{ old('geo_type') }}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input class="form-control" type="text" name="audit" placeholder="Audit de l'éleveur">
|
||||
<input class="form-control" type="text" name="audit" placeholder="Audit de l'éleveur" value="{{ old('audit') }}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input class="form-control" type="text" name="valid_breeder" placeholder="Éleveur validé">
|
||||
<input class="form-control" type="text" name="valid_breeder" placeholder="Éleveur validé" value="{{ old('valid_breeder') }}">
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-form-label col-md-6">Date de validation marketing</label>
|
||||
<input class="form-control col-md-6" type="date" name="valid_marketing_date">
|
||||
<input class="form-control col-md-6" type="date" name="valid_marketing_date" value="{{ old('valid_marketing_date') }}">
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-form-label col-md-6">Type de présentation de l'élevage</label>
|
||||
|
|
@ -95,7 +95,7 @@
|
|||
<label class="col-form-label col-md-6">Type *</label>
|
||||
<select class="custom-select col-md-6" name="type">
|
||||
@foreach ($types as $idType => $nomType)
|
||||
<option value="{{$idType}}">{{$nomType}}</option>
|
||||
<option value="{{$idType}}" @if (old('type') == $idType)selected @endif>{{$nomType}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -13,11 +13,11 @@
|
|||
<div class="row">
|
||||
<div class="col-md-6 offset-md-3">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" name="name" placeholder="Nom" required>
|
||||
<input type="text" class="form-control" name="name" placeholder="Nom" value="{{ old('name') }}" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>
|
||||
<input type="checkbox" name="status" value="1">
|
||||
<input type="checkbox" name="status" value="1" @if (old('status') !== null)checked @endif>
|
||||
Publier ?
|
||||
</label>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -23,22 +23,22 @@
|
|||
</div>
|
||||
@endif
|
||||
<div class="form-group">
|
||||
<textarea class="form-control" name="question" placeholder="Question *" required></textarea>
|
||||
<textarea class="form-control" name="question" placeholder="Question *" value="{{ old('question') }}" required></textarea>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<textarea class="form-control" name="answer" placeholder="Réponse *" required></textarea>
|
||||
<textarea class="form-control" name="answer" placeholder="Réponse *" value="{{ old('answer') }}" required></textarea>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-form-label col-md-3">Vote positif</label>
|
||||
<input type="number" class="form-control col-md-3" name="positive_vote" required>
|
||||
<input type="number" class="form-control col-md-3" name="positive_vote" value="{{ old('positive_vote') }}" required>
|
||||
<label class="col-form-label col-md-3">Vote négatif</label>
|
||||
<input type="number" class="form-control col-md-3" name="negative_vote" required>
|
||||
<input type="number" class="form-control col-md-3" name="negative_vote" value="{{ old('negative_vote') }}" required>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-form-label col-md-4">Thème associé</label>
|
||||
<select class="custom-select col-md-8" name="theme">
|
||||
@foreach ($f as $theme)
|
||||
<option value="{{$theme->id}}">{{$theme->name}}</option>
|
||||
<option value="{{$theme->id}}" @if (old('theme') == $theme->id)selected @endif>{{$theme->name}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
|
|
@ -50,4 +50,4 @@
|
|||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@endsection
|
||||
|
|
|
|||
|
|
@ -23,10 +23,10 @@
|
|||
</div>
|
||||
@endif
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" name="name" placeholder="Nom *" required>
|
||||
<input type="text" class="form-control" name="name" placeholder="Nom *" value="{{ old('name') }}" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" name="pictogram" placeholder="Classe du pictogramme *" required>
|
||||
<input type="text" class="form-control" name="pictogram" placeholder="Classe du pictogramme *" value="{{ old('pictogram') }}" required>
|
||||
</div>
|
||||
<div class="form-group text-center">
|
||||
<input type="submit" class="btn btn-secondary" value="Ajouter">
|
||||
|
|
@ -36,4 +36,4 @@
|
|||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@endsection
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
@section('content')
|
||||
<div class="card">
|
||||
<div class="card-header">@if (isset($theme))Modifier @else Ajouter @endif un thème</div>
|
||||
<div class="card-header">@if (isset($theme))Modifier @else Ajouter @endif un thème<a href="{{ route('bo.forum-themes') }}" class="btn btn-sm btn-primary float-right">Retour</a></div>
|
||||
|
||||
@if (!isset($theme))
|
||||
<form action="{{ route('bo.process-forum-themes') }}" method="POST">
|
||||
|
|
|
|||
|
|
@ -24,20 +24,20 @@
|
|||
<div class="col-md-10 offset-md-1">
|
||||
<div class="form-group row">
|
||||
<div class="form-group col-md-8">
|
||||
<input type="text" class="form-control" name="catch_phrase" placeholder="Accroche *" required>
|
||||
<input type="text" class="form-control" name="catch_phrase" placeholder="Accroche *" value="{{ old('catch_phrase') }}" required>
|
||||
</div>
|
||||
<div class="form-group col-md-4 row">
|
||||
<label class="col-md-7 col-form-label">Couleur *</label>
|
||||
<input type="color" class="form-control col-md-5" name="catch_color" required>
|
||||
<input type="color" class="form-control col-md-5" name="catch_color" value="{{ old('catch_color') }}" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="form-group col-md-8">
|
||||
<input type="text" class="form-control" name="title" placeholder="Titre *" required>
|
||||
<input type="text" class="form-control" name="title" placeholder="Titre *" value="{{ old('title') }}" required>
|
||||
</div>
|
||||
<div class="form-group col-md-4 row">
|
||||
<label class="col-md-7 col-form-label">Couleur *</label>
|
||||
<input type="color" class="form-control col-md-5" name="title_color" required>
|
||||
<input type="color" class="form-control col-md-5" name="title_color" value="{{ old('title_color') }}" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
|
@ -56,19 +56,19 @@
|
|||
<div class="row">
|
||||
<div class="col-md-10 offset-md-1">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" name="link_label" placeholder="Nom du lien *" required>
|
||||
<input type="text" class="form-control" name="link_label" placeholder="Nom du lien *" value="{{ old('link_label') }}" required>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="form-group col-md-8">
|
||||
<input type="text" class="form-control" name="link" placeholder="Lien *" required>
|
||||
<input type="text" class="form-control" name="link" placeholder="Lien *" value="{{ old('link') }}" required>
|
||||
</div>
|
||||
<div class="form-group col-md-4 row">
|
||||
<label class="col-md-7 col-form-label">Couleur *</label>
|
||||
<input type="color" class="form-control col-md-5" name="link_color" required>
|
||||
<input type="color" class="form-control col-md-5" name="link_color" value="{{ old('link_color') }}" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input class="form-check-input" type="checkbox" id="new_tab_cb" name="new_tab">
|
||||
<input class="form-check-input" type="checkbox" id="new_tab_cb" name="new_tab" @if (old('new_tab') !== null)checked @endif>
|
||||
<label class="form-check-label" for="new_tab_cb">Ouvrir dans un nouvel onglet</label>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -80,43 +80,43 @@
|
|||
<div class="col-md-10 offset-md-1 text-center">
|
||||
<div class="form-group form-check-inline">
|
||||
<label>
|
||||
<input class="form-check-input" type="checkbox" name="day1">
|
||||
<input class="form-check-input" type="checkbox" name="day1" @if (old('day1') !== null)checked @endif>
|
||||
Lundi
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-group form-check-inline">
|
||||
<label>
|
||||
<input class="form-check-input" type="checkbox" name="day2">
|
||||
<input class="form-check-input" type="checkbox" name="day2" @if (old('day2') !== null)checked @endif>
|
||||
Mardi
|
||||
<label>
|
||||
</div>
|
||||
<div class="form-group form-check-inline">
|
||||
<label>
|
||||
<input class="form-check-input" type="checkbox"name="day3">
|
||||
<input class="form-check-input" type="checkbox" name="day3" @if (old('day3') !== null)checked @endif>
|
||||
Mercredi
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-group form-check-inline">
|
||||
<label>
|
||||
<input class="form-check-input" type="checkbox" name="day4">
|
||||
<input class="form-check-input" type="checkbox" name="day4" @if (old('day4') !== null)checked @endif>
|
||||
Jeudi
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-group form-check-inline">
|
||||
<label>
|
||||
<input class="form-check-input" type="checkbox" name="day5">
|
||||
<input class="form-check-input" type="checkbox" name="day5" @if (old('day5') !== null)checked @endif>
|
||||
Vendredi
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-group form-check-inline">
|
||||
<label>
|
||||
<input class="form-check-input" type="checkbox" name="day6">
|
||||
<input class="form-check-input" type="checkbox" name="day6" @if (old('day6') !== null)checked @endif>
|
||||
Samedi
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-group form-check-inline">
|
||||
<label>
|
||||
<input class="form-check-input" type="checkbox" name="day7">
|
||||
<input class="form-check-input" type="checkbox" name="day7" @if (old('day7') !== null)checked @endif>
|
||||
Dimanche
|
||||
</label>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -13,11 +13,11 @@
|
|||
<div class="row">
|
||||
<div class="col-md-6 offset-md-3">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" name="name" placeholder="Nom" required>
|
||||
<input type="text" class="form-control" name="name" placeholder="Nom" value="{{ old('name') }}" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>
|
||||
<input type="checkbox" name="status" value="1">
|
||||
<input type="checkbox" name="status" value="1" @if (old('status') !== null)checked @endif>
|
||||
Publier ?
|
||||
</label>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -44,15 +44,15 @@
|
|||
<div class="row">
|
||||
<div class="col-md-10 offset-md-1">
|
||||
<div class="form-group">
|
||||
<input class="form-control" type="text" name="title" placeholder="Titre *" required>
|
||||
<input class="form-control" type="text" name="title" placeholder="Titre *" value="{{ old('title') }}" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input class="form-control" type="text" name="description" placeholder="Description *" required>
|
||||
<input class="form-control" type="text" name="description" placeholder="Description *" value="{{ old('description') }}" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<select class="custom-select" id="color" name="color">
|
||||
@foreach ($colors as $idColor => $nameColor)
|
||||
<option value="{{$idColor}}">{{$nameColor}}</option>
|
||||
<option value="{{$idColor}}" @if (old('color') === $idColor)selected @endif>{{$nameColor}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
|
|
@ -80,13 +80,13 @@
|
|||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-form-label">
|
||||
<input type="checkbox" name="parallax">
|
||||
<input type="checkbox" name="parallax" @if (old('parallax') !== null)checked @endif>
|
||||
Activer le parallax ?
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-form-label">
|
||||
<input type="checkbox" name="star_moment">
|
||||
<input type="checkbox" name="star_moment" @if (old('star_moment') !== null)checked @endif>
|
||||
Moment star ?
|
||||
</label>
|
||||
</div>
|
||||
|
|
@ -97,7 +97,7 @@
|
|||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-md-10 offset-md-1">
|
||||
{{-- TODO : Strate à faire en Vue.js --}}
|
||||
<moment-strates dbdatas="{{ session('strates') !== null ? session('strates') : $strates }}" name="strates"></moment-strates>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -106,16 +106,17 @@
|
|||
<div class="row">
|
||||
<div class="col-md-10 offset-md-1">
|
||||
<div class="form-group">
|
||||
<input class="form-control" type="text" name="featured_title" placeholder="Titre de la remontée *" required>
|
||||
<input class="form-control" type="text" name="featured_title" placeholder="Titre de la remontée *" value="{{ old('featured_title') }}" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<textarea class="form-control" id="featured_text" name="featured_text" placeholder="Texte de la remontée *"></textarea>
|
||||
<label class="col-form-label">Texte de la remontée</label>
|
||||
<custom-ckeditor name="featured_text" dbtext="{{ old('featured_text') }}"></custom-ckeditor>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-form-label col-md-4">Type de remontée</label>
|
||||
<select class="custom-select col-md-8" id="featured_type" name="featured_type">
|
||||
@foreach ($featuredTypes as $idType => $nomType)
|
||||
<option value="{{$idType}}">{{$nomType}}</option>
|
||||
<option value="{{$idType}}" @if (old('featured_type') === $idType)selected @endif>{{$nomType}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
|
|
@ -142,7 +143,7 @@
|
|||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-form-label">
|
||||
<input type="checkbox" name="featured_status">
|
||||
<input type="checkbox" name="featured_status" @if (old('featured_status') !== null)checked @endif>
|
||||
Activer les remontées ?
|
||||
</label>
|
||||
</div>
|
||||
|
|
@ -159,7 +160,7 @@
|
|||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-form-label">
|
||||
<input type="checkbox" name="voucher_status">
|
||||
<input type="checkbox" name="voucher_status" @if (old('voucher_status') !== null)checked @endif>
|
||||
Activer la strate BR ?
|
||||
</label>
|
||||
</div>
|
||||
|
|
@ -214,12 +215,5 @@
|
|||
|
||||
previous = this.value;
|
||||
});
|
||||
|
||||
ClassicEditor
|
||||
.create( document.querySelector( '#featured_text' ) )
|
||||
.catch( error => {
|
||||
console.error( error );
|
||||
} );
|
||||
|
||||
</script>
|
||||
@endsection
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@
|
|||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-md-10 offset-md-1">
|
||||
{{-- TODO : Strate à faire en Vue.js --}}
|
||||
<moment-strates dbdatas="{{ session('strates') !== null ? session('strates') : $strates }}" name="strates"></moment-strates>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -152,7 +152,8 @@
|
|||
<input class="form-control" type="text" name="featured_title" placeholder="Titre de la remontée *" value="{{$m->featured_title}}" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<textarea class="form-control" id="featured_text" name="featured_text" placeholder="Texte de la remontée *" required>{{$m->featured_text}}</textarea>
|
||||
<label class="col-form-label">Texte de la remontée</label>
|
||||
<custom-ckeditor name="featured_text" dbtext="{{ $m->featured_text }}"></custom-ckeditor>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-form-label col-md-4">Type de remontée</label>
|
||||
|
|
@ -284,11 +285,5 @@
|
|||
|
||||
previous = this.value;
|
||||
});
|
||||
|
||||
ClassicEditor
|
||||
.create( document.querySelector( '#featured_text' ) )
|
||||
.catch( error => {
|
||||
console.error( error );
|
||||
} );
|
||||
</script>
|
||||
@endsection
|
||||
|
|
|
|||
|
|
@ -23,10 +23,10 @@
|
|||
<div class="row">
|
||||
<div class="col-md-10 offset-md-1">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" name="catch_phrase" placeholder="Accroche *" required>
|
||||
<input type="text" class="form-control" name="catch_phrase" placeholder="Accroche *" value="{{ old('catch_phrase') }}" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" name="title" placeholder="Titre *" required>
|
||||
<input type="text" class="form-control" name="title" placeholder="Titre *" value="{{ old('title') }}" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Visuel * de type JPEG/PNG - 2Mo max. - 565 x 390px</label></br>
|
||||
|
|
@ -40,10 +40,10 @@
|
|||
<div class="row">
|
||||
<div class="col-md-10 offset-md-1">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" name="link" placeholder="Lien *" required>
|
||||
<input type="text" class="form-control" name="link" placeholder="Lien *" value="{{ old('link') }}" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input class="form-check-input" type="checkbox" id="new_tab_cb" name="new_tab">
|
||||
<input class="form-check-input" type="checkbox" id="new_tab_cb" name="new_tab" @if (old('new_tab') !== null)checked @endif>
|
||||
<label class="form-check-label" for="new_tab_cb">Ouvrir dans un nouvel onglet</label>
|
||||
</div>
|
||||
<div class="form-group text-center">
|
||||
|
|
|
|||
|
|
@ -27,13 +27,14 @@
|
|||
<input type="file" name="picture" accept="image/png, image/jpeg" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<textarea class="form-control" id="content" name="content" placeholder="Contenu"></textarea>
|
||||
<label class="col-form-label">Contenu</label>
|
||||
<custom-ckeditor name="content" dbtext="{{ old('content') }}"></custom-ckeditor>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-form-label col-md-4">Type *</label>
|
||||
<select class="custom-select col-md-8" name="type">
|
||||
@foreach ($types as $idType => $nomType)
|
||||
<option value="{{$idType}}">{{$nomType}}</option>
|
||||
<option value="{{$idType}}" @if (old('type') == $idType)selected @endif>{{$nomType}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
|
|
@ -46,13 +47,3 @@
|
|||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('scripts')
|
||||
<script type="text/javascript">
|
||||
ClassicEditor
|
||||
.create( document.querySelector( '#content' ) )
|
||||
.catch( error => {
|
||||
console.error( error );
|
||||
} );
|
||||
</script>
|
||||
@endsection
|
||||
|
|
|
|||
|
|
@ -41,7 +41,8 @@
|
|||
<img src="/images/ocb/{{$ocb->picture}}" style="max-height: 200px;">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<textarea class="form-control" id="content" name="content" placeholder="Contenu">{{$ocb->content}}</textarea>
|
||||
<label class="col-form-label">Contenu</label>
|
||||
<custom-ckeditor name="content" dbtext="{{ $ocb->content }}"></custom-ckeditor>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-form-label col-md-4">Type *</label>
|
||||
|
|
@ -74,13 +75,3 @@
|
|||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('scripts')
|
||||
<script type="text/javascript">
|
||||
ClassicEditor
|
||||
.create( document.querySelector( '#content' ) )
|
||||
.catch( error => {
|
||||
console.error( error );
|
||||
} );
|
||||
</script>
|
||||
@endsection
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
</div>
|
||||
@endif
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" name="name" placeholder="Nom" required>
|
||||
<input type="text" class="form-control" name="name" placeholder="Nom" value="{{ old('name') }}" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Image de type JPEG/PNG - 2Mo max. - 95 x 80px</label>
|
||||
|
|
|
|||
|
|
@ -30,14 +30,14 @@
|
|||
<input type="file" name="picture_r" accept="image/png, image/jpeg" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" name="link" placeholder="Lien *" required>
|
||||
<input type="text" class="form-control" name="link" placeholder="Lien *" value="{{ old('link') }}" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" name="title" placeholder="Titre *" required>
|
||||
<input type="text" class="form-control" name="title" placeholder="Titre *" value="{{ old('title') }}" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>
|
||||
<input type="checkbox" id="new_tab_cb" name="new_tab">
|
||||
<input type="checkbox" id="new_tab_cb" name="new_tab" @if (old('new_tab') !== null)checked @endif>
|
||||
Ouvrir dans un nouvel onglet
|
||||
</label>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -23,48 +23,49 @@
|
|||
</div>
|
||||
@endif
|
||||
<div class="form-group">
|
||||
<input class="form-control" type="text" name="name" placeholder="Nom *" required>
|
||||
<input class="form-control" type="text" name="name" placeholder="Nom *" value="{{ old('name') }}" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input class="form-control" type="text" name="portion_description" placeholder="Descriptif de la portion *" required>
|
||||
<input class="form-control" type="text" name="portion_description" placeholder="Descriptif de la portion *" value="{{ old('portion_description') }}" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Visuel * de type JPEG/PNG - 2Mo max. - 324 x 328px</label></br>
|
||||
<input type="file" name="picture" accept="image/png, image/jpeg" required>
|
||||
<input type="file" name="picture" accept="image/png, image/jpeg, image/jpg" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input class="form-control" type="text" name="tags" placeholder="Tags (séparer par des points virgules)">
|
||||
<input class="form-control" type="text" name="tags" value="{{ old('tags') }}" placeholder="Tags (séparer par des points virgules)">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input class="form-control" type="text" name="subtitle" placeholder="Sous titre *" required>
|
||||
<input class="form-control" type="text" name="subtitle" value="{{ old('subtitle') }}" placeholder="Sous titre *" required>
|
||||
</div>
|
||||
{{-- TODO : Pictos en vue --}}
|
||||
<label class="col-form-label">Pictogrammes <small class="text-muted">(cliquez pour sélectionner)</small></label>
|
||||
<pictos-selector name="pictos" :pictos-datas='@json($pictosDatas)' :pictos-selected='@json($pictosSelected)'></pictos-selector>
|
||||
<div class="form-group">
|
||||
<input class="form-control" type="text" name="info1" placeholder="Information n°1">
|
||||
<input class="form-control" type="text" name="info1" value="{{ old('info1') }}" placeholder="Information n°1">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input class="form-control" type="text" name="info2" placeholder="Information n°2">
|
||||
<input class="form-control" type="text" name="info2" value="{{ old('info2') }}" placeholder="Information n°2">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input class="form-control" type="text" name="description" placeholder="Descriptif">
|
||||
<input class="form-control" type="text" name="description" value="{{ old('description') }}" placeholder="Descriptif">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input class="form-control" type="number" name="number_portion" placeholder="Nombre de portion">
|
||||
<input class="form-control" type="number" name="number_portion" value="{{ old('number_portion') }}" placeholder="Nombre de portion">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input class="form-control" type="text" name="type_portion" placeholder="Type de portion">
|
||||
<input class="form-control" type="text" name="type_portion" value="{{ old('type_portion') }}" placeholder="Type de portion">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input class="form-control" type="text" name="theoretical_average_weight" placeholder="Poids moyen théorique">
|
||||
<input class="form-control" type="text" name="theoretical_average_weight" value="{{ old('theoritical_average_weight') }}" placeholder="Poids moyen théorique">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input class="form-control" type="text" name="other_format" placeholder="Autre format">
|
||||
<input class="form-control" type="text" name="other_format" value="{{ old('other_format') }}" placeholder="Autre format">
|
||||
</div>
|
||||
<div class="form-group form-inline">
|
||||
<label class="col-form-label col-md-4 d-flex justify-content-start">Gamme *</label>
|
||||
<select class="custom-select col-md-8" name="range_id">
|
||||
@foreach ($ranges as $range)
|
||||
<option value="{{$range->id}}">{{$range->name}}</option>
|
||||
<option value="{{$range->id}}" @if (old('range_id') == $range->id)selected @endif>{{$range->name}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
|
|
@ -72,7 +73,7 @@
|
|||
<label class="col-form-label col-md-4 d-flex justify-content-start">Type de viande *</label>
|
||||
<select class="custom-select col-md-8" name="meat_type_id">
|
||||
@foreach ($meatTypes as $meatType)
|
||||
<option value="{{$meatType->id}}">{{$meatType->name}}</option>
|
||||
<option value="{{$meatType->id}}" @if (old('meat_type_id') == $meatType->id)selected @endif>{{$meatType->name}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
|
|
@ -80,29 +81,31 @@
|
|||
<label class="col-form-label col-md-4 d-flex justify-content-start">Moment consommation *</label>
|
||||
<select class="custom-select col-md-8" name="consumption_times_id">
|
||||
@foreach ($consumptionTimes as $consumptionTime)
|
||||
<option value="{{$consumptionTime->id}}">{{$consumptionTime->name}}</option>
|
||||
<option value="{{$consumptionTime->id}}" @if (old('consumption_times_id') == $consumptionTime->id)selected @endif>{{$consumptionTime->name}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-check-label">
|
||||
<input type="checkbox" name="departaimants">
|
||||
<input type="checkbox" name="departaimants" @if (old('departaimants') !== null)checked @endif>
|
||||
Ayant un départ'aimants
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<textarea class="form-control" id="preparation_advice" name="preparation_advice" placeholder="Conseil de préparation"></textarea>
|
||||
<label class="col-form-label">Conseil de préparation</label>
|
||||
<custom-ckeditor name="preparation_advice" dbtext="{{ old('preparation_advice') }}"></custom-ckeditor>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<textarea class="form-control" id="ingredients" name="ingredients" placeholder="Ingrédients"></textarea>
|
||||
<label class="col-form-label">Ingrédients</label>
|
||||
<custom-ckeditor name="ingredients" dbtext="{{ old('ingredients') }}"></custom-ckeditor>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<textarea class="form-control" id="tips" name="tips" placeholder="Astuces"></textarea>
|
||||
<label class="col-form-label">Astuces</label>
|
||||
<custom-ckeditor name="tips" dbtext="{{ old('tips') }}"></custom-ckeditor>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input class="form-control" type="text" name="portion_weight" placeholder="Poids portion">
|
||||
<input class="form-control" type="text" name="portion_weight" value="{{ old('portion_weight') }}" placeholder="Poids portion">
|
||||
</div>
|
||||
{{-- TODO : Remplir le tableau avec les inputs correct quand le flux sera traité --}}
|
||||
<div class="form-group">
|
||||
<label>Valeurs nutritionelles</label>
|
||||
<table class="table text-center table-sm table-bordered">
|
||||
|
|
@ -115,49 +118,49 @@
|
|||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Énergie</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td class="w-50">Énergie</td>
|
||||
<td class="w-25"><input class="form-control form-control-sm w-100 h-100" type="number" step=".01" name="energy"></td>
|
||||
<td class="w-25"><input class="form-control form-control-sm w-100 h-100" type="number" step=".01" name="energy_percent"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Énergie kJ</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td class="w-25"><input class="form-control form-control-sm w-100 h-100" type="number" step=".01" name="energy_kj"></td>
|
||||
<td class="w-25"><input class="form-control form-control-sm w-100 h-100" type="number" step=".01" name="energy_kj_percent"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Protéines</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td class="w-25"><input class="form-control form-control-sm w-100 h-100" type="number" step=".01" name="protein"></td>
|
||||
<td class="w-25"><input class="form-control form-control-sm w-100 h-100" type="number" step=".01" name="protein_percent"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Glucides</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td class="w-25"><input class="form-control form-control-sm w-100 h-100" type="number" step=".01" name="carbohydrates"></td>
|
||||
<td class="w-25"><input class="form-control form-control-sm w-100 h-100" type="number" step=".01" name="carbohydrates_percent"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Sucres</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td class="w-25"><input class="form-control form-control-sm w-100 h-100" type="number" step=".01" name="sugar"></td>
|
||||
<td class="w-25"><input class="form-control form-control-sm w-100 h-100" type="number" step=".01" name="sugar_percent"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Matière grasse</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td class="w-25"><input class="form-control form-control-sm w-100 h-100" type="number" step=".01" name="fat"></td>
|
||||
<td class="w-25"><input class="form-control form-control-sm w-100 h-100" type="number" step=".01" name="fat_percent"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Acides Gras Saturés</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td class="w-25"><input class="form-control form-control-sm w-100 h-100" type="number" step=".01" name="saturated_fatty_acids"></td>
|
||||
<td class="w-25"><input class="form-control form-control-sm w-100 h-100" type="number" step=".01" name="saturated_fatty_acids_percent"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Fibres alimentaires</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td class="w-25"><input class="form-control form-control-sm w-100 h-100" type="number" step=".01" name="dietary_fiber"></td>
|
||||
<td class="w-25"><input class="form-control form-control-sm w-100 h-100" type="number" step=".01" name="dietary_fiber_percent"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Sel</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td class="w-25"><input class="form-control form-control-sm w-100 h-100" type="number" step=".01" name="salt"></td>
|
||||
<td class="w-25"><input class="form-control form-control-sm w-100 h-100" type="number" step=".01" name="salt_percent"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
@ -167,7 +170,7 @@
|
|||
<select class="custom-select col-md-8" name="recipe_id">
|
||||
<option value="">Selectionner une recette</option>
|
||||
@foreach ($recipes as $recipe)
|
||||
<option value="{{$recipe->id}}">{{$recipe->title}}</option>
|
||||
<option value="{{$recipe->id}}" @if (old('recipe_id') == $recipe->id)selected @endif>{{$recipe->title}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
|
|
@ -179,19 +182,19 @@
|
|||
<select class="custom-select col-md-8" name="sale_family_id">
|
||||
<option value="">Selectionner une famille de vente</option>
|
||||
@foreach ($salesFamilies as $saleFamily)
|
||||
<option value="{{$saleFamily->id}}">{{$saleFamily->label}}</option>
|
||||
<option value="{{$saleFamily->id}}" @if (old('sale_family_id') == $saleFamily->id)selected @endif>{{$saleFamily->label}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input class="form-control" type="text" name="consumption_label" placeholder="Libéllé de consommation">
|
||||
<input class="form-control" type="text" name="consumption_label" value="{{ old('consumption_label') }}" placeholder="Libéllé de consommation">
|
||||
</div>
|
||||
<div class="form-group form-inline">
|
||||
<label class="col-form-label col-md-4 d-flex justify-content-start">Pays</label>
|
||||
<select class="custom-select col-md-8" name="country_id">
|
||||
<option value="">Selectionner un pays</option>
|
||||
@foreach ($countries as $country)
|
||||
<option value="{{$country->id}}">{{$country->label}}</option>
|
||||
<option value="{{$country->id}}" @if (old('country_id') == $country->id)selected @endif>{{$country->label}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
|
|
@ -200,21 +203,21 @@
|
|||
<select class="custom-select col-md-8" name="society_id">
|
||||
<option value="">Selectionner une société</option>
|
||||
@foreach ($societies as $society)
|
||||
<option value="{{$society->id}}">{{$society->name}}</option>
|
||||
<option value="{{$society->id}}" @if (old('$society_id') == $society->id)selected @endif>{{$society->name}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input class="form-control" type="text" name="production_season" placeholder="Saison de production">
|
||||
<input class="form-control" type="text" name="production_season" value="{{ old('production_season') }}" placeholder="Saison de production">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input class="form-control" type="text" name="allegations" placeholder="Allégations">
|
||||
<input class="form-control" type="text" name="allegations" value="{{ old('allegations') }}" placeholder="Allégations">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input class="form-control" type="text" name="computer_movement_type" placeholder="Type de mouvement informatique">
|
||||
<input class="form-control" type="text" name="computer_movement_type" value="{{ old('computer_movement_type') }}" placeholder="Type de mouvement informatique">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input class="form-control" type="text" name="video_link" placeholder="Vidéo du produit">
|
||||
<input class="form-control" type="text" name="video_link" value="{{ old('video_link') }}" placeholder="Vidéo du produit">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Visuel de la vidéo de type JPEG/PNG - 2Mo max. - 324 x 328px</label></br>
|
||||
|
|
@ -232,20 +235,6 @@
|
|||
|
||||
@section('scripts')
|
||||
<script type="text/javascript">
|
||||
ClassicEditor
|
||||
.create( document.querySelector( '#preparation_advice' ) )
|
||||
.catch( error => {
|
||||
console.error( error );
|
||||
} );
|
||||
ClassicEditor
|
||||
.create( document.querySelector( '#ingredients' ) )
|
||||
.catch( error => {
|
||||
console.error( error );
|
||||
} );
|
||||
ClassicEditor
|
||||
.create( document.querySelector( '#tips' ) )
|
||||
.catch( error => {
|
||||
console.error( error );
|
||||
} );
|
||||
var test;
|
||||
</script>
|
||||
@endsection
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@
|
|||
<input type="file" name="picture" accept="image/png, image/jpeg">
|
||||
</br>
|
||||
</br>
|
||||
<img src="/images/produits/{{$p->picture}}" style="max-height: 200px;">
|
||||
<img src="{{ asset('images/produits/' . $p->picture) }}" style="max-height: 200px;">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input class="form-control" type="text" name="tags" placeholder="Tags (séparer par des points virgules)" value="{{$p->tags}}">
|
||||
|
|
@ -52,7 +52,8 @@
|
|||
<div class="form-group">
|
||||
<input class="form-control" type="text" name="subtitle" placeholder="Sous titre *" value="{{$p->subtitle}}" required>
|
||||
</div>
|
||||
{{-- TODO : Pictos en vue --}}
|
||||
<label class="col-form-label">Pictogrammes <small class="text-muted">(cliquez pour sélectionner)</small></label>
|
||||
<pictos-selector name="pictos" :pictos-datas='@json($pictosDatas)' :pictos-selected='@json($pictosSelected)'></pictos-selector>
|
||||
<div class="form-group">
|
||||
<input class="form-control" type="text" name="info1" placeholder="Information n°1" value="{{$p->info1}}">
|
||||
</div>
|
||||
|
|
@ -131,18 +132,20 @@
|
|||
</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<textarea class="form-control" id="preparation_advice" name="preparation_advice" placeholder="Conseil de préparation">{{$p->preparation_advice}}</textarea>
|
||||
<label class="col-form-label">Conseil de préparation</label>
|
||||
<custom-ckeditor name="preparation_advice" dbtext="{{ $p->preparation_advice }}"></custom-ckeditor>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<textarea class="form-control" id="ingredients" name="ingredients" placeholder="Ingrédients">{{$p->ingredients}}</textarea>
|
||||
<label class="col-form-label">Ingrédients</label>
|
||||
<custom-ckeditor name="ingredients" dbtext="{{ $p->ingredients }}"></custom-ckeditor>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<textarea class="form-control" id="tips" name="tips" placeholder="Astuces">{{$p->tips}}</textarea>
|
||||
<label class="col-form-label">Astuces</label>
|
||||
<custom-ckeditor name="tips" dbtext="{{ $p->tips }}"></custom-ckeditor>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input class="form-control" type="text" name="portion_weight" placeholder="Poids portion" value="{{$p->portion_weight}}">
|
||||
</div>
|
||||
{{-- TODO : Remplir le tableau avec les inputs correct quand le flux sera traité --}}
|
||||
<div class="form-group">
|
||||
<label>Valeurs nutritionelles</label>
|
||||
<table class="table text-center table-sm table-bordered">
|
||||
|
|
@ -155,49 +158,49 @@
|
|||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Énergie</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td class="w-50">Énergie</td>
|
||||
<td class="w-25"><input class="form-control form-control-sm w-100 h-100" type="number" step=".01" name="energy" value="{{ $p->inco_nutritional_values->energy }}"></td>
|
||||
<td class="w-25"><input class="form-control form-control-sm w-100 h-100" type="number" step=".01" name="energy_percent" value="{{ $p->inco_nutritional_values->energy_percent }}"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Énergie kJ</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td class="w-25"><input class="form-control form-control-sm w-100 h-100" type="number" step=".01" name="energy_kj" value="{{ $p->inco_nutritional_values->energy_kj }}"></td>
|
||||
<td class="w-25"><input class="form-control form-control-sm w-100 h-100" type="number" step=".01" name="energy_kj_percent" value="{{ $p->inco_nutritional_values->energy_kj_percent }}"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Protéines</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td class="w-25"><input class="form-control form-control-sm w-100 h-100" type="number" step=".01" name="protein" value="{{ $p->inco_nutritional_values->protein }}"></td>
|
||||
<td class="w-25"><input class="form-control form-control-sm w-100 h-100" type="number" step=".01" name="protein_percent" value="{{ $p->inco_nutritional_values->protein_percent }}"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Glucides</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td class="w-25"><input class="form-control form-control-sm w-100 h-100" type="number" step=".01" name="carbohydrates" value="{{ $p->inco_nutritional_values->carbohydrates }}"></td>
|
||||
<td class="w-25"><input class="form-control form-control-sm w-100 h-100" type="number" step=".01" name="carbohydrates_percent" value="{{ $p->inco_nutritional_values->carbohydrates_percent }}"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Sucres</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td class="w-25"><input class="form-control form-control-sm w-100 h-100" type="number" step=".01" name="sugar" value="{{ $p->inco_nutritional_values->sugar }}"></td>
|
||||
<td class="w-25"><input class="form-control form-control-sm w-100 h-100" type="number" step=".01" name="sugar_percent" value="{{ $p->inco_nutritional_values->sugar_percent }}"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Matière grasse</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td class="w-25"><input class="form-control form-control-sm w-100 h-100" type="number" step=".01" name="fat" value="{{ $p->inco_nutritional_values->fat }}"></td>
|
||||
<td class="w-25"><input class="form-control form-control-sm w-100 h-100" type="number" step=".01" name="fat_percent" value="{{ $p->inco_nutritional_values->fat_percent }}"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Acides Gras Saturés</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td class="w-25"><input class="form-control form-control-sm w-100 h-100" type="number" step=".01" name="saturated_fatty_acids" value="{{ $p->inco_nutritional_values->saturated_fatty_acids }}"></td>
|
||||
<td class="w-25"><input class="form-control form-control-sm w-100 h-100" type="number" step=".01" name="saturated_fatty_acids_percent" value="{{ $p->inco_nutritional_values->saturated_fatty_acids_percent }}"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Fibres alimentaires</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td class="w-25"><input class="form-control form-control-sm w-100 h-100" type="number" step=".01" name="dietary_fiber" value="{{ $p->inco_nutritional_values->dietary_fiber }}"></td>
|
||||
<td class="w-25"><input class="form-control form-control-sm w-100 h-100" type="number" step=".01" name="dietary_fiber_percent" value="{{ $p->inco_nutritional_values->dietary_fiber_percent }}"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Sel</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td class="w-25"><input class="form-control form-control-sm w-100 h-100" type="number" step=".01" name="salt" value="{{ $p->inco_nutritional_values->salt }}"></td>
|
||||
<td class="w-25"><input class="form-control form-control-sm w-100 h-100" type="number" step=".01" name="salt_percent" value="{{ $p->inco_nutritional_values->salt_percent }}"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
@ -290,23 +293,3 @@
|
|||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('scripts')
|
||||
<script type="text/javascript">
|
||||
ClassicEditor
|
||||
.create( document.querySelector( '#preparation_advice' ) )
|
||||
.catch( error => {
|
||||
console.error( error );
|
||||
} );
|
||||
ClassicEditor
|
||||
.create( document.querySelector( '#ingredients' ) )
|
||||
.catch( error => {
|
||||
console.error( error );
|
||||
} );
|
||||
ClassicEditor
|
||||
.create( document.querySelector( '#tips' ) )
|
||||
.catch( error => {
|
||||
console.error( error );
|
||||
} );
|
||||
</script>
|
||||
@endsection
|
||||
|
|
|
|||
|
|
@ -23,25 +23,25 @@
|
|||
</div>
|
||||
@endif
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" name="title" placeholder="Dénomination *" required>
|
||||
<input type="text" class="form-control" name="title" placeholder="Dénomination *" value="{{ old('title') }}" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Visuel QR code * de type JPEG/PNG - 2Mo max.</label></br>
|
||||
<input type="file" name="picture" accept="image/png, image/jpeg" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" name="link" placeholder="Lien *" required>
|
||||
<input type="text" class="form-control" name="link" placeholder="Lien *" value="{{ old('link') }}" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" name="associated_page" placeholder="Page associée *" required>
|
||||
<input type="text" class="form-control" name="associated_page" placeholder="Page associée *" value="{{ old('associated_page') }}" required>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-form-label col-md-6">Date de publication *</label>
|
||||
<input type="date" class="form-control col-md-6" name="publish_date" placeholder="Date de publication *" required>
|
||||
<input type="date" class="form-control col-md-6" name="publish_date" placeholder="Date de publication *" value="{{ old('publish_date') }}" required>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-form-label col-md-6">Date de désactivation *</label>
|
||||
<input type="date" class="form-control col-md-6" name="deactivate_date" placeholder="Date de désactivation *" required>
|
||||
<input type="date" class="form-control col-md-6" name="deactivate_date" placeholder="Date de désactivation *" value="{{ old('deactivate_date') }}" required>
|
||||
</div>
|
||||
<div class="form-group text-center">
|
||||
<input type="submit" class="btn btn-secondary" value="Ajouter">
|
||||
|
|
@ -51,4 +51,4 @@
|
|||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@endsection
|
||||
|
|
|
|||
|
|
@ -22,10 +22,10 @@
|
|||
</div>
|
||||
@endif
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" name="name" placeholder="Nom *" required>
|
||||
<input type="text" class="form-control" name="name" placeholder="Nom *" value="{{ old('name') }}" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" name="description" placeholder="Description *" required>
|
||||
<input type="text" class="form-control" name="description" placeholder="Description *" value="{{ old('description') }}" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Couleur *</label>
|
||||
|
|
|
|||
|
|
@ -23,29 +23,32 @@
|
|||
</div>
|
||||
@endif
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" name="title" placeholder="Titre *" required>
|
||||
<input type="text" class="form-control" name="title" placeholder="Titre *" value="{{ old('title') }}" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" name="catch_phrase" placeholder="Accroche">
|
||||
<input type="text" class="form-control" name="catch_phrase" placeholder="Accroche" value="{{ old('catch_phrase') }}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" name="tags" placeholder="Tags * (séparer les tags par des points-virgules, ex : frais;plat)">
|
||||
<input type="text" class="form-control" name="tags" placeholder="Tags * (séparer les tags par des points-virgules, ex : frais;plat)" value="{{ old('tags') }}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Visuel * de type JPEG/PNG - 2Mo max. - 683 x 434px</label>
|
||||
<input type="file" name="picture" accept="image/png, image/jpeg" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<textarea class="form-control" id="ingredients" name="ingredients" placeholder="Ingrédients *" ></textarea>
|
||||
<label class="col-form-label">Ingrédients *</label>
|
||||
<custom-ckeditor name="ingredients" dbtext="{{ old('ingredients') }}"></custom-ckeditor>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<textarea class="form-control" id="preparation" name="preparation" placeholder="Préparation *" ></textarea>
|
||||
<label class="col-form-label">Préparation *</label>
|
||||
<custom-ckeditor name="preparation" dbtext="{{ old('preparation') }}"></custom-ckeditor>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<textarea class="form-control" id="advice" name="advice" placeholder="Conseil Le Gaulois"></textarea>
|
||||
<label class="col-form-label">Conseil Le Gaulois</label>
|
||||
<custom-ckeditor name="advice" dbtext="{{ old('advice') }}"></custom-ckeditor>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<textarea class="form-control" name="keywords" placeholder="Mots-clés (Référencement) Séparez les mots clés par des points-virgules"></textarea>
|
||||
<textarea class="form-control" name="keywords" placeholder="Mots-clés (Référencement) Séparez les mots clés par des points-virgules">{{ old('keywords') }}</textarea>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Genre</label></br>
|
||||
|
|
@ -59,22 +62,22 @@
|
|||
</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" id="video_link" name="video_link" placeholder="Lien de la video *">
|
||||
<input type="text" class="form-control" id="video_link" name="video_link" placeholder="Lien de la video *" value="{{ old('video_link') }}">
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="form-group col-md-6 row">
|
||||
<label class="col-md-8 col-form-label">Temps de préparation *</label>
|
||||
<input type="number" class="form-control col-md-4" name="preparation_time" required>
|
||||
<input type="number" class="form-control col-md-4" name="preparation_time" value="{{ old('preparation_time') }}" required>
|
||||
</div>
|
||||
<div class="form-group col-md-6 row">
|
||||
<label class="col-md-8 col-form-label">Temps de cuisson *</label>
|
||||
<input type="number" class="form-control col-md-4 float-right" name="cooking_time" required>
|
||||
<input type="number" class="form-control col-md-4 float-right" name="cooking_time" value="{{ old('cooking_time') }}" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="form-group col-md-6 row">
|
||||
<label class="col-md-8 col-form-label">Nombre de personne</label>
|
||||
<input type="number" class="form-control col-md-4" name="number_people">
|
||||
<input type="number" class="form-control col-md-4" name="number_people" value="{{ old('number_people') }}">
|
||||
</div>
|
||||
<div class="form-group col-md-6 row">
|
||||
<label class="col-md-5 col-form-label">Difficulté</label>
|
||||
|
|
@ -121,7 +124,7 @@
|
|||
</div>
|
||||
<div class="form-group">
|
||||
<label>
|
||||
<input type="checkbox" name="notification">
|
||||
<input type="checkbox" name="notification" @if (old('notification') !== null)checked @endif>
|
||||
Notification activé
|
||||
</label>
|
||||
</div>
|
||||
|
|
@ -159,21 +162,5 @@
|
|||
$("[name=associated_product1]").change(function() {
|
||||
$("[name=consumption_times]").val($("[name=associated_product1]").find(':selected').data("ct"));
|
||||
});
|
||||
|
||||
ClassicEditor
|
||||
.create( document.querySelector( '#ingredients' ) )
|
||||
.catch( error => {
|
||||
console.error( error );
|
||||
} );
|
||||
ClassicEditor
|
||||
.create( document.querySelector( '#preparation' ) )
|
||||
.catch( error => {
|
||||
console.error( error );
|
||||
} );
|
||||
ClassicEditor
|
||||
.create( document.querySelector( '#advice' ) )
|
||||
.catch( error => {
|
||||
console.error( error );
|
||||
} );
|
||||
</script>
|
||||
@endsection
|
||||
|
|
|
|||
|
|
@ -50,13 +50,16 @@
|
|||
<img src="/images/recettes/{{$r->picture}}" style="max-height: 200px;">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<textarea class="form-control" id="ingredients" name="ingredients" placeholder="Ingrédients *">{{$r->ingredients}}</textarea>
|
||||
<label class="col-form-label">Ingrédients *</label>
|
||||
<custom-ckeditor name="ingredients" dbtext="{{ $r->ingredients }}"></custom-ckeditor>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<textarea class="form-control" id="preparation" name="preparation" placeholder="Préparation *">{{$r->preparation}}</textarea>
|
||||
<label class="col-form-label">Préparation *</label>
|
||||
<custom-ckeditor name="preparation" dbtext="{{ $r->preparation }}"></custom-ckeditor>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<textarea class="form-control" id="advice" name="advice" placeholder="Conseil Le Gaulois">{{$r->advice}}</textarea>
|
||||
<label class="col-form-label">Conseil Le Gaulois</label>
|
||||
<custom-ckeditor name="advice" dbtext="{{ $r->advice }}"></custom-ckeditor>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<textarea class="form-control" name="keywords" placeholder="Mots-clés (Référencement) Séparez les mots clés par des points-virgules">{{$r->keywords}}</textarea>
|
||||
|
|
@ -227,21 +230,5 @@
|
|||
$("[name=associated_product1]").change(function() {
|
||||
$("[name=consumption_times]").val($("[name=associated_product1]").find(':selected').data("ct"));
|
||||
});
|
||||
|
||||
ClassicEditor
|
||||
.create( document.querySelector( '#ingredients' ) )
|
||||
.catch( error => {
|
||||
console.error( error );
|
||||
} );
|
||||
ClassicEditor
|
||||
.create( document.querySelector( '#preparation' ) )
|
||||
.catch( error => {
|
||||
console.error( error );
|
||||
} );
|
||||
ClassicEditor
|
||||
.create( document.querySelector( '#advice' ) )
|
||||
.catch( error => {
|
||||
console.error( error );
|
||||
} );
|
||||
</script>
|
||||
@endsection
|
||||
|
|
|
|||
|
|
@ -10,11 +10,10 @@
|
|||
<title>{{ config('app.name', 'Laravel') }}</title>
|
||||
|
||||
<!-- Scripts -->
|
||||
<script src="{{ asset('js/app.js') }}" defer></script>
|
||||
{{-- TODO : Ajouter jQuery dans app.js --}}
|
||||
<script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
|
||||
{{-- TODO : Ajouter CKEditor dans app.js --}}
|
||||
<script src="https://cdn.ckeditor.com/ckeditor5/23.0.0/classic/ckeditor.js"></script>
|
||||
{{-- <script src="https://cdn.ckeditor.com/ckeditor5/23.0.0/classic/ckeditor.js"></script> --}}
|
||||
{{-- TODO : Voir l'inclusion de Font Awesome, pour le moment c'est fait avec mon compte FA --}}
|
||||
<script src="https://kit.fontawesome.com/2327d60f96.js" crossorigin="anonymous"></script>
|
||||
|
||||
|
|
@ -201,6 +200,7 @@
|
|||
</div>
|
||||
</main>
|
||||
</div>
|
||||
<script src="{{ asset('js/app.js') }}"></script>
|
||||
@yield('scripts')
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue