Merge branch 'develop' into trunk

This commit is contained in:
K Muller 2026-10-20 15:55:06 +02:00
commit 42f25c5cd8
20 changed files with 173 additions and 144 deletions

View file

@ -60,16 +60,16 @@ class UpdateStaticPageRequest extends UpdateMiniCrudRequest
}
// check nullable value of image's slider
if ($staticPageModel->type->equals(StaticPageType::exitOutside)) {
$test = $this->data;
foreach ($test as $key => $value) {
$curentData = $this->data;
foreach ($curentData as $key => $value) {
if (Str::startsWith($key, 'slider_image_')) {
$checkValue = isset($value['value']) ? $value['value'] : null;
$test[$key]['value'] = $checkValue;
$test[$key]['alt'] = (! is_null($checkValue) ? $value['alt'] : null);
$test[$key]['title'] = (! is_null($checkValue) ? $value['title'] : null);
$checkValue = isset($value['value']) ? $value['value'] : null;
$curentData[$key]['value'] = $checkValue;
$curentData[$key]['alt'] = (! is_null($checkValue) ? $value['alt'] : null);
$curentData[$key]['title'] = (! is_null($checkValue) ? $value['title'] : null);
}
}
$this->merge(['data' => $test]);
$this->merge(['data' => $curentData]);
}
parent::prepareForValidation();
}

View file

@ -143,30 +143,28 @@ abstract class UpdateMiniCrudRequest extends FormRequest
];
$rules = array_merge($rules, [
"data.$iptName.value" => array_merge(
[
function (string $attribute, $value, callable $fail) use ($sizes, $input) {
// Picture can be null.
if ($input['required'] || $value !== null) {
ToolboxHelper::validatePicture($attribute, $value, $fail, $sizes);
}
},
],
$this->compileValidate(
implode('|', [
$required,
'image',
'mimes:png,jpg,jpeg,svg',
sprintf(
'dimensions:%s=%d,%s=%d',
$max ? 'max_height' : 'height',
$dim['height'],
$max ? 'max_width' : 'width',
$dim['width']
),
]),
$input
),
"data.$iptName.value" => [
function (string $attribute, $value, callable $fail) use ($sizes, $input) {
// Picture can be null.
if ($input['required'] || $value !== null) {
ToolboxHelper::validatePicture($attribute, $value, $fail, $sizes);
}
},
],
$this->compileValidate(
implode('|', [
$required,
'image',
'mimes:png,jpg,jpeg,svg',
sprintf(
'dimensions:%s=%d,%s=%d',
$max ? 'max_height' : 'height',
$dim['height'],
$max ? 'max_width' : 'width',
$dim['width']
),
]),
$input
),
]);

View file

@ -1175,13 +1175,20 @@
</div>
{{-- DEMARCHES --}}
<div class="dropdown">
@php
$isApproachesActive =
(isset($exitOutsideStaticPageModel) && url()->current() === route('bo.static_pages.edit', $exitOutsideStaticPageModel))
|| (isset($ouiCestBonStaticPageModel) && url()->current() === route('bo.static_pages.edit', $ouiCestBonStaticPageModel))
|| request()->routeIs('bo.categories.approaches.*')
|| request()->routeIs('bo.sections.approaches.*');
@endphp
<button data-bs-toggle="dropdown" type="button" aria-expanded="false" @class([
'btn btn-primary text-start w-100 dropdown-toggle mt-1',
'fw active' => request()->routeIs('bo.approaches.*'),
'fw active' => $isApproachesActive,
])>
<i @class([
'fa-solid fa-people-arrows fa-fw',
'fa-lg' => request()->routeIs('bo.approaches.*'),
'fa-lg' => $isApproachesActive,
])></i>
{{ __('Démarches') }}
</button>
@ -1193,14 +1200,12 @@
@class([
'dropdown-item px-3 py-2',
'fw-bold text-bg-secondary' =>
url()->current() ===
route('bo.static_pages.edit', $exitOutsideStaticPageModel),
url()->current() === route('bo.static_pages.edit', $exitOutsideStaticPageModel),
])>
<i @class([
'fa-solid fa-file fa-fw',
'fa-lg' =>
url()->current() ===
route('bo.static_pages.edit', $exitOutsideStaticPageModel),
url()->current() === route('bo.static_pages.edit', $exitOutsideStaticPageModel),
])></i>
{{ str(__("Page Sortir à l'éxterieur"))->ucFirst() }}
</a>

View file

@ -4,7 +4,7 @@
@endphp
<div class="row">
{{-- Page --}}
<div class="col-6 col-md-3 mb-3">
<div class="col-12 col-sm-6 col-xl-3 mb-3">
<fieldset class="h-100 border p-3">
<legend>{{ str(trans_choice('models.classes.static_page', 1))->ucFirst() }}</legend>
<div class="row">
@ -36,7 +36,7 @@
</fieldset>
</div>
{{-- Category --}}
<div class="col-6 col-md-3 mb-3">
<div class="col-12 col-sm-6 col-xl-3 mb-3">
<fieldset class="h-100 border p-3">
<legend>{{ str(trans_choice('models.classes.static_page', 1))->ucFirst() }}</legend>
<div class="row">
@ -67,9 +67,8 @@
</div>
</fieldset>
</div>
{{-- TITLE --}}
<div class="col-12 col-lg-6 mb-3">
{{-- TITLE --}}
<div class="col-12 col-xl-6 mb-3">
<fieldset class="h-100 border p-3">
<legend>{{ str(__('validation.attributes.name'))->ucfirst() }}</legend>
<div class="row">

View file

@ -1,7 +1,7 @@
@extends('bo.layout', ['brParam' => $staticPageModel])
@section('title', __('Édition d\'un :model', ['model' => __('models.classes.static_page')]))
@section('description', __('Édition d\'un :model déjà existant', ['model' => __('models.classes.static_page')]))
@section('title', __('Édition d\'une :model', ['model' => trans_choice('models.classes.static_page', 1)]))
@section('description', __('Édition d\'une :model déjà existant', ['model' => trans_choice('models.classes.static_page', 1)]))
@section('breadcrumb', request()->route()->getName())
@section('content')

View file

@ -129,8 +129,8 @@
!$staticPageModel->type->equals(StaticPageType::poultryBrand) &&
!$staticPageModel->type->equals(StaticPageType::raiseSustainably) &&
!$staticPageModel->type->equals(StaticPageType::feedProperly) &&
!$staticPageModel->type->equals(StaticPageType::home))
)
!$staticPageModel->type->equals(StaticPageType::home)
)
{{-- SUBTITLE --}}
<div class="col-12 col-md-6 mb-3">
<fieldset class="h-100 border p-3">

View file

@ -3,14 +3,12 @@
<div class="row mt-4">
<div class="accordion" id="mainAccordion">
@foreach ($sections as $index => $section)
@php
$collapseId = 'collapse-' . $section->id;
$toggleId = 'toggle-' . $section->id;
$isVisible = $section->visibility ?? true;
$sectionData = json_decode(json_encode($section->data), true) ?? [];
$hasPictos = !empty($sectionData['has_pictos']);
$hasBlocks = $section->blocks->where('type', BlockTypeEnum::redirection->value)->isNotEmpty();
@ -18,11 +16,8 @@
$maxPictos = $sectionData['max_pictos'] ?? 5;
$redirectionBlocks = $section->blocks->where('type', \App\Enums\BlockTypeEnum::redirection->value);
$bienfaitBlocks = $section->blocks->where('type', \App\Enums\BlockTypeEnum::bienfait->value);
@endphp
<div class="accordion-item border rounded-3 mb-3 shadow-sm">
{{-- Header --}}
<div class="accordion-header d-flex align-items-center px-3 py-2">
<button class="accordion-button collapsed flex-grow-1 border-0 bg-transparent shadow-none px-0 py-1"
@ -30,7 +25,6 @@
aria-controls="{{ $collapseId }}">
<span class="btn btn-outline-primary ms-2">{{ $section->name }}</span>
</button>
<div class="d-flex align-items-center gap-2 ms-3 flex-shrink-0">
<div class="section-flash" id="flash-{{ $section->id }}"></div>
<small class="toggle-label text-muted">Visible</small>
@ -41,7 +35,6 @@
</div>
</div>
</div>
{{-- Body + Tabs --}}
<div id="{{ $collapseId }}" class="accordion-collapse collapse" data-bs-parent="#mainAccordion">
<div class="accordion-body">
@ -52,7 +45,6 @@
<i class="bi bi-eye me-1"></i> Général
</button>
</li>
@if ($hasBlocks)
<li class="nav-item" role="presentation">
<button class="nav-link" data-bs-toggle="tab"
@ -69,7 +61,6 @@
</button>
</li>
@endif
@if ($hasPictos)
<li class="nav-item" role="presentation">
<button class="nav-link" data-bs-toggle="tab"
@ -79,9 +70,7 @@
</li>
@endif
</ul>
<div class="tab-content mx-4 my-4">
{{-- Tab --}}
<div class="tab-pane fade show active" id="s{{ $section->id }}-t1" role="tabpanel">
<form class="section-form" data-id="{{ $section->id }}" enctype="multipart/form-data">
@ -102,7 +91,6 @@
</div>
</form>
</div>
{{-- Tab Redirection --}}
@if ($hasBlocks)
<div class="tab-pane fade" id="s{{ $section->id }}-t2" role="tabpanel">
@ -125,14 +113,12 @@
</div>
</div>
</form>
@if (!$loop->last)
<hr class="my-4">
@endif
@endforeach
</div>
@endif
{{-- Tab Pictogrammes --}}
@if ($hasPictos)
<div class="tab-pane fade" id="s{{ $section->id }}-t3" role="tabpanel">
@ -161,7 +147,6 @@
</li>
@endforeach
</ul>
{{-- Tabs content --}}
<div class="tab-content">
@foreach ($bienfaitBlocks as $i => $block)
@ -179,7 +164,6 @@
'model' => $block,
'idPrefix' => 's' . $section->id . '-b' . $block->id,
])
<div class="row mt-4">
<div class="col text-center">
<button class="btn btn-primary" type="submit">
@ -193,12 +177,10 @@
</div>
</div>
@endif
</div>
</div>
</div>
</div>
@endforeach
</div>
</div>

View file

@ -6,7 +6,7 @@
$section_2_model = $staticPageModel->sections[0];
$section_2 = $section_2_model->data;
$reduction_2 = $section_2_model->blocks[0]->data;
$reduction_2 = data_get($section_2_model, 'blocks.0.data');
$section_3_model = $staticPageModel->sections[1];
$section_3 = $section_3_model->data;
@ -18,8 +18,7 @@
$section_5_model = $staticPageModel->sections[3];
$section_5 = $section_5_model->data;
$reduction_5 = $section_5_model->blocks[0]->data;
$reduction_5 = data_get($section_5_model, 'blocks.0.data');
//collections
$collectionSimpleItems = collect([
(object) [
@ -55,7 +54,7 @@
'picto_alt' => __($staticPageModel->picture_alt),
'picto_title' => __($staticPageModel->picture_title),
'picto_baner' => $staticPageModel->data['picto_banner'],
'content' => $staticPageModel->content
'content' => $staticPageModel->content,
])
{{-- PARAGRAPH WITH PICTURE --}}
@if ($section_2_model->visibility)

View file

@ -1,27 +1,28 @@
@php
$commitmentId = 3;
$badge = new stdClass();
$badge->label = str("engagement n°{$commitmentId}")->upper();
$badge->color = '#006633';
$section_2_model = $staticPageModel->sections[0];
$section_2 = $section_2_model->data;
$reduction_2 = $section_2_model->blocks[0]->data;
$reduction_2 = data_get($section_2_model, 'blocks.0.data');
$section_3_model = $staticPageModel->sections[1];
$section_3 = $section_3_model->data;
$reduction_3 = $section_3_model->blocks[0]->data;
$reduction_3 = data_get($section_3_model, 'blocks.0.data');
$section_4_model = $staticPageModel->sections[2];
$section_4 = $section_4_model->data;
$section_4_pictos = $section_4_model->pictos;
$reduction_4 = $section_4_model->blocks[0]->data;
$reduction_4 = data_get($section_4_model, 'blocks.0.data');
$section_5_model = $staticPageModel->sections[3];
$section_5 = $section_5_model->data;
$section_5_pictos = $section_5_model->pictos;
$reduction_5 = $section_5_model->blocks[0]->data;
$reduction_5 = data_get($section_5_model, 'blocks.0.data');
$section_6_model = $staticPageModel->sections[4];
$section_6 = $section_6_model->data;
@ -34,7 +35,7 @@
: $field->value,
),
);
$reduction_6 = $section_6_model->blocks[0]->data;
$reduction_6 = data_get($section_6_model, 'blocks.0.data');
$section_7_model = $staticPageModel->sections[5];
$section_7 = $section_7_model->data;
@ -42,11 +43,11 @@
$section_8_model = $staticPageModel->sections[6];
$section_8 = $section_8_model->data;
$reduction_8 = $section_8_model->blocks[0]->data;
$reduction_8 = data_get($section_8_model, 'blocks.0.data');
$section_9_model = $staticPageModel->sections[7];
$section_9 = $section_9_model->data;
$reduction_9 = $section_9_model->blocks[0]->data;
$reduction_9 = data_get($section_9_model, 'blocks.0.data');
@endphp
@extends('fo.layout', ['brParam' => $staticPageModel])

View file

@ -7,7 +7,7 @@
$section_2_model = $staticPageModel->sections[0];
$section_2 = $section_2_model->data;
$reduction_2 = $section_2_model->blocks[0]->data;
$reduction_2 = data_get($section_2_model, 'blocks.0.data');
$section_3_model = $staticPageModel->sections[1];
$section_3 = $section_3_model->data;
@ -15,7 +15,7 @@
$section_4_model = $staticPageModel->sections[2];
$section_4 = $section_4_model->data;
$reduction_4 = $section_4_model->blocks[0]->data;
$reduction_4 = data_get($section_4_model, 'blocks.0.data');
@endphp
@extends('fo.layout', ['brParam' => $staticPageModel])

View file

