ldc-le-gaulois-pro/resources/views/bo/pages/vips/form.blade.php
2023-01-09 10:55:21 +01:00

183 lines
9.6 KiB
PHP

<div class="row">
<div class="col">
<fieldset class="border p-3 mb-3">
<legend>{{ __('Page') }}</legend>
<div class="row mb-3">
<div class="col-12 col-md-6">
<div class="form-group">
<label for="expertiseProduct" class="col-form-label"><b>{{ __('Espèce *') }}</b></label>
<select id="expertiseProduct" class="form-select" name="page" aria-describedby="expertiseProductHelp"
required>
<option value="" @if (is_null(old('page', $vip->page->value ?? null))) selected @endif disabled>
{{ __('Séléctionnez une espèce') }}</option>
@foreach (App\Enums\ExpertiseProducts\ExpertiseProductPageEnum::toArray() as $pageEnum)
<option value="{{ $pageEnum->value }}" @if (old('page', $vip->page->value ?? null) == $pageEnum->value) selected @endif>
{{ $pageEnum->label }}</option>
@endforeach
</select>
@include('bo.modules.input-error', [
'inputName' => 'page',
'helperId' => 'expertiseProductHelp',
'helper' => __('Nom de l\'espèce.'),
])
</div>
</div>
</div>
</fieldset>
</div>
</div>
<div class="row">
<div class="col">
<fieldset class="border p-3 mb-3">
<legend>{{ __('Libellé du bloc') }}</legend>
<div class="row mb-3">
<div class="col-12 col-md-6">
<div class="form-group">
<label for="blockTitle"><b>{{ __('Libellé *') }}</b></label>
<div class="word-counter" data-json='@json(['id' => 'blockTitle'])'></div>
<input name="label" type="text" value="{{ old('label', $vip->label ?? '') }}" class="form-control need-word-counter"
id="blockTitle" aria-describedby="blockTitleHelp" placeholder="{{ __('Un nom beau et explicite') }}" required>
@include('bo.modules.input-error', [
'inputName' => 'label',
'helperId' => 'blockTitleHelp',
'helper' => __('Doit décrire le bloc (3 caractères minimum, 255 maximum).')
])
</div>
</div>
</div>
</fieldset>
</div>
</div>
<div class="row">
<div class="col">
<fieldset class="border p-3 mb-3">
<legend>{{ __('Titre et Sous-titre') }}</legend>
<div class="row mb-3">
<div class="col-12 col-md-6 mb-3">
<div class="form-group">
<label for="vipTitle"><b>{{ __('Titre *') }}</b></label>
<div class="word-counter" data-json='@json(['id' => 'vipTitle'])'></div>
<input name="title" type="text" value="{{ old('title', $vip->title ?? '') }}" class="form-control need-word-counter"
id="vipTitle" aria-describedby="vipTitleHelp" placeholder="{{ __('Un nom beau et explicite') }}" required>
@include('bo.modules.input-error', [
'inputName' => 'title',
'helperId' => 'vipTitleHelp',
'helper' => __('Doit décrire précisément le produit VIP (3 caractères minimum, 255 maximum).')
])
</div>
</div>
<div class="col-12 col-md-6 mb-3">
<div class="form-group">
<label for="vipSubTitle"><b>{{ __('Sous-titre *') }}</b></label>
<div class="word-counter" data-json='@json(['id' => 'vipSubTitle'])'></div>
<input name="subtitle" type="text" value="{{ old('subtitle', $vip->subtitle ?? '') }}" class="form-control need-word-counter"
id="vipSubTitle" aria-describedby="vipSubTitleHelp" placeholder="{{ __('Un nom beau et explicite') }}" required>
@include('bo.modules.input-error', [
'inputName' => 'subtitle',
'helperId' => 'vipSubTitleHelp',
'helper' => __('Doit décrire précisément le produit VIP (3 caractères minimum, 255 maximum).')
])
</div>
</div>
</div>
</fieldset>
</div>
</div>
<div class="row">
<div class="col">
<fieldset class="border p-3 mb-3">
<legend>{{ __('Les 4 points forts du produit') }}</legend>
<div class="row mb-3">
@for ($i = 0; $i < 4; $i++)
<div class="col-12 col-md-6 mb-3">
<div class="form-group">
<label for="txtPoint{{$i}}"><b>{{ __('Texte pour le point fort n°') }}{{$i+1}} *</b></label>
<div class="word-counter" data-json='@json(['id' => 'txtPoint' . $i])'></div>
<input name="points[{{$i}}][value]" type="text" value="{{ old('points.' . $i . '.value', $vip->points[$i]['value'] ?? '') }}" class="form-control need-word-counter"
id="txtPoint{{$i}}" aria-describedby="txtPoint{{$i}}Help" placeholder="{{ __('Un nom beau et explicite') }}" required>
@include('bo.modules.input-error', [
'inputName' => 'points.' . $i . '.value',
'helperId' => 'txtPoint' . $i . 'Help',
'helper' => __('Une phrase pour décrire un point fort du produit (3 caractères minimum, 255 maximum).')
])
</div>
</div>
@endfor
</div>
</fieldset>
</div>
</div>
<div class="row">
<div class="col">
<fieldset class="border p-3 mb-3">
<legend>{{ __('Indicateurs') }}</legend>
<div class="row mb-3">
<div class="col-12 col-md-6 form-group">
<div class="form-check form-switch">
<input id="expertiseProductFrench"
class="form-check-input"
name="is_frenchpoultry"
type="checkbox"
aria-describedby="expertiseProductFrenchHelp"
value="1"
role="button"
@if (old('is_frenchpoultry', $vip->is_frenchpoultry ?? '')) checked @endif>
<label class="form-check-label" for="expertiseProductFrench" role="button">
<b>{{ __('Volaille Française ?') }}</b>
</label>
<br>
@include('bo.modules.input-error', [
'inputName' => 'is_frenchpoultry',
'helperId' => 'expertiseProductFrenchHelp',
'helper' => __('Le produit est une volaille Française ou non'),
])
</div>
</div>
<div class="col-12 col-md-6 form-group">
<div class="form-check form-switch">
<input id="expertiseProductNE"
class="form-check-input"
name="is_natureeleveurs"
type="checkbox"
aria-describedby="expertiseProductNEHelp"
value="1"
role="button"
@if (old('is_natureeleveurs', $vip->is_natureeleveurs ?? '')) checked @endif>
<label class="form-check-label" for="expertiseProductNE" >
<b>{{ __('Nature d\'éleveur ?') }}</b>
</label>
<br>
@include('bo.modules.input-error', [
'inputName' => 'is_natureeleveurs',
'helperId' => 'expertiseProductNEHelp',
'helper' => __('Le produit est de la marque Nature d\'éleveur ou non'),
])
</div>
</div>
</div>
<div class="row mb-3">
<div class="col-12">
<div class="mb-2">
<label for="nutriscore"><b>{{ __('Nutriscore') }}</b></label>
</div>
<div class="btn-group" role="group" aria-label="Basic radio toggle button group">
@foreach (App\Enums\NutriscoreEnum::toArray() as $nutriscore)
<input type="radio"
class="btn-check"
name="nutriscore"
id="nutriscore{{$loop->index}}"
value="{{$loop->index}}"
autocomplete="off"
@if (old('nutriscore', $vip->nutriscore->value ?? '') == $nutriscore->value) checked @endif>
<label class="btn btn-outline-primary" for="nutriscore{{$loop->index}}">{{ $nutriscore->label }}</label>
@endforeach
</div>
</div>
</div>
</fieldset>
</div>
</div>