ldc-volena/resources/views/bo/pages/sections/form.blade.php

150 lines
7.1 KiB
PHP

<div class="row">
{{-- PAGE_ID --}}
<div class="col-12 col-md-6 mb-3">
<fieldset class="h-100 border p-3">
<legend>{{ Str::ucfirst(trans_choice('models.classes.static_page', '1')) }}</legend>
<div class="row">
<div class="col-12">
@include('bo.partials.inputs.bigint-foreign-id', [
'id' => 'sectionPage',
'label' => __(':field :inter:model', [
'field' => Str::ucfirst(trans_choice('models.classes.static_page', '1')),
'inter' => __('validation.custom.of_the.female'),
'model' => trans_choice('models.classes.section', 1),
]),
'name' => 'page_id',
'disabled' => true,
'required' => false,
'model' => $sectionModel ?? null,
'associatedModels' => [$sectionModel->page] ?? null,
'foreignLabel' => 'title',
'helper' => '',
])
</div>
</div>
</fieldset>
</div>
{{-- SECTION --}}
<div class="col-12 col-md-6 mb-3">
<fieldset class="h-100 border p-3">
<legend>{{ Str::ucfirst(trans_choice('models.classes.section', 1)) }}</legend>
<div class="row">
<div class="col-12">
@include('bo.partials.inputs.tinyint-enum', [
'id' => 'sectionSection',
'label' => __('Section associée'),
'name' => 'section',
'model' => $sectionModel ?? null,
'required' => false,
'disabled' => true,
'associatedModels' => \App\Enums\Sections\PageSectionEnum::toArray(),
'helper' => '',
])
</div>
</div>
</fieldset>
</div>
{{-- H2_TITLE --}}
<div class="col-12 col-md-6 mb-3">
<fieldset class="h-100 border p-3">
<legend>{{ Str::ucfirst(__('validation.custom.h2_title')) }}</legend>
<div class="row">
<div class="col-12">
@include('bo.partials.inputs.varchar', [
'id' => 'sectionH2Title',
'label' => __(':field :inter:model', [
'field' => Str::ucfirst(__('validation.custom.h2_title')),
'inter' => __('validation.custom.of_the.female'),
'model' => trans_choice('models.classes.section', 1),
]),
'hasWordCounter' => true,
'name' => 'h2_title',
'required' => true,
'model' => $sectionModel ?? null,
'helper' => __('validation.between.string', [
'attribute' => __(':field :inter:model', [
'field' => Str::ucfirst(__('validation.custom.h2_title')),
'inter' => __('validation.custom.of_the.female'),
'model' => trans_choice('models.classes.section', 1),
]),
'min' => 3,
'max' => 255,
]),
'placeholder' => __('Un titre clair et concis'),
])
</div>
</div>
</fieldset>
</div>
@if (
!in_array($sectionModel->section, [
\App\Enums\Sections\PageSectionenum::hire_grow,
\App\Enums\Sections\PageSectionenum::produce_networks,
])
)
{{-- CONTENT --}}
<div class="col-12 mb-3">
<fieldset class="border p-3">
<legend>{{ Str::ucfirst(__('validation.attributes.content')) }}</legend>
<div class="row mb-3">
<div class="col-12">
@include('bo.partials.inputs.text-html', [
'id' => 'sectionText',
'label' => __(':field :inter:model', [
'field' => Str::ucfirst(__('validation.custom.first_content')),
'inter' => __('validation.custom.of_the.female'),
'model' => trans_choice('models.classes.section', 1),
]),
'name' => 'text',
'model' => $sectionModel ?? null,
'required' => true,
'editorConfig' => $sectionModel->section->getFirstWysiwygType(),
'helper' => __('crud.minicrud.text_warning'),
])
</div>
</div>
</fieldset>
</div>
@endif
@if ($sectionModel->data)
{{-- MINICRUD --}}
<div class="col-12 mb-3">
<button class="btn btn-primary col-form-label rounded-0 dropdown-toggle w-100" data-bs-toggle="collapse"
data-bs-target="#minicrud" type="button" aria-expanded="false" aria-controls="minicrud">
<b>{{ Str::ucfirst(__('validation.custom.specific_content')) }}</b>
</button>
<div class="collapse" id="minicrud">
<div class="card card-body rounded-0">
<div class="row mb-3">
<div class="col">
@can('addPartPiece', $sectionModel)
<a class="btn btn-primary"
href="{{ route('bo.sections.addpartpiece', $sectionModel) }}">{{ __('Ajouter une partie') }}</a>
@endcan
@can('removePartPiece', $sectionModel)
<div class="btn-group">
@for ($i = 1; $i <= $sectionModel->countPartPieces(); $i++)
<a class="btn btn-danger confirmDeleteByLinkTS"
href="{{ route('bo.sections.removepartpiece', [
'section' => $sectionModel,
'index' => $i,
]) }}">{{ __('Enlever partie :index', ['index' => $i]) }}</a>
@endfor
</div>
@endcan
</div>
</div>
<div class="row">
@include('modules.minicrud-form-inputs', [
'data' => $sectionModel->data,
'model' => $sectionModel,
])
</div>
</div>
</div>
</div>
@endif
<div class="col-12 text-center">
<p><b>{{ __('* Champs obligatoires') }}</b></p>
</div>
</div>