@ -6,7 +6,7 @@
$section_2_model = $staticPageModel->sections[0];
$section_2 = $section_2_model->data;
$reduction_2 = $section_2_model->blocks[0]->data;
$reduction_2 = data_get($section_2_model, 'blocks.0.data');
$section_3_model = $staticPageModel->sections[1];
$section_3 = $section_3_model->data;
@ -15,16 +15,16 @@
$section_4_model = $staticPageModel->sections[2];
$section_4 = $section_4_model->data;
$section_4_pictos = $section_4_model->pictos;
$reduction_4 = $section_4_model->blocks[0]->data;
$reduction_4 = data_get($section_4_model, 'blocks.0.data');
$section_5_model = $staticPageModel->sections[3];
$section_5 = $section_5_model->data;
$section_5_pictos = $section_5_model->pictos;
$reduction_5 = $section_5_model->blocks[0]->data;
$reduction_5 = data_get($section_5_model, 'blocks.0.data');
$section_6_model = $staticPageModel->sections[4];
$section_6 = $section_6_model->data;
$reduction_6 = $section_6_model->blocks[0]->data;
$reduction_6 = data_get($section_6_model, 'blocks.0.data');
$section_7_model = $staticPageModel->sections[5];
$section_7 = $section_7_model->data;
@ -65,7 +65,7 @@
'picto_alt' => __($staticPageModel->picture_alt),
'picto_title' => __($staticPageModel->picture_title),
'picto_baner' => $staticPageModel->data['picto_banner'],
'content' => $staticPageModel->content
'content' => $staticPageModel->content,
])
{{-- PARAGRAPH WITH PICTURE --}}
@if ($section_2_model->visibility)
@ -105,19 +105,15 @@
@if ($section_4_model->visibility)
<section class="line-border-large-bottom bg-green-wood mb-5 p-0">
{{-- BEA --}}
<a class="d-flex justify-content-center bea-banner" href="https://bienetreanimal.fr/" target="_blank" rel="noopener noreferrer">
<img
class="d-none d-sm-flex img-fluid"
<a class="d-flex justify-content-center bea-banner" href="https://bienetreanimal.fr/" target="_blank"
rel="noopener noreferrer">
<img class="d-none d-sm-flex img-fluid"
src="{{ Vite::asset('resources/assets/images/home/bea_desktop.png') }}"
alt="{{ __('Entreprise adhérente au collectif Filière Agricole Engagée pour le Bien-être Animal. Découvrez nos engagements pour un poulet origine France élevé dans le respect du bien-être animal.') }}"
title="{{ __('Découvrez les engagements de la Filière Agricole Engagée pour le Bien-être Animal') }}"
/>
<img
class="d-sm-none img-fluid"
src="{{ Vite::asset('resources/assets/images/home/bea_mobile.png') }}"
title="{{ __('Découvrez les engagements de la Filière Agricole Engagée pour le Bien-être Animal') }}" />
<img class="d-sm-none img-fluid" src="{{ Vite::asset('resources/assets/images/home/bea_mobile.png') }}"
alt="{{ __('Entreprise adhérente au collectif Filière Agricole Engagée pour le Bien-être Animal. Découvrez nos engagements pour un poulet origine France élevé dans le respect du bien-être animal.') }}"
title="{{ __('Découvrez les engagements de la Filière Agricole Engagée pour le Bien-être Animal') }}"
/>
title="{{ __('Découvrez les engagements de la Filière Agricole Engagée pour le Bien-être Animal') }}" />
</a>
<div class="container">
@include('fo.partials.commitments.paragraph-with-visual', [

View file

@ -7,16 +7,16 @@
$section_2_model = $staticPageModel->sections[0];
$section_2 = $section_2_model->data;
$section_2_pictos = $section_2_model->pictos;
$reduction_2 = $section_2_model->blocks[0]->data;
$reduction_2 = data_get($section_2_model, 'blocks.0.data');
$section_3_model = $staticPageModel->sections[1];
$section_3 = $section_3_model->data;
$reduction_3 = $section_3_model->blocks[0]->data;
$reduction_3 = data_get($section_3_model, 'blocks.0.data');
$section_4_model = $staticPageModel->sections[2];
$section_4 = $section_4_model->data;
$section_4_pictos = $section_4_model->pictos;
$reduction_4 = $section_4_model->blocks[0]->data;
$reduction_4 = data_get($section_4_model, 'blocks.0.data');
@endphp
@ -37,7 +37,7 @@
'picto_alt' => __($staticPageModel->picture_alt),
'picto_title' => __($staticPageModel->picture_title),
'picto_baner' => $staticPageModel->data['picto_banner'],
'content' => $staticPageModel->content
'content' => $staticPageModel->content,
])
{{-- PARAGRAPH WITH VISUAL AND COMPLEX ITEMS --}}
@ -46,7 +46,7 @@
'title' => __($section_2->title->value),
'text' => nl2br(__($section_2->description->value)),
'collection' => $section_2_pictos,
'picture' =>
'picture' =>
$section_2->media->value->picture->path ?? null
? asset($section_2->media->value->picture->path)
: null,
@ -66,7 +66,7 @@
'title' => __($section_3->title->value),
'text' => __($section_3->description->value),
'background_color' => 'light',
'picture' =>
'picture' =>
$section_3->media->value->picture->path ?? null
? asset($section_3->media->value->picture->path)
: null,

