add seotitle and seo_description on recipes and products + multiple fixes
This commit is contained in:
parent
fcbbe9b432
commit
f20d9a0baf
13 changed files with 226 additions and 102 deletions
|
|
@ -11,7 +11,6 @@ use App\Models\Ranges;
|
|||
use App\Models\MeatTypes;
|
||||
use App\Models\Recipes;
|
||||
use App\Models\SalesFamilies;
|
||||
use App\Models\Countries;
|
||||
use App\Models\IncoNutritionalValues;
|
||||
use App\Models\Societies;
|
||||
use Illuminate\Support\Str;
|
||||
|
|
@ -39,7 +38,6 @@ class ProductsController extends Controller
|
|||
$consumptionTimes = ConsumptionTimes::select('id', 'name')->get();
|
||||
$recipes = Recipes::select('id', 'title')->get();
|
||||
$salesFamilies = SalesFamilies::all();
|
||||
$countries = Countries::all();
|
||||
$societies = Societies::all();
|
||||
return view('bo.products.create', compact(
|
||||
'pictosDatas',
|
||||
|
|
@ -49,7 +47,6 @@ class ProductsController extends Controller
|
|||
'consumptionTimes',
|
||||
'recipes',
|
||||
'salesFamilies',
|
||||
'countries',
|
||||
'societies'
|
||||
));
|
||||
}
|
||||
|
|
@ -58,6 +55,8 @@ class ProductsController extends Controller
|
|||
{
|
||||
$request->validate([
|
||||
'name' => 'required|max:255',
|
||||
'seo_title' => 'required|max:255',
|
||||
'seo_description' => 'required|max:255',
|
||||
'portion_description' => 'required|max:255',
|
||||
'picture' => 'image|mimes:jpeg,png,jpg|max:2048|dimensions:width=324,height=328',
|
||||
'tags' => 'max:255',
|
||||
|
|
@ -79,6 +78,8 @@ class ProductsController extends Controller
|
|||
$name = $request->name;
|
||||
$slug = Str::slug($name);
|
||||
$portionDescription = $request->portion_description;
|
||||
$seo_title = $request->seo_title;
|
||||
$seo_description = $request->seo_description;
|
||||
$picture = $request->picture;
|
||||
$tags = $request->tags;
|
||||
$subtitle = $request->subtitle;
|
||||
|
|
@ -144,6 +145,8 @@ class ProductsController extends Controller
|
|||
$p = new Products();
|
||||
$p->name = $name;
|
||||
$p->slug = $slug;
|
||||
$p->seo_title = $seo_title;
|
||||
$p->seo_description = $seo_description;
|
||||
$p->portion_description = $portionDescription;
|
||||
$p->picture = 'uploads/images/produits/' . date('Y') . '/' . date('m') . '/' . $imageName;
|
||||
$p->tags = $tags;
|
||||
|
|
@ -222,7 +225,7 @@ class ProductsController extends Controller
|
|||
return redirect()->route('bo.products.index');
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
public function edit(Products $p)
|
||||
{
|
||||
// Limitation aux champs dont on a besoin sur certaines requêtes pour ne pas surcharger ces dernières
|
||||
$pictograms = ProductPictograms::all();
|
||||
|
|
@ -236,9 +239,7 @@ class ProductsController extends Controller
|
|||
$consumptionTimes = ConsumptionTimes::select('id', 'name')->get();
|
||||
$recipes = Recipes::select('id', 'title')->get();
|
||||
$salesFamilies = SalesFamilies::all();
|
||||
$countries = Countries::all();
|
||||
$societies = Societies::all();
|
||||
$p = Products::findOrFail($id);
|
||||
$pictosSelected = [];
|
||||
foreach ($p->pictograms as $pictoSelected) {
|
||||
$pictosSelected[] = [
|
||||
|
|
@ -257,15 +258,16 @@ class ProductsController extends Controller
|
|||
'consumptionTimes',
|
||||
'recipes',
|
||||
'salesFamilies',
|
||||
'countries',
|
||||
'societies'
|
||||
));
|
||||
}
|
||||
|
||||
public function update(Request $request, $id)
|
||||
public function update(Request $request, Products $p)
|
||||
{
|
||||
$request->validate([
|
||||
'name' => 'required|max:255',
|
||||
'seo_title' => 'required|max:255',
|
||||
'seo_description' => 'required|max:255',
|
||||
'portion_description' => 'required|max:255',
|
||||
'picture' => 'image|mimes:jpeg,png,jpg|max:2048|dimensions:width=324,height=328',
|
||||
'tags' => 'max:255',
|
||||
|
|
@ -292,6 +294,8 @@ class ProductsController extends Controller
|
|||
$name = $request->name;
|
||||
$slug = Str::slug($name);
|
||||
$portionDescription = $request->portion_description;
|
||||
$seo_description = $request->seo_description;
|
||||
$seo_title = $request->seo_title;
|
||||
$picture = $request->picture;
|
||||
$tags = $request->tags;
|
||||
$subtitle = $request->subtitle;
|
||||
|
|
@ -359,8 +363,6 @@ class ProductsController extends Controller
|
|||
]);
|
||||
}
|
||||
|
||||
$p = Products::findOrFail($id);
|
||||
|
||||
if ($picture !== null) {
|
||||
if (file_exists(public_path() . '/' . $p->picture)) {
|
||||
unlink(public_path() . '/' . $p->picture);
|
||||
|
|
@ -414,6 +416,8 @@ class ProductsController extends Controller
|
|||
}
|
||||
$p->tags = $tags;
|
||||
$p->subtitle = $subtitle;
|
||||
$p->seo_title = $seo_title;
|
||||
$p->seo_description = $seo_description;
|
||||
$p->info1 = $info1;
|
||||
$p->info2 = $info2;
|
||||
$p->description = $description;
|
||||
|
|
|
|||
|
|
@ -33,6 +33,8 @@ class RecipesController extends Controller
|
|||
$title = $request->title;
|
||||
$slug = Str::slug($title);
|
||||
$catchPhrase = $request->catch_phrase;
|
||||
$seo_title = $request->seo_title;
|
||||
$seo_description = $request->seo_description;
|
||||
$tags = $request->tags;
|
||||
$picture = $request->picture;
|
||||
$ingredients = $request->ingredients;
|
||||
|
|
@ -53,6 +55,8 @@ class RecipesController extends Controller
|
|||
|
||||
$request->validate([
|
||||
'title' => 'required|max:100',
|
||||
'seo_title' => 'required|max:255',
|
||||
'seo_description' => 'required|max:255',
|
||||
'catch_phrase' => 'max:100',
|
||||
'tags' => 'required|max:255',
|
||||
'picture' => 'required|image|mimes:jpeg,png,jpg|max:2048|dimensions:width=683,height=434',
|
||||
|
|
@ -73,6 +77,8 @@ class RecipesController extends Controller
|
|||
|
||||
$r = new Recipes();
|
||||
$r->title = $title;
|
||||
$r->seo_title = $seo_title;
|
||||
$r->seo_description = $seo_description;
|
||||
$r->slug = $slug;
|
||||
$r->catch_phrase = $catchPhrase;
|
||||
$r->tags = $tags;
|
||||
|
|
@ -121,6 +127,8 @@ class RecipesController extends Controller
|
|||
$title = $request->title;
|
||||
$slug = Str::slug($title);
|
||||
$catchPhrase = $request->catch_phrase;
|
||||
$seo_title = $request->seo_title;
|
||||
$seo_description = $request->seo_description;
|
||||
$tags = $request->tags;
|
||||
$picture = $request->picture;
|
||||
$ingredients = $request->ingredients;
|
||||
|
|
@ -141,6 +149,8 @@ class RecipesController extends Controller
|
|||
|
||||
$request->validate([
|
||||
'title' => 'required|max:100',
|
||||
'seo_title' => 'required|max:255',
|
||||
'seo_description' => 'required|max:255',
|
||||
'catch_phrase' => 'max:100',
|
||||
'tags' => 'required|max:255',
|
||||
'ingredients' => 'required|max:4000',
|
||||
|
|
@ -173,6 +183,8 @@ class RecipesController extends Controller
|
|||
|
||||
$r->title = $title;
|
||||
$r->slug = $slug;
|
||||
$r->seo_title = $seo_title;
|
||||
$r->seo_description = $seo_description;
|
||||
$r->catch_phrase = $catchPhrase;
|
||||
$r->tags = $tags;
|
||||
if ($picture !== null) {
|
||||
|
|
|
|||
|
|
@ -11,6 +11,17 @@ class Products extends Model
|
|||
'star' => 'boolean'
|
||||
];
|
||||
|
||||
protected static function booted()
|
||||
{
|
||||
static::creating(function ($product) {
|
||||
if (!$product->incoNutritionalValues) {
|
||||
$inc = new IncoNutritionalValues();
|
||||
$inc->incoNutritionalValues()->associate($inc);
|
||||
}
|
||||
return $product;
|
||||
});
|
||||
}
|
||||
|
||||
public function pictograms()
|
||||
{
|
||||
return $this->belongsToMany(
|
||||
|
|
|
|||
|
|
@ -239,6 +239,7 @@ return [
|
|||
'View' => Illuminate\Support\Facades\View::class,
|
||||
'Days' => \App\Enums\Days::class,
|
||||
'RecipeType' => \App\Enums\RecipeType::class,
|
||||
'RecipeDifficulty' => \App\Enums\RecipeDifficulty::class,
|
||||
'ContactFormCivility' => App\Enums\ContactFormCivility::class,
|
||||
'ContactFormType' => App\Enums\ContactFormType::class,
|
||||
'BalancedMenuType' => App\Enums\BalancedMenuType::class,
|
||||
|
|
|
|||
|
|
@ -616,7 +616,7 @@ class MigrateOldDataBase extends LeGaulois2016Migration
|
|||
'produit_tag.tag_id'
|
||||
)->get(['tag_label'])->transform(function ($obj) {
|
||||
return $obj->tag_label;
|
||||
})->join('#|#');
|
||||
})->join(';');
|
||||
},
|
||||
'name' => 'produit_id'
|
||||
],
|
||||
|
|
|
|||
|
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddSeoTitleAndseoDescriptionOnRecipesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('recipes', function (Blueprint $table) {
|
||||
$table->string('seo_title')->after('slug');
|
||||
$table->string('seo_description')->after('seo_title');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('recipes', function (Blueprint $table) {
|
||||
$table->dropColumn('seo_title');
|
||||
$table->dropColumn('seo_description');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddSeoTitleAndSeoDescriptionOnProductsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('products', function (Blueprint $table) {
|
||||
$table->string('seo_title')->after('description');
|
||||
$table->string('seo_description')->after('seo_title');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('products', function (Blueprint $table) {
|
||||
$table->dropColumn('seo_title');
|
||||
$table->dropColumn('seo_description');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -23,10 +23,20 @@
|
|||
</div>
|
||||
@endif
|
||||
<div class="form-group">
|
||||
<input class="form-control" type="text" name="name" placeholder="Nom *" value="{{ old('name') }}" required>
|
||||
<label for="name"><small></small></label>
|
||||
<input id="name" 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 *" value="{{ old('portion_description') }}" required>
|
||||
<label for="seo_title"><small>{{ __('Seo Titre') }}</small></label>
|
||||
<input id="seo_title" class="form-control" type="text" name="seo_title" placeholder="Seo titre" value="{{ old('seo_title') }}" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="seo_description"><small>{{ __('Seo Description') }}</small></label>
|
||||
<input id="seo_description" class="form-control" type="text" name="seo_description" placeholder="Seo description" value="{{ old('seo_description') }}" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="portion_description"><small></small></label>
|
||||
<input id="portion_description" 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>
|
||||
|
|
@ -41,25 +51,32 @@
|
|||
<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" value="{{ old('info1') }}" placeholder="Information n°1">
|
||||
<label for="info1"><small>{{ __('info1') }}</small></label>
|
||||
<input id="info1" 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" value="{{ old('info2') }}" placeholder="Information n°2">
|
||||
<label for="info2"><small>{{ __('info2') }}</small></label>
|
||||
<input id="info2" 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" value="{{ old('description') }}" placeholder="Descriptif">
|
||||
<label for="description"><small>{{ __('description') }}</small></label>
|
||||
<input id="description" 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" value="{{ old('number_portion') }}" placeholder="Nombre de portion">
|
||||
<label for="number_portion"><small>{{ __('number_portion') }}</small></label>
|
||||
<input id="number_portion" 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" value="{{ old('type_portion') }}" placeholder="Type de portion">
|
||||
<label for="type_portion"><small>{{ __('type_portion') }}</small></label>
|
||||
<input id="type_portion" 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" value="{{ old('theoritical_average_weight') }}" placeholder="Poids moyen théorique">
|
||||
<label for="theoretical_average_weight"><small>{{ __('theoretical_average_weight') }}</small></label>
|
||||
<input id="theoretical_average_weight" 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" value="{{ old('other_format') }}" placeholder="Autre format">
|
||||
<label for="other_format"><small>{{ __('other_format') }}</small></label>
|
||||
<input id="other_format" 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>
|
||||
|
|
@ -189,15 +206,6 @@
|
|||
<div class="form-group">
|
||||
<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}}" @if (old('country_id') == $country->id)selected @endif>{{$country->label}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group form-inline">
|
||||
<label class="col-form-label col-md-4 d-flex justify-content-start">Société</label>
|
||||
<select class="custom-select col-md-8" name="society_id">
|
||||
|
|
|
|||
|
|
@ -34,10 +34,20 @@
|
|||
</div>
|
||||
@endif
|
||||
<div class="form-group">
|
||||
<input class="form-control" type="text" name="name" placeholder="Nom *" value="{{$p->name}}" required>
|
||||
<label for="name"><small>{{ __('Nom') }}</small></label>
|
||||
<input id="name" class="form-control" type="text" name="name" placeholder="Nom *" value="{{$p->name}}" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input class="form-control" type="text" name="portion_description" placeholder="Descriptif de la portion *" value="{{$p->portion_description}}" required>
|
||||
<label for="seo_title"><small>{{ __('Seo Titre') }}</small></label>
|
||||
<input id="seo_title" class="form-control" type="text" name="seo_title" placeholder="Seo Titre" value="{{$p->seo_title}}" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="seo_description"><small>{{ __('Seo Description') }}</small></label>
|
||||
<input id="seo_description" class="form-control" type="text" name="seo_description" placeholder="Seo description" value="{{$p->seo_description}}" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="portion_description"><small>{{ __('Descriptif de la portion *') }}</small></label>
|
||||
<input id="portion_description" class="form-control" type="text" name="portion_description" placeholder="Descriptif de la portion *" value="{{$p->portion_description}}" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Visuel * de type JPEG/PNG - 2Mo max. - 324 x 328px</label></br>
|
||||
|
|
@ -47,7 +57,8 @@
|
|||
<img src="{{ asset($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}}">
|
||||
<label for="tags"><small>{{ __('Tags') }}</small></label>
|
||||
<input id="tags" class="form-control" type="text" name="tags" placeholder="Tags (séparé par des points virgules)" value="{{$p->tags}}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input class="form-control" type="text" name="subtitle" placeholder="Sous titre *" value="{{$p->subtitle}}" required>
|
||||
|
|
@ -55,25 +66,32 @@
|
|||
<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}}">
|
||||
<label for="info1"><small>{{ __('Info1') }}</small></label>
|
||||
<input id="info1" class="form-control" type="text" name="info1" placeholder="Information n°1" value="{{$p->info1}}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input class="form-control" type="text" name="info2" placeholder="Information n°2" value="{{$p->info2}}">
|
||||
<label for="info2"><small>{{ __('Info2') }}</small></label>
|
||||
<input id="info2" class="form-control" type="text" name="info2" placeholder="Information n°2" value="{{$p->info2}}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input class="form-control" type="text" name="description" placeholder="Descriptif" value="{{$p->description}}">
|
||||
<label for="description"><small>{{ __('Description') }}</small></label>
|
||||
<input id="description" class="form-control" type="text" name="description" placeholder="Descriptif" value="{{$p->description}}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input class="form-control" type="number" name="number_portion" placeholder="Nombre de portion" value="{{$p->number_portion}}">
|
||||
<label for="number_portion"><small>{{ __('Number_portion') }}</small></label>
|
||||
<input id="number_portion" class="form-control" type="number" name="number_portion" placeholder="Nombre de portion" value="{{$p->number_portion}}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input class="form-control" type="text" name="type_portion" placeholder="Type de portion" value="{{$p->type_portion}}">
|
||||
<label for="type_portion"><small>{{ __('Type_portion') }}</small></label>
|
||||
<input id="type_portion" class="form-control" type="text" name="type_portion" placeholder="Type de portion" value="{{$p->type_portion}}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input class="form-control" type="text" name="theoretical_average_weight" placeholder="Poids moyen théorique" value="{{$p->theoretical_average_weight}}">
|
||||
<label for="theoretical_average_weight"><small>{{ __('theoretical_average_weight') }}</small></label>
|
||||
<input id="theoretical_average_weight" class="form-control" type="text" name="theoretical_average_weight" placeholder="Poids moyen théorique" value="{{$p->theoretical_average_weight}}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input class="form-control" type="text" name="other_format" placeholder="Autre format" value="{{$p->other_format}}">
|
||||
<label for="other_format"><small>{{ __('Other_format') }}</small></label>
|
||||
<input id="other_format" class="form-control" type="text" name="other_format" placeholder="Autre format" value="{{$p->other_format}}">
|
||||
</div>
|
||||
<div class="form-group form-inline">
|
||||
<label class="col-form-label col-md-4 d-flex justify-content-start">Gamme *</label>
|
||||
|
|
@ -91,7 +109,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)
|
||||
@if ($meatType->id === $p->meat_type->id)
|
||||
@if ($meatType->id === $p->meatType->id)
|
||||
<option value="{{$meatType->id}}" selected>{{$meatType->name}}</option>
|
||||
@else
|
||||
<option value="{{$meatType->id}}">{{$meatType->name}}</option>
|
||||
|
|
@ -159,48 +177,48 @@
|
|||
<tbody>
|
||||
<tr>
|
||||
<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->incoNutritionalValues->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->incoNutritionalValues->energy_percent }}"></td>
|
||||
<td class="w-25"><input class="form-control form-control-sm w-100 h-100" type="number" step=".01" name="energy" value="{{ $p->incoNutritionalValues->energy ?? 0}}"></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->incoNutritionalValues->energy_percent ?? 0 }}"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Énergie kJ</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->incoNutritionalValues->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->incoNutritionalValues->energy_kj_percent }}"></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->incoNutritionalValues->energy_kj ?? 0}}"></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->incoNutritionalValues->energy_kj_percent ?? 0}}"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Protéines</td>
|
||||
<td class="w-25"><input class="form-control form-control-sm w-100 h-100" type="number" step=".01" name="protein" value="{{ $p->incoNutritionalValues->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->incoNutritionalValues->protein_percent }}"></td>
|
||||
<td class="w-25"><input class="form-control form-control-sm w-100 h-100" type="number" step=".01" name="protein" value="{{ $p->incoNutritionalValues->protein ?? 0 }}"></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->incoNutritionalValues->protein_percent ?? 0}}"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Glucides</td>
|
||||
<td class="w-25"><input class="form-control form-control-sm w-100 h-100" type="number" step=".01" name="carbohydrates" value="{{ $p->incoNutritionalValues->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->incoNutritionalValues->carbohydrates_percent }}"></td>
|
||||
<td class="w-25"><input class="form-control form-control-sm w-100 h-100" type="number" step=".01" name="carbohydrates" value="{{ $p->incoNutritionalValues->carbohydrates ?? 0}}"></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->incoNutritionalValues->carbohydrates_percent ?? 0}}"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Sucres</td>
|
||||
<td class="w-25"><input class="form-control form-control-sm w-100 h-100" type="number" step=".01" name="sugar" value="{{ $p->incoNutritionalValues->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->incoNutritionalValues->sugar_percent }}"></td>
|
||||
<td class="w-25"><input class="form-control form-control-sm w-100 h-100" type="number" step=".01" name="sugar" value="{{ $p->incoNutritionalValues->sugar ?? 0}}"></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->incoNutritionalValues->sugar_percent ?? 0}}"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Matière grasse</td>
|
||||
<td class="w-25"><input class="form-control form-control-sm w-100 h-100" type="number" step=".01" name="fat" value="{{ $p->incoNutritionalValues->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->incoNutritionalValues->fat_percent }}"></td>
|
||||
<td class="w-25"><input class="form-control form-control-sm w-100 h-100" type="number" step=".01" name="fat" value="{{ $p->incoNutritionalValues->fat ?? 0}}"></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->incoNutritionalValues->fat_percent ?? 0}}"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Acides Gras Saturés</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->incoNutritionalValues->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->incoNutritionalValues->saturated_fatty_acids_percent }}"></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->incoNutritionalValues->saturated_fatty_acids ?? 0}}"></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->incoNutritionalValues->saturated_fatty_acids_percent ?? 0 }}"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Fibres alimentaires</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->incoNutritionalValues->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->incoNutritionalValues->dietary_fiber_percent }}"></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->incoNutritionalValues->dietary_fiber ?? 0 }}"></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->incoNutritionalValues->dietary_fiber_percent ?? 0}}"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Sel</td>
|
||||
<td class="w-25"><input class="form-control form-control-sm w-100 h-100" type="number" step=".01" name="salt" value="{{ $p->incoNutritionalValues->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->incoNutritionalValues->salt_percent }}"></td>
|
||||
<td class="w-25"><input class="form-control form-control-sm w-100 h-100" type="number" step=".01" name="salt" value="{{ $p->incoNutritionalValues->salt ?? 0}}"></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->incoNutritionalValues->salt_percent ?? 0}}"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
@ -237,19 +255,6 @@
|
|||
<div class="form-group">
|
||||
<input class="form-control" type="text" name="consumption_label" placeholder="Libéllé de consommation" value="{{$p->consumption_label}}">
|
||||
</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)
|
||||
@if ($p->country != null && $country->id === $p->country->id)
|
||||
<option value="{{$country->id}}" selected>{{$country->label}}</option>
|
||||
@else
|
||||
<option value="{{$country->id}}">{{$country->label}}</option>
|
||||
@endif
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group form-inline">
|
||||
<label class="col-form-label col-md-4 d-flex justify-content-start">Société</label>
|
||||
<select class="custom-select col-md-8" name="society_id">
|
||||
|
|
|
|||
|
|
@ -23,13 +23,24 @@
|
|||
</div>
|
||||
@endif
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" name="title" placeholder="Titre *" value="{{ old('title') }}" required>
|
||||
<label for="title"><small>{{ __('Titre') }}</small></label>
|
||||
<input id="title" 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" value="{{ old('catch_phrase') }}">
|
||||
<label for="description"><small>{{ __('Description') }}</small></label>
|
||||
<input id="description" 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)" value="{{ old('tags') }}">
|
||||
<label for="seo_title"><small>{{ __('Seo titre') }}</small></label>
|
||||
<input id="seo_title" type="text" class="form-control" name="seo_title" placeholder="Seo titre" value="{{ old('seo_title') }}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="seo_description"><small>{{ __('Seo description') }}</small></label>
|
||||
<input id="seo_description" type="text" class="form-control" name="seo_description" placeholder="Seo description" value="{{ old('seo_description') }}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="tags"><small>{{ __('Tags') }}</small></label>
|
||||
<input id="tags" 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>
|
||||
|
|
@ -52,14 +63,12 @@
|
|||
</div>
|
||||
<div class="form-group">
|
||||
<label>Genre</label></br>
|
||||
@foreach(RecipeType::toArray() as $rType)
|
||||
<label class="col-md-6">
|
||||
<input type="radio" id="type" name="type" value="0">
|
||||
Vidéo
|
||||
</label>
|
||||
<label class="col-md-6">
|
||||
<input type="radio" id="type" name="type" value="1" checked>
|
||||
Classique
|
||||
<input type="radio" name="type" value="{{ $rType->value }}" @if ($rType->value === 1)checked @endif>
|
||||
{{ $rType->label }}
|
||||
</label>
|
||||
@endforeach
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" id="video_link" name="video_link" placeholder="Lien de la video *" value="{{ old('video_link') }}">
|
||||
|
|
@ -82,10 +91,9 @@
|
|||
<div class="form-group col-md-6 row">
|
||||
<label class="col-md-5 col-form-label">Difficulté</label>
|
||||
<select class="custom-select col-md-7" name="difficulty">
|
||||
<option value="1" selected>Très facile</option>
|
||||
<option value="2">Facile</option>
|
||||
<option value="3">Confirmé</option>
|
||||
<option value="4">Expert</option>
|
||||
@foreach(RecipeDifficulty::toArray() as $rDifficulty)
|
||||
<option value="{{ $rDifficulty->value }}" @if ($rDifficulty->value === 1)selected @endif>{{ $rDifficulty->label }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -8,8 +8,7 @@
|
|||
<form action="{{route('bo.recipes.destroy', $r->id)}}" method="POST" class="d-inline">
|
||||
@method('DELETE')
|
||||
@csrf
|
||||
<input type="submit" class="btn btn-sm btn-danger float-right" value="Supprimer"
|
||||
onclick="return confirm('Êtes-vous sûr(e) ?')">
|
||||
<input type="submit" class="btn btn-sm btn-danger float-right" value="Supprimer" onclick="return confirm('Êtes-vous sûr(e) ?')">
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
|
@ -34,13 +33,24 @@
|
|||
</div>
|
||||
@endif
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" name="title" placeholder="Titre *" value="{{$r->title}}" required>
|
||||
<label for="title"><small>{{ __('Titre') }}</small></label>
|
||||
<input id="title" type="text" class="form-control" name="title" placeholder="Titre *" value="{{$r->title}}" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" name="catch_phrase" placeholder="Accroche" value="{{$r->catch_phrase}}">
|
||||
<label for="description"><small>{{ __('Description') }}</small></label>
|
||||
<input id="description" type="text" class="form-control" name="catch_phrase" placeholder="Accroche" value="{{$r->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)" value="{{$r->tags}}">
|
||||
<label for="seo_title"><small>{{ __('Seo titre') }}</small></label>
|
||||
<input id="seo_title" type="text" class="form-control" name="seo_title" placeholder="Seo titre" value="{{$r->seo_title}}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="seo_description"><small>{{ __('Seo description') }}</small></label>
|
||||
<input id="seo_description" type="text" class="form-control" name="seo_description" placeholder="Seo description" value="{{$r->seo_description}}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="tags"><small>{{ __('Tags') }}</small></label>
|
||||
<input id="tags" type="text" class="form-control" name="tags" placeholder="Tags * (séparer les tags par des points-virgules, ex : frais;plat)" value="{{$r->tags}}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Visuel * de type JPEG/PNG - 2Mo max. - 683 x 434px</label>
|
||||
|
|
@ -66,14 +76,12 @@
|
|||
</div>
|
||||
<div class="form-group">
|
||||
<label>Genre</label><br>
|
||||
@foreach(RecipeType::toArray() as $rType)
|
||||
<label class="col-md-6">
|
||||
<input type="radio" name="type" value="0" @if ($r->type->value === 0)checked @endif>
|
||||
Vidéo
|
||||
</label>
|
||||
<label class="col-md-6">
|
||||
<input type="radio" name="type" value="1" @if ($r->type->value === 1)checked @endif>
|
||||
Classique
|
||||
<input type="radio" name="type" value="{{ $rType->value }}" @if ($rType->value === 1)checked @endif>
|
||||
{{ $rType->label }}
|
||||
</label>
|
||||
@endforeach
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" id="video_link" name="video_link" placeholder="Lien de la video *" value="{{$r->video_link}}">
|
||||
|
|
@ -96,10 +104,9 @@
|
|||
<div class="form-group col-md-6 row">
|
||||
<label class="col-md-5 col-form-label">Difficulté</label>
|
||||
<select class="custom-select col-md-7" name="difficulty">
|
||||
<option value="1" @if ($r->difficulty === 1)selected @endif>Très facile</option>
|
||||
<option value="2" @if ($r->difficulty === 2)selected @endif>Facile</option>
|
||||
<option value="3" @if ($r->difficulty === 3)selected @endif>Confirmé</option>
|
||||
<option value="4" @if ($r->difficulty === 4)selected @endif>Expert</option>
|
||||
@foreach(RecipeDifficulty::toArray() as $rDifficulty)
|
||||
<option value="{{ $rDifficulty->value }}" @if ($rDifficulty->value === 1)selected @endif>{{ $rDifficulty->label }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
<h1>{{ $product->name }}</h1>
|
||||
<h2>{{ $product->subtitle }}</h2>
|
||||
<div class="tags">
|
||||
@foreach (explode('#|#', $product->tags) as $tag)
|
||||
@foreach (explode(';', $product->tags) as $tag)
|
||||
<p class="@if ($product->range->slug === 'le-vegetal') green @else orange @endif">{{ $tag }}</p>
|
||||
@endforeach
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -81,9 +81,9 @@ Route::prefix('bo')
|
|||
Route::resource('ocb', 'ContentOCBController');
|
||||
Route::resource('product-pictograms', 'ProductPictogramsController');
|
||||
Route::resource('product-slider-pictures', 'ProductSliderPicturesController');
|
||||
Route::resource('products', 'ProductsController');
|
||||
Route::resource('products', 'ProductsController')->except(['show']);
|
||||
Route::resource('ranges', 'RangesController');
|
||||
Route::resource('recipes', 'RecipesController');
|
||||
Route::resource('recipes', 'RecipesController')->except(['show']);
|
||||
Route::resource('users', 'UsersController');
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue