703 lines
36 KiB
PHP
703 lines
36 KiB
PHP
<div class="row">
|
|
{{-- GENERAL INFORMATIONS --}}
|
|
<div class="col-12 pb-3">
|
|
<fieldset class="h-100 border bg-white p-3">
|
|
<legend>{{ __('Informations générales') }}</legend>
|
|
<div class="row mb-3">
|
|
{{-- TITLE --}}
|
|
<div class="col-12 col-md-6 m-md-0 mb-3">
|
|
@include('bo.partials.inputs.varchar', [
|
|
'id' => 'newsTitle',
|
|
'label' => __(':field de :model', [
|
|
'field' => Str::ucfirst(__('validation.attributes.title')),
|
|
'model' => Str::singular($currentType->label()),
|
|
]),
|
|
'hasWordCounter' => true,
|
|
'name' => 'title',
|
|
'required' => true,
|
|
'model' => $adviceModel ?? null,
|
|
'helper' => __('validation.between.string', [
|
|
'attribute' => __(':field de :model', [
|
|
'field' => Str::ucfirst(__('validation.attributes.title')),
|
|
'model' => Str::singular($currentType->label()),
|
|
]),
|
|
'min' => 3,
|
|
'max' => 255,
|
|
]),
|
|
'placeholder' => __(':field de :model', [
|
|
'field' => Str::ucfirst(__('validation.attributes.title')),
|
|
'model' => Str::singular($currentType->label()),
|
|
]),
|
|
])
|
|
</div>
|
|
{{-- CATEGORIES --}}
|
|
<div class="col-12 col-md-6 m-md-0 mb-3">
|
|
@include('bo.partials.inputs.pivot-belongsToMany', [
|
|
'id' => 'adviceTags',
|
|
'label' => __(':field de :model', [
|
|
'field' => Str::ucfirst(__('models.classes.tags')),
|
|
'model' => Str::singular($currentType->label()),
|
|
]),
|
|
'name' => 'tags',
|
|
'model' => $adviceModel ?? null,
|
|
'itemsList' => $adviceTags,
|
|
'itemLimit' => [0, 2],
|
|
'placeholder' => __('Rechercher une :model', [
|
|
'model' => Str::singular(Str::ucfirst(__('models.classes.tags'))),
|
|
]),
|
|
'helper' => __('Séléctionnez les :model1 à associer à cette :model2 (minimum :min, maximum :max)', [
|
|
'model1' => __('models.classes.tags'),
|
|
'model2' => Str::singular($currentType->label()),
|
|
'min' => 0,
|
|
'max' => 2,
|
|
]),
|
|
'required' => true,
|
|
])
|
|
</div>
|
|
{{-- TYPE --}}
|
|
<div class="d-none">
|
|
<input name="type" value="{{ old('type', $adviceModel->type ?? $currentType) }}">
|
|
</div>
|
|
</div>
|
|
</fieldset>
|
|
</div>
|
|
{{-- SEO --}}
|
|
<div class="col-12 mb-3">
|
|
<fieldset class="h-100 border bg-white p-3">
|
|
<legend>{{ Str::ucfirst(__('validation.attributes.seo')) }}</legend>
|
|
<div class="row">
|
|
{{-- SEO_TITLE --}}
|
|
<div class="col-12 col-md-6 mb-3">
|
|
@include('bo.partials.inputs.varchar', [
|
|
'id' => 'adviceSeoTitle',
|
|
'label' => __(':field de :model', [
|
|
'field' => Str::ucfirst(__('validation.attributes.seo_title')),
|
|
'model' => Str::singular($currentType->label()),
|
|
]),
|
|
'hasWordCounter' => true,
|
|
'name' => 'seo_title',
|
|
'required' => true,
|
|
'model' => $adviceModel ?? null,
|
|
'helper' =>
|
|
__('validation.between.string', [
|
|
'attribute' => __(':field de :model', [
|
|
'field' => Str::ucfirst(__('validation.attributes.seo_title')),
|
|
'model' => Str::singular($currentType->label()),
|
|
]),
|
|
'min' => 40,
|
|
'max' => 70,
|
|
]) . __(' Balise <title>.'),
|
|
'placeholder' => __(':field de :model', [
|
|
'field' => Str::ucfirst(__('validation.attributes.seo_title')),
|
|
'model' => Str::singular($currentType->label()),
|
|
]),
|
|
])
|
|
</div>
|
|
{{-- SEO_DESCRIPTION --}}
|
|
<div class="col-12 col-md-6 mb-3">
|
|
@include('bo.partials.inputs.varchar-multiline', [
|
|
'id' => 'adviceSeoDescription',
|
|
'label' => __(':field de :model', [
|
|
'field' => Str::ucfirst(__('validation.attributes.seo_description')),
|
|
'model' => Str::singular($currentType->label()),
|
|
]),
|
|
'name' => 'seo_description',
|
|
'model' => $adviceModel ?? null,
|
|
'required' => true,
|
|
'helper' =>
|
|
__('validation.between.string', [
|
|
'attribute' => __(':field de :model', [
|
|
'field' => Str::ucfirst(__('validation.attributes.seo_description')),
|
|
'model' => Str::singular($currentType->label()),
|
|
]),
|
|
'min' => 50,
|
|
'max' => 160,
|
|
]) . __(' Balise <meta> description.'),
|
|
'placeholder' => __(':field de :model', [
|
|
'field' => Str::ucfirst(__('validation.attributes.seo_description')),
|
|
'model' => Str::singular($currentType->label()),
|
|
]),
|
|
])
|
|
</div>
|
|
</div>
|
|
</fieldset>
|
|
</div>
|
|
@if ($currentType == \App\Enums\Advices\AdviceTypeEnum::recipes)
|
|
{{-- CARACTERISTICS --}}
|
|
<div class="col-12 pb-3">
|
|
<fieldset class="h-100 border bg-white p-3">
|
|
<legend>{{ __('Caractéristiques') }}</legend>
|
|
<div class="row">
|
|
{{-- COOKING TIME --}}
|
|
<div class="col-12 col-md-6 m-md-0 mb-3">
|
|
@include('bo.partials.inputs.varchar', [
|
|
'id' => 'adviceCookingTime',
|
|
'label' => __(':field de :model', [
|
|
'field' => Str::ucfirst(__('validation.attributes.cooking_time')),
|
|
'model' => Str::singular($currentType->label()),
|
|
]),
|
|
'hasWordCounter' => true,
|
|
'name' => 'cooking_time',
|
|
'required' => true,
|
|
'model' => $adviceModel ?? null,
|
|
'helper' => __('validation.between.string', [
|
|
'attribute' => __(':field de :model', [
|
|
'field' => Str::ucfirst(__('validation.attributes.cooking_time')),
|
|
'model' => Str::singular($currentType->label()),
|
|
]),
|
|
'min' => 3,
|
|
'max' => 255,
|
|
]),
|
|
'placeholder' => __(':field de :model', [
|
|
'field' => Str::ucfirst(__('validation.attributes.cooking_time')),
|
|
'model' => Str::singular($currentType->label()),
|
|
]),
|
|
])
|
|
</div>
|
|
{{-- PREPARATION TIME --}}
|
|
<div class="col-12 col-md-6 m-md-0 mb-3">
|
|
@include('bo.partials.inputs.varchar', [
|
|
'id' => 'advicePreparationTime',
|
|
'label' => __(':field de :model', [
|
|
'field' => Str::ucfirst(__('validation.attributes.preparation_time')),
|
|
'model' => Str::singular($currentType->label()),
|
|
]),
|
|
'hasWordCounter' => true,
|
|
'name' => 'preparation_time',
|
|
'required' => true,
|
|
'model' => $adviceModel ?? null,
|
|
'helper' => __('validation.between.string', [
|
|
'attribute' => __(':field de :model', [
|
|
'field' => Str::ucfirst(__('validation.attributes.preparation_time')),
|
|
'model' => Str::singular($currentType->label()),
|
|
]),
|
|
'min' => 3,
|
|
'max' => 255,
|
|
]),
|
|
'placeholder' => __(':field de :model', [
|
|
'field' => Str::ucfirst(__('validation.attributes.preparation_time')),
|
|
'model' => Str::singular($currentType->label()),
|
|
]),
|
|
])
|
|
</div>
|
|
{{-- DIFFICULTY --}}
|
|
<div class="col-12 col-md-6 mb-3">
|
|
@include('bo.partials.inputs.tinyint-enum', [
|
|
'id' => 'adviceDifficulty',
|
|
'label' => Str::ucfirst(__('validation.attributes.difficulty')),
|
|
'name' => 'difficulty',
|
|
'model' => $adviceModel ?? null,
|
|
'required' => true,
|
|
'associatedModels' => \App\Enums\Advices\AdviceDifficultyEnum::toArray(),
|
|
'helper' => __('validation.custom.select_entity', [
|
|
'entity' => __('une ') . Str::ucfirst(__('validation.attributes.difficulty')),
|
|
]),
|
|
])
|
|
</div>
|
|
</div>
|
|
</fieldset>
|
|
</div>
|
|
@endif
|
|
{{-- PICTURE --}}
|
|
<div class="col-12 mb-3">
|
|
<fieldset class="h-100 border bg-white p-3">
|
|
<legend>{{ Str::ucfirst(__('validation.attributes.picture')) }}</legend>
|
|
<div class="row">
|
|
{{-- PICTURE_ALT --}}
|
|
<div class="col-12 col-md-6 mb-3">
|
|
@include('bo.partials.inputs.varchar', [
|
|
'id' => 'advicePictureAlt',
|
|
'label' => __(':field1 de l\':field2 de la :model', [
|
|
'field1' => Str::ucfirst(__('validation.attributes.attribute_alt')),
|
|
'field2' => Str::ucfirst(__('validation.attributes.picture')),
|
|
'model' => Str::singular($currentType->label()),
|
|
]),
|
|
'hasWordCounter' => true,
|
|
'name' => 'picture_alt',
|
|
'required' => true,
|
|
'model' => $adviceModel ?? null,
|
|
'helper' => __('validation.custom.image_alt'),
|
|
'placeholder' => __(':field1 de l\':field2 de la :model', [
|
|
'field1' => Str::ucfirst(__('validation.attributes.attribute_alt')),
|
|
'field2' => Str::ucfirst(__('validation.attributes.picture')),
|
|
'model' => Str::singular($currentType->label()),
|
|
]),
|
|
])
|
|
</div>
|
|
{{-- PICTURE_TITLE --}}
|
|
<div class="col-12 col-md-6 mb-3">
|
|
@include('bo.partials.inputs.varchar', [
|
|
'id' => 'advicePictureTitle',
|
|
'label' => __(':field1 de l\':field2 de la :model', [
|
|
'field1' => Str::ucfirst(__('validation.attributes.attribute_title')),
|
|
'field2' => Str::ucfirst(__('validation.attributes.picture')),
|
|
'model' => Str::singular($currentType->label()),
|
|
]),
|
|
'hasWordCounter' => true,
|
|
'name' => 'picture_title',
|
|
'required' => true,
|
|
'model' => $adviceModel ?? null,
|
|
'helper' => __('validation.custom.image_title'),
|
|
'label' => __(':field1 de l\':field2 de la :model', [
|
|
'field1' => Str::ucfirst(__('validation.attributes.attribute_title')),
|
|
'field2' => Str::ucfirst(__('validation.attributes.picture')),
|
|
'model' => Str::singular($currentType->label()),
|
|
]),
|
|
'placeholder' => __(':field1 de l\':field2 de la :model', [
|
|
'field1' => Str::ucfirst(__('validation.attributes.attribute_title')),
|
|
'field2' => Str::ucfirst(__('validation.attributes.picture')),
|
|
'model' => Str::singular($currentType->label()),
|
|
]),
|
|
])
|
|
</div>
|
|
{{-- PICTURE --}}
|
|
<div class="col-12">
|
|
@include('bo.partials.inputs.varchar-picture', [
|
|
'id' => 'advicePicture',
|
|
'name' => 'picture',
|
|
'width' => 650,
|
|
'height' => 690,
|
|
'model' => $adviceModel ?? null,
|
|
'helper' => __('validation.custom.dimensions_must_be', [
|
|
'widthpx' => '650px',
|
|
'heightpx' => '690px',
|
|
]),
|
|
'required' => true,
|
|
'preview' => true,
|
|
])
|
|
</div>
|
|
</div>
|
|
</fieldset>
|
|
</div>
|
|
{{-- STICKER --}}
|
|
<div class="col-12 mb-3">
|
|
<fieldset class="h-100 border bg-white p-3">
|
|
<legend>{{ Str::ucfirst(__('validation.attributes.picture_thumbnail')) }}</legend>
|
|
<div class="row">
|
|
{{-- STICKER_ALT --}}
|
|
<div class="col-12 col-md-6 mb-3">
|
|
@include('bo.partials.inputs.varchar', [
|
|
'id' => 'adviceStickerAlt',
|
|
'label' => __(':field1 de l\':field2 de la :model', [
|
|
'field1' => Str::ucfirst(__('validation.attributes.attribute_alt')),
|
|
'field2' => Str::ucfirst(__('validation.attributes.picture')),
|
|
'model' => Str::singular($currentType->label()),
|
|
]),
|
|
'hasWordCounter' => true,
|
|
'name' => 'sticker_alt',
|
|
'required' => true,
|
|
'model' => $adviceModel ?? null,
|
|
'helper' => __('validation.custom.image_alt'),
|
|
'placeholder' => __(':field1 de l\':field2 de la :model', [
|
|
'field1' => Str::ucfirst(__('validation.attributes.attribute_alt')),
|
|
'field2' => Str::ucfirst(__('validation.attributes.picture')),
|
|
'model' => Str::singular($currentType->label()),
|
|
]),
|
|
])
|
|
</div>
|
|
{{-- STICKER_TITLE --}}
|
|
<div class="col-12 col-md-6 mb-3">
|
|
@include('bo.partials.inputs.varchar', [
|
|
'id' => 'adviceStickerTitle',
|
|
'label' => __(':field1 de l\':field2 de la :model', [
|
|
'field1' => Str::ucfirst(__('validation.attributes.attribute_title')),
|
|
'field2' => Str::ucfirst(__('validation.attributes.picture')),
|
|
'model' => Str::singular($currentType->label()),
|
|
]),
|
|
'hasWordCounter' => true,
|
|
'name' => 'sticker_title',
|
|
'required' => true,
|
|
'model' => $adviceModel ?? null,
|
|
'helper' => __('validation.custom.image_title'),
|
|
'label' => __(':field1 de l\':field2 de la :model', [
|
|
'field1' => Str::ucfirst(__('validation.attributes.attribute_title')),
|
|
'field2' => Str::ucfirst(__('validation.attributes.picture')),
|
|
'model' => Str::singular($currentType->label()),
|
|
]),
|
|
'placeholder' => __(':field1 de l\':field2 de la :model', [
|
|
'field1' => Str::ucfirst(__('validation.attributes.attribute_title')),
|
|
'field2' => Str::ucfirst(__('validation.attributes.picture')),
|
|
'model' => Str::singular($currentType->label()),
|
|
]),
|
|
])
|
|
</div>
|
|
{{-- STICKER --}}
|
|
<div class="col-12">
|
|
@include('bo.partials.inputs.varchar-picture', [
|
|
'id' => 'adviceSticker',
|
|
'name' => 'sticker',
|
|
'width' => 370,
|
|
'height' => 300,
|
|
'model' => $adviceModel ?? null,
|
|
'helper' => __('validation.custom.dimensions_must_be', [
|
|
'widthpx' => '370px',
|
|
'heightpx' => '300px',
|
|
]),
|
|
'required' => true,
|
|
'preview' => true,
|
|
])
|
|
</div>
|
|
</div>
|
|
</fieldset>
|
|
</div>
|
|
{{-- STICKER_SM --}}
|
|
<div class="col-12 mb-3">
|
|
<fieldset class="h-100 border bg-white p-3">
|
|
<legend>{{ Str::ucfirst(__('validation.attributes.picture_thumbnail_sm')) }}</legend>
|
|
<div class="row">
|
|
{{-- STICKER_SM_ALT --}}
|
|
<div class="col-12 col-md-6 mb-3">
|
|
@include('bo.partials.inputs.varchar', [
|
|
'id' => 'adviceStickerSmAlt',
|
|
'label' => __(':field1 de l\':field2 de la :model', [
|
|
'field1' => Str::ucfirst(__('validation.attributes.attribute_alt')),
|
|
'field2' => Str::ucfirst(__('validation.attributes.picture')),
|
|
'model' => Str::singular($currentType->label()),
|
|
]),
|
|
'hasWordCounter' => true,
|
|
'name' => 'sticker_sm_alt',
|
|
'required' => true,
|
|
'model' => $adviceModel ?? null,
|
|
'helper' => __('validation.custom.image_alt'),
|
|
'placeholder' => __(':field1 de l\':field2 de la :model', [
|
|
'field1' => Str::ucfirst(__('validation.attributes.attribute_alt')),
|
|
'field2' => Str::ucfirst(__('validation.attributes.picture')),
|
|
'model' => Str::singular($currentType->label()),
|
|
]),
|
|
])
|
|
</div>
|
|
{{-- STICKER_SM_TITLE --}}
|
|
<div class="col-12 col-md-6 mb-3">
|
|
@include('bo.partials.inputs.varchar', [
|
|
'id' => 'adviceStickerSmTitle',
|
|
'label' => __(':field1 de l\':field2 de la :model', [
|
|
'field1' => Str::ucfirst(__('validation.attributes.attribute_title')),
|
|
'field2' => Str::ucfirst(__('validation.attributes.picture')),
|
|
'model' => Str::singular($currentType->label()),
|
|
]),
|
|
'hasWordCounter' => true,
|
|
'name' => 'sticker_sm_title',
|
|
'required' => true,
|
|
'model' => $adviceModel ?? null,
|
|
'helper' => __('validation.custom.image_title'),
|
|
'label' => __(':field1 de l\':field2 de la :model', [
|
|
'field1' => Str::ucfirst(__('validation.attributes.attribute_title')),
|
|
'field2' => Str::ucfirst(__('validation.attributes.picture')),
|
|
'model' => Str::singular($currentType->label()),
|
|
]),
|
|
'placeholder' => __(':field1 de l\':field2 de la :model', [
|
|
'field1' => Str::ucfirst(__('validation.attributes.attribute_title')),
|
|
'field2' => Str::ucfirst(__('validation.attributes.picture')),
|
|
'model' => Str::singular($currentType->label()),
|
|
]),
|
|
])
|
|
</div>
|
|
{{-- STICKER_SM --}}
|
|
<div class="col-12">
|
|
@include('bo.partials.inputs.varchar-picture', [
|
|
'id' => 'adviceStickerSm',
|
|
'name' => 'sticker_sm',
|
|
'width' => 270,
|
|
'height' => 145,
|
|
'model' => $adviceModel ?? null,
|
|
'helper' => __('validation.custom.dimensions_must_be', [
|
|
'widthpx' => '270px',
|
|
'heightpx' => '145px',
|
|
]),
|
|
'required' => true,
|
|
'preview' => true,
|
|
])
|
|
</div>
|
|
</div>
|
|
</fieldset>
|
|
</div>
|
|
{{-- VIDEOS --}}
|
|
<div class="col-12 pb-3">
|
|
<fieldset class="h-100 border bg-white p-3">
|
|
<legend>{{ __('Vidéos') }}</legend>
|
|
<div class="row mb-3">
|
|
{{-- YOUTUBE_VIDEO_ID --}}
|
|
<div class="col-12 col-md-6 m-md-0 mb-3">
|
|
@include('bo.partials.inputs.varchar', [
|
|
'id' => 'adviceYoutubeVideoId',
|
|
'label' => __(':field1 de la :field2 de :model', [
|
|
'field1' => Str::ucfirst(__('validation.attributes.id')),
|
|
'field2' => Str::ucfirst(__('validation.attributes.youtube_video')),
|
|
'model' => Str::singular($currentType->label()),
|
|
]),
|
|
'hasWordCounter' => true,
|
|
'name' => 'youtube_video_id',
|
|
'required' => false,
|
|
'model' => $adviceModel ?? null,
|
|
'helper' => __('validation.between.string', [
|
|
'attribute' => __(':field1 de la :field2 de :model', [
|
|
'field1' => Str::ucfirst(__('validation.attributes.id')),
|
|
'field2' => Str::ucfirst(__('validation.attributes.youtube_video')),
|
|
'model' => Str::singular($currentType->label()),
|
|
]),
|
|
'min' => 3,
|
|
'max' => 255,
|
|
]),
|
|
'placeholder' => __(':field1 de la :field2 de :model', [
|
|
'field1' => Str::ucfirst(__('validation.attributes.id')),
|
|
'field2' => Str::ucfirst(__('validation.attributes.youtube_video')),
|
|
'model' => Str::singular($currentType->label()),
|
|
]),
|
|
])
|
|
</div>
|
|
{{-- YOUTUBE_TITLE --}}
|
|
<div class="col-12 col-md-6 m-md-0 mb-3">
|
|
@include('bo.partials.inputs.varchar', [
|
|
'id' => 'adviceYoutubeTitle',
|
|
'label' => __(':field1 de la :field2 de :model', [
|
|
'field1' => Str::ucfirst(__('validation.attributes.title')),
|
|
'field2' => Str::ucfirst(__('validation.attributes.youtube_video')),
|
|
'model' => Str::singular($currentType->label()),
|
|
]),
|
|
'hasWordCounter' => true,
|
|
'name' => 'youtube_title',
|
|
'required' => false,
|
|
'model' => $adviceModel ?? null,
|
|
'helper' => __('validation.between.string', [
|
|
'attribute' => __(':field1 de la :field2 de :model', [
|
|
'field1' => Str::ucfirst(__('validation.attributes.title')),
|
|
'field2' => Str::ucfirst(__('validation.attributes.youtube_video')),
|
|
'model' => Str::singular($currentType->label()),
|
|
]),
|
|
'min' => 3,
|
|
'max' => 255,
|
|
]),
|
|
'placeholder' => __(':field1 de la :field2 de :model', [
|
|
'field1' => Str::ucfirst(__('validation.attributes.title')),
|
|
'field2' => Str::ucfirst(__('validation.attributes.youtube_video')),
|
|
'model' => Str::singular($currentType->label()),
|
|
]),
|
|
])
|
|
</div>
|
|
</div>
|
|
</fieldset>
|
|
</div>
|
|
{{-- CONSEIL BLOC --}}
|
|
<div class="col-12 pb-3">
|
|
<fieldset class="h-100 border bg-white p-3">
|
|
<legend>{{ __('Bloc de conseils') }}</legend>
|
|
<div class="row">
|
|
{{-- GUESTS_NB --}}
|
|
<div class="col-12 col-md-6 m-md-0 mb-3">
|
|
@include('bo.partials.inputs.int-number', [
|
|
'id' => 'adviceGuestsNb',
|
|
'label' => __(':field de :model', [
|
|
'field' => Str::ucfirst(__('validation.attributes.guests_nb')),
|
|
'model' => Str::singular($currentType->label()),
|
|
]),
|
|
'name' => 'guests_nb',
|
|
'required' => $currentType == \App\Enums\Advices\AdviceTypeEnum::recipes ? true : false,
|
|
'model' => $adviceModel ?? null,
|
|
'min' => 0,
|
|
'max' => 99,
|
|
'helper' => __('validation.between.numeric', [
|
|
'attribute' => __(':field de :model', [
|
|
'field' => Str::ucfirst(__('validation.attributes.guests_nb')),
|
|
'model' => Str::singular($currentType->label()),
|
|
]),
|
|
'min' => 0,
|
|
'max' => 99,
|
|
]),
|
|
'placeholder' => __(':field de :model', [
|
|
'field' => Str::ucfirst(__('validation.attributes.guests_nb')),
|
|
'model' => Str::singular($currentType->label()),
|
|
]),
|
|
])
|
|
</div>
|
|
{{-- INGREDIENTS --}}
|
|
<div class="col-12 mb-3">
|
|
@include('bo.partials.inputs.text-list-items', [
|
|
'id' => 'adviceIngredients',
|
|
'name' => 'ingredients',
|
|
'label' => Str::ucfirst(__('validation.attributes.ingredients')),
|
|
'model' => $adviceModel ?? null,
|
|
'itemColumns' => [['value', 'Quantité'], ['label', 'Description']],
|
|
'itemType' => ['float', 'text'],
|
|
'itemLimit' => [1, 15],
|
|
'inputPlaceholder' => ['Quantité (nombre)', 'Mesure + ingrédients (ex: g. de sautés de poulet ou tomate(s))'],
|
|
'required' => true,
|
|
'helper' => __('validation.custom.list_items', [
|
|
'field' => Str::ucfirst(__('validation.attributes.ingredients')),
|
|
'min' => 3,
|
|
'lineMin' => 1,
|
|
'lineMax' => 15,
|
|
]),
|
|
])
|
|
</div>
|
|
{{-- PREPARATION --}}
|
|
<div class="col-12 mb-3">
|
|
@include('bo.partials.inputs.text-html', [
|
|
'id' => 'advicePreparation',
|
|
'label' => __(':field du :model', [
|
|
'field' => Str::ucfirst(__('validation.attributes.preparation')),
|
|
'model' => Str::singular($currentType->label()),
|
|
]),
|
|
'name' => 'preparation',
|
|
'model' => $adviceModel,
|
|
'required' => false,
|
|
'helper' => __('validation.custom.text_warning', [
|
|
'number' => 15,
|
|
]),
|
|
])
|
|
</div>
|
|
{{-- ADVICE --}}
|
|
<div class="col-12 mb-3">
|
|
@include('bo.partials.inputs.text-html', [
|
|
'id' => 'adviceAdvice',
|
|
'label' => __(':field du :model', [
|
|
'field' => Str::ucfirst(__('validation.attributes.advice')),
|
|
'model' => Str::singular($currentType->label()),
|
|
]),
|
|
'name' => 'advice',
|
|
'model' => $adviceModel,
|
|
'required' => false,
|
|
'helper' => __('validation.custom.text_warning', [
|
|
'number' => 15,
|
|
]),
|
|
])
|
|
</div>
|
|
</div>
|
|
</fieldset>
|
|
</div>
|
|
{{-- ASSOCIATED PRODUCTS --}}
|
|
<div class="col-12 pb-3">
|
|
<fieldset class="h-100 border bg-white p-3">
|
|
<legend>{{ __(':field associées', ['field' => Str::ucfirst(__('models.classes.products'))]) }}</legend>
|
|
<div class="row">
|
|
{{-- PRODUCTS --}}
|
|
<div class="col-12 m-md-0 mb-3">
|
|
@php $min = $currentType == \App\Enums\Advices\AdviceTypeEnum::recipes ? 1 : 0; @endphp
|
|
@include('bo.partials.inputs.pivot-belongsToMany', [
|
|
'id' => 'adviceProducts',
|
|
'label' => __(':field de :model', [
|
|
'field' => Str::ucfirst(__('models.classes.products')),
|
|
'model' => Str::singular($currentType->label()),
|
|
]),
|
|
'name' => 'products',
|
|
'model' => $adviceModel ?? null,
|
|
'itemsList' => $adviceProducts,
|
|
'itemLimit' => [$min, 3],
|
|
'placeholder' => __('Rechercher une :model', [
|
|
'model' => Str::singular(Str::ucfirst(__('models.classes.products'))),
|
|
]),
|
|
'helper' => __('Séléctionnez les :model1 à associer à cette :model2 (minimum :min, maximum :max)', [
|
|
'model1' => __('models.classes.products'),
|
|
'model2' => Str::singular($currentType->label()),
|
|
'min' => $min,
|
|
'max' => 3,
|
|
]),
|
|
'required' => true,
|
|
])
|
|
</div>
|
|
</div>
|
|
</fieldset>
|
|
</div>
|
|
{{-- RECIPES RECIPES --}}
|
|
<div class="col-12 pb-3">
|
|
<fieldset class="h-100 border bg-white p-3">
|
|
<legend>{{ __(':field associées', ['field' => Str::ucfirst(__('models.classes.recipes'))]) }}</legend>
|
|
<div class="row">
|
|
{{-- ADVICES --}}
|
|
<div class="col-12 m-md-0 mb-3">
|
|
@include('bo.partials.inputs.pivot-belongsToMany', [
|
|
'id' => 'adviceProducts',
|
|
'label' => __(':field de :model', [
|
|
'field' => Str::ucfirst(__('models.classes.recipes')),
|
|
'model' => Str::singular($currentType->label()),
|
|
]),
|
|
'name' => 'recipes',
|
|
'value' => $recipesSelected,
|
|
'itemsList' => $recipeList,
|
|
'itemLimit' => [0, 3],
|
|
'placeholder' => __('Rechercher une :model', [
|
|
'model' => Str::singular(Str::ucfirst(__('models.classes.recipes'))),
|
|
]),
|
|
'helper' => __('Séléctionnez les :model1 à associer à cette :model2 (minimum :min, maximum :max)', [
|
|
'model1' => __('models.classes.products'),
|
|
'model2' => Str::singular($currentType->label()),
|
|
'min' => 0,
|
|
'max' => 3,
|
|
]),
|
|
'required' => true,
|
|
])
|
|
</div>
|
|
</div>
|
|
</fieldset>
|
|
</div>
|
|
{{-- TIPS RECIPES --}}
|
|
<div class="col-12 pb-3">
|
|
<fieldset class="h-100 border bg-white p-3">
|
|
<legend>{{ __(':field associées', ['field' => Str::ucfirst(__('models.classes.tips'))]) }}</legend>
|
|
<div class="row">
|
|
{{-- ADVICES --}}
|
|
<div class="col-12 m-md-0 mb-3">
|
|
@include('bo.partials.inputs.pivot-belongsToMany', [
|
|
'id' => 'adviceProducts',
|
|
'label' => __(':field de :model', [
|
|
'field' => Str::ucfirst(__('models.classes.tips')),
|
|
'model' => Str::singular($currentType->label()),
|
|
]),
|
|
'name' => 'tips',
|
|
'value' => $tipsSelected,
|
|
'itemsList' => $tipList,
|
|
'itemLimit' => [0, 3],
|
|
'placeholder' => __('Rechercher une :model', [
|
|
'model' => Str::singular(Str::ucfirst(__('models.classes.tips'))),
|
|
]),
|
|
'helper' => __('Séléctionnez les :model1 à associer à cette :model2 (minimum :min, maximum :max)', [
|
|
'model1' => __('models.classes.products'),
|
|
'model2' => Str::singular($currentType->label()),
|
|
'min' => 0,
|
|
'max' => 3,
|
|
]),
|
|
'required' => true,
|
|
])
|
|
</div>
|
|
</div>
|
|
</fieldset>
|
|
</div>
|
|
{{-- STATUS --}}
|
|
<div class="col-12 pb-3">
|
|
<fieldset class="h-100 border bg-white p-3">
|
|
<legend>{{ Str::ucfirst(__('validation.attributes.published')) }}</legend>
|
|
<div class="row mb-3">
|
|
<div class="col-12">
|
|
@include('bo.partials.inputs.tinyint-boolean', [
|
|
'id' => 'adviceStatus',
|
|
'name' => 'published',
|
|
'label' => __(':model publiée ?', [
|
|
'model' => Str::singular($currentType->label()),
|
|
]),
|
|
'helper' => __('Deux réponses possibles : oui ou non.'),
|
|
'model' => $adviceModel ?? null,
|
|
])
|
|
</div>
|
|
</div>
|
|
</fieldset>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row">
|
|
<div class="col text-center">
|
|
<p class="fw-bold">{{ __('* Champs obligatoires') }}</b>
|
|
</div>
|
|
</div>
|
|
|
|
@push('scripts')
|
|
<script nonce="{{ $nonce }}">
|
|
document.addEventListener("DOMContentLoaded", () => {
|
|
// Submit button clone.
|
|
const submit = document.getElementById('formSubmit')
|
|
submitClone = document.getElementById('formSubmitClone');
|
|
submitClone.addEventListener('click', (event) => {
|
|
event.preventDefault();
|
|
submit.click('');
|
|
})
|
|
});
|
|
</script>
|
|
@endpush
|