View file

@ -1,8 +1,8 @@
@php
use App\Enums\Block\BlockContentTypeEnum;
$pos = \App\Enums\Block\BlockPositionEnum::from($position)->toBootstrap();
$hasCta = in_array($blockType, [BlockContentTypeEnum::Cta->value, BlockContentTypeEnum::Both->value]);
$hasActu = in_array($blockType, [BlockContentTypeEnum::Actu->value, BlockContentTypeEnum::Both->value]);
$pos = $position !== null ? \App\Enums\Block\BlockPositionEnum::tryFrom($position)?->toBootstrap() : null;
$hasCta = in_array($blockType, [BlockContentTypeEnum::Cta->value, BlockContentTypeEnum::Both->value], true);
$hasActu = in_array($blockType, [BlockContentTypeEnum::Actu->value, BlockContentTypeEnum::Both->value], true);
@endphp
<div class="row justify-content-{{ $pos }} align-items-center">
@ -15,10 +15,8 @@
<div class="row align-items-center flex-nowrap g-3">
<div class="col-4">
<div class="ratio ratio-1x1">
<img class="object-fit-cover"
src="{{ asset($news->picture) }}"
title="{{ $news->picture_title }}"
alt="{{ $news->picture_alt }}">
<img class="object-fit-cover" src="{{ asset($news->picture) }}"
title="{{ $news->picture_title }}" alt="{{ $news->picture_alt }}">
</div>
</div>
<div class="col-8">
@ -43,8 +41,9 @@
@endif
@if ($hasCta && $ctaUrl && $ctaLabel)
<div class="col-12 col-md-auto order-2 order-md-1 d-flex justify-content-center justify-content-md-start align-items-center mt-3 mt-md-0">
<div
class="col-12 col-md-auto order-2 order-md-1 d-flex justify-content-center justify-content-md-start align-items-center mt-3 mt-md-0">
<a href="{{ $ctaUrl }}" class="btn btn-secondary f-bourton-base w-fit">{{ $ctaLabel }}</a>
</div>
@endif
</div>
</div>

View file

@ -2,10 +2,10 @@
'card card-custom d-flex flex-column justify-content-center align-items-center text-secondary border-0 bg-transparent text-center',
'swiper-slide' => isset($isSlide) && $isSlide,
])>
<img class="card-img-top" src="{{ asset($commitment->picture) }}" title="{{ $commitment->picture_title }}" alt="{{ $commitment->picture_alt }}">
<img class="card-img-top" src="{{ $commitment['picto'] }}" title="{{ $commitment['picto_title'] }}" alt="{{ $commitment['picto_alt'] }}">
<div class="card-body">
<p class="h3 fs-5">{{ $commitment->title }}</p>
<p class="m-0">{!! clean($commitment->description) !!}</p>
<a class="stretched-link" href="{{ $commitment->url }}"></a>
<p class="h3 fs-5">{{ str($commitment['title'])->upper() }}</p>
<p class="m-0">{{ str($commitment['text'])->ucFirst() }}</p>
<a class="stretched-link" href="{{ $commitment['url'] }}"></a>
</div>
</div>

View file

@ -1,11 +1,11 @@
@php
$blockType = $reduction->block_type->value;
$position = $reduction->position->value;
$ctaUrl = $reduction->cta_url->value ?? null;
$ctaLabel = $reduction->cta_label->value ?? null;
$articleId = $reduction->article_id->value ?? null;
$blockType = data_get($reduction, 'block_type.value');
$position = data_get($reduction, 'position.value');
$ctaUrl = data_get($reduction, 'cta_url.value');
$ctaLabel = data_get($reduction, 'cta_label.value');
$articleId = data_get($reduction, 'article_id.value');
$reductionNews = $articleId ? \App\Models\News::find($articleId) : null;
$visibility = $reduction->visibility->value ?? true;
$visibility = data_get($reduction, 'visibility.value', true);
@endphp
<section id="commitments-duo-title-text" class="position-relative">
<div class="line-border-large bg-{{ $background_color }} pb-5">

View file

@ -2,14 +2,61 @@
<div class="row">
<div class="col-12">
<h2 class="text-secondary fs-2 text-center">
{{ $sectionData->title->value }}
{{ str(__('le gaulois, une marque engagée et responsable'))->ucFirst() }}
</h2>
</div>
@php
$arrayCommitments = [
[
'picto' => Vite::asset(
'resources/assets/images/home/commitments/picto-volaille-francaise-blanc.svg',
),
'picto_alt' => __('Pictogramme d\'une volaille française'),
'picto_title' => __('Volaille dans le territoire français'),
'title' => __('volaille 100% française'),
'text' => __('être la grande marque alimentaire française'),
'url' => route('fo.commitments.brand'),
],
[
'picto' => Vite::asset('resources/assets/images/home/commitments/picto-elever-blanc.svg'),
'picto_alt' => __('Pictogramme d\'une volaille'),
'picto_title' => __('Volaille avec ses petits'),
'title' => __('élever durablement'),
'text' => __('favoriser une démarche d\'élevage durable et locale auprès de nos
éleveurs et des volailles'),
'url' => route('fo.commitments.raise'),
],
[
'picto' => Vite::asset('resources/assets/images/home/commitments/picto-bien-nourrir-blanc.svg'),
'picto_alt' => __('Pictogramme d\'une assiette'),
'picto_title' => __('Assiette avec des couverts'),
'title' => __('bien nourrir'),
'text' => __('agir sur la nutrition et la sécurité de nos produits pour satisfaire les français'),
'url' => route('fo.commitments.eat'),
],
[
'picto' => Vite::asset('resources/assets/images/home/commitments/picto-mieux-vivre-blanc.svg'),
'picto_alt' => __('Pictogramme de deux mains'),
'picto_title' => __('Serrage de mains'),
'title' => __('mieux vivre ensemble'),
'text' => __('accompagner nos collaborateurs dans la pratique du sport'),
'url' => route('fo.commitments.life'),
],
[
'picto' => Vite::asset('resources/assets/images/home/commitments/picto-respect-blanc.svg'),
'picto_alt' => __('Pictogramme d\'une plante'),
'picto_title' => __('Pousse d\'une plante au creux d\'une main'),
'title' => __('respecter la terre'),
'text' => __('minimiser notre empreinte carbone et agir sur le changement climatique'),
'url' => route('fo.commitments.respect'),
],
];
@endphp
<div class="col-12 position-relative my-4">
<div class="d-sm-none">
<div class="swiper swiper-commitments mx-5" id="swiper-commitments">
<div class="swiper-wrapper w-fit">
@foreach ($commitments as $commitment)
@foreach ($arrayCommitments as $commitment)
@include('fo.partials.commitment-card', ['isSlide' => true])
@endforeach
</div>
@ -26,7 +73,7 @@
</button>
</div>
<div class="d-none d-sm-flex w-100 justify-content-center mx-auto flex-wrap">
@foreach ($commitments as $commitment)
@foreach ($arrayCommitments as $commitment)
@include('fo.partials.commitment-card')
@endforeach
</div>

View file

@ -1,11 +1,11 @@
@php
$blockType = $reduction->block_type->value;
$position = $reduction->position->value;
$ctaUrl = $reduction->cta_url->value ?? null;
$ctaLabel = $reduction->cta_label->value ?? null;
$articleId = $reduction->article_id->value ?? null;
$blockType = data_get($reduction, 'block_type.value');
$position = data_get($reduction, 'position.value');
$ctaUrl = data_get($reduction, 'cta_url.value');
$ctaLabel = data_get($reduction, 'cta_label.value');
$articleId = data_get($reduction, 'article_id.value');
$reductionNews = $articleId ? \App\Models\News::find($articleId) : null;
$visibility = $reduction->visibility->value ?? true;
$visibility = data_get($reduction, 'visibility.value', true);
@endphp
<section class="position-relative bg-white-wood-big py-5 line-border-large" id="commitments-paragraph-with-visual-complex-flex-items">
<div class="container">

View file

@ -1,12 +1,13 @@
@php
$blockType = $reduction->block_type->value;
$position = $reduction->position->value;
$ctaUrl = $reduction->cta_url->value ?? null;
$ctaLabel = $reduction->cta_label->value ?? null;
$articleId = $reduction->article_id->value ?? null;
$blockType = data_get($reduction, 'block_type.value');
$position = data_get($reduction, 'position.value');
$ctaUrl = data_get($reduction, 'cta_url.value');
$ctaLabel = data_get($reduction, 'cta_label.value');
$articleId = data_get($reduction, 'article_id.value');
$reductionNews = $articleId ? \App\Models\News::find($articleId) : null;
$visibility = $reduction->visibility->value ?? true;
$visibility = data_get($reduction, 'visibility.value', true);
@endphp
<section class="position-relative line-border-large bg-white-wood-big bg-light" id="commitments-paragraph">
<div
class="d-flex flex-column flex-md-row justify-content-center justify-content-evenly align-items-center container py-5">

View file

@ -1,11 +1,11 @@
@php
$blockType = $reduction->block_type->value;
$position = $reduction->position->value;
$ctaUrl = $reduction->cta_url->value ?? null;
$ctaLabel = $reduction->cta_label->value ?? null;
$articleId = $reduction->article_id->value ?? null;
$blockType = data_get($reduction, 'block_type.value');
$position = data_get($reduction, 'position.value');
$ctaUrl = data_get($reduction, 'cta_url.value');
$ctaLabel = data_get($reduction, 'cta_label.value');
$articleId = data_get($reduction, 'article_id.value');
$reductionNews = $articleId ? \App\Models\News::find($articleId) : null;
$visibility = $reduction->visibility->value ?? true;
$visibility = data_get($reduction, 'visibility.value', true);
@endphp
<section id="commitments-tabs-texts" class="line-border-large bg-white py-5">
<div class="container">

View file

@ -1,11 +1,11 @@
@php
$blockType = $reduction->block_type->value;
$position = $reduction->position->value;
$ctaUrl = $reduction->cta_url->value ?? null;
$ctaLabel = $reduction->cta_label->value ?? null;
$articleId = $reduction->article_id->value ?? null;
$blockType = data_get($reduction, 'block_type.value');
$position = data_get($reduction, 'position.value');
$ctaUrl = data_get($reduction, 'cta_url.value');
$ctaLabel = data_get($reduction, 'cta_label.value');
$articleId = data_get($reduction, 'article_id.value');
$reductionNews = $articleId ? \App\Models\News::find($articleId) : null;
$visibility = $reduction->visibility->value ?? true;
$visibility = data_get($reduction, 'visibility.value', true);
@endphp
<section class="position-relative" id="commitments-visual-with-cards">
<div class="line-border-large bg-tertiary pb-5">
@ -70,6 +70,7 @@
</div>
@endforeach
</div>
@if ($collection->isNotEmpty())
<div class="col-12">
<div class="custom-card bottom-left-shadow position-relative">
<div class="position-absolute z-1 w-fit">
@ -88,6 +89,7 @@
</div>
</div>
</div>
@endif
</div>
</div>
</div>