diff --git a/.gitignore b/.gitignore index 3a79e038..d2f723f2 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,7 @@ /public/storage /storage/*.key /storage/pail +/storage/uploads /vendor Homestead.json Homestead.yaml diff --git a/public/assets/css/style.css b/public/assets/css/style.css index c2cce6a7..8170fd79 100644 --- a/public/assets/css/style.css +++ b/public/assets/css/style.css @@ -2660,6 +2660,19 @@ a.copyright__item:hover { width: 100%; } +.our-commitment .textblock__image iframe { + aspect-ratio: 16 / 9; + width: 100%; + height: initial; +} + +@media screen and (max-width: 1600px) { + .our-commitment .textblock__image.textblock__block:has(.brand__video), + .our-commitment .textblock__image.textblock__block .brand__video { + width: 100%; + } +} + .textblock__info-description.quote__text { width: 100%; } @@ -2705,7 +2718,9 @@ a.copyright__item:hover { } .textblock__container_row .textblock__image img { + width: auto; height: auto; + margin: 0 auto; } .textblock__container_row.textblock__container_swap .textblock__image { diff --git a/resources/ts/back/Components/Inputs/SimpleYoutubeId.tsx b/resources/ts/back/Components/Inputs/SimpleYoutubeId.tsx index 44bcb648..ccb53375 100644 --- a/resources/ts/back/Components/Inputs/SimpleYoutubeId.tsx +++ b/resources/ts/back/Components/Inputs/SimpleYoutubeId.tsx @@ -15,7 +15,7 @@ type SimpleYoutubeIdProps = { }; export default function SimpleYoutubeId(props: SimpleYoutubeIdProps) { - const pattern = "^[0-9A-Za-z_-]{10}[048AEIMQUYcgkosw]$"; + const pattern = "^[0-9A-Za-z_\\-]{10}[048AEIMQUYcgkosw]$"; const label = str(useTrans('validation.custom.youtube_id')).ucFirst().value(); const localProps = {pattern, label, ...props}; diff --git a/resources/views/components/front/text-block.blade.php b/resources/views/components/front/text-block.blade.php index c9ed008d..15a7fcfa 100644 --- a/resources/views/components/front/text-block.blade.php +++ b/resources/views/components/front/text-block.blade.php @@ -47,10 +47,6 @@ @if (!empty($l['image']) || !empty($l['video']))
@if (!empty($l['video'])) - {{--
-
- {{ $l['video'] }} -
--}} {!! $video['title'] !!} @if (!empty($video['subtitle'])) $video['subtitle']['cursive'] - ])> + 'manifest__subtitle subtitle-text textblock__subtitle subtitle', + 'subtitle_paint' => $video['subtitle']['cursive'] + ])> {!! $video['subtitle']['text'] !!} @endif @@ -20,14 +20,13 @@
@php $videoUrl = strpos($video['video'], 'https') === 0 ? - $video['video'] : ( - $video['type_video'] === 'youtube' ? - 'https://www.youtube.com/embed/' : 'https://player.vimeo.com/video/' - ) . $video['video']; + $video['video'] + : ($video['type_video'] === 'youtube' + ? 'https://www.youtube.com/embed/' + : 'https://player.vimeo.com/video/' + ) . $video['video']; @endphp - -
+
{{ __('cookie-notice.custom.' . $video['type_video'] . '.warning') }} diff --git a/resources/views/front/pages/nos-engagements.blade.php b/resources/views/front/pages/nos-engagements.blade.php index 8cc8dee4..1adf218b 100644 --- a/resources/views/front/pages/nos-engagements.blade.php +++ b/resources/views/front/pages/nos-engagements.blade.php @@ -9,7 +9,6 @@ $getSection = fn($key) => $content[$key][0] ?? null; $getAnchor = fn($section) => Str::slug($section['string_title'] ?? ''); - $getConfig = fn($array, $value) => collect($array)->filter(fn($n) => $n['key'] === $value)->first(); @endphp {{-- COMMITMENTS LIST --}} diff --git a/resources/views/front/pages/notre-engagement.blade.php b/resources/views/front/pages/notre-engagement.blade.php index e4bdaa57..4af10787 100644 --- a/resources/views/front/pages/notre-engagement.blade.php +++ b/resources/views/front/pages/notre-engagement.blade.php @@ -4,106 +4,121 @@ @section('description', $dynamicPageModel->content['list_identification'][0]['textarea_seo_description']) @section('content') - {{-- Section content blocs --}} - @foreach($dynamicPageModel->content['list_section_engagement'] as $key => $sectionEngagement) - @php - $sections[$key] = [ - 'bg' => $sectionEngagement['boolean_background_dark'], - 'title' => $sectionEngagement['string_title'], - 'subtitle' => [ - 'text' => $sectionEngagement['string_subtitle'], - ], - 'list' => [], - ]; - foreach($sectionEngagement['list_block_content'] as $keyContent => $content) { - $positionMedium = !is_null($content['list_media']) ? intval($content['list_media'][0]['position_medium']) : 0; - array_push($sections[$key]['list'], [ - 'title' => null, - 'text' => $content['wysiwyg_content'], - 'quote' => 0, - 'swap_position' => $positionMedium === \App\Enums\ElementPositionEnum::showbottom->value() - ? true - : $positionMedium === \App\Enums\ElementPositionEnum::showright->value(), - 'in_row' => $positionMedium === \App\Enums\ElementPositionEnum::showbottom->value(), - 'floated' => !is_null($content['list_media']) ? intval($content['list_media'][0]['boolean_floated']) : 0, - 'align_center' => 0, - 'borders_desktop' => [ - 'left' => true, - 'right' => true, - 'top' => true, - 'bottom' => true, - ], - 'borders_mobile' => [ - 'left' => true, - 'right' => true, - 'top' => true, - 'bottom' => true, - ], - 'image' => [], - 'button_icon' => '', - 'button' => [], - ]); - if (!is_null($content['list_media']) && $content['list_media'][0]['boolean_medium']) { - foreach ($content['list_media'][0]['list_medium_type'] as $keyImg => $value) { - $picture = array_values(array_filter([ - $value['image_picture'] ?? null, - $value['file_gif'] ?? null, - $value['vimeoid_video'] ?? null, - $value['youtubeid_video'] ?? null, - ]))[0]; - array_push($sections[$key]['list'][$keyContent]['image'], [ - 'url' => $picture ?? null, - ]); - } - } - if (isset($content['list_button']) && $content['list_button'][0]['boolean_button']) { - $sections[$key]['list'][$keyContent]['button'] = [ - 'url' => $content['list_button'][0]['url_link'], - 'title' => $content['list_button'][0]['string_label'], - 'target' => '', - ]; - $sections[$key]['list'][$keyContent]['button_icon'] = $content['list_button'][0]['boolean_icon'] ? 'btn__icon_view' : 'btn__icon_arrow-right'; - } - } - @endphp - @endforeach - @foreach ($sections as $section) - - @endforeach - {{-- Sections numbers --}} - @php $section = $dynamicPageModel->content['list_section_numbers'][0]; @endphp -
-
+
+ {{-- Section content blocs --}} + @foreach($dynamicPageModel->content['list_section_engagement'] as $key => $sectionEngagement) @php - $brands = []; - if ( - isset($pageNosMarques) - && isset($pageNosMarques->content['list_our_big_brands']) - && isset($pageNosMarques->content['list_our_big_brands'][0]['list_brands']) - ) { - foreach ($pageNosMarques->content['list_our_big_brands'][0]['list_brands'] as $key => $logo) { - array_push($brands, [ - 'image' => [ - 'url' => asset($logo['list_logo'][0]['image_brand_logo']), - ], - ]); + $sections[$key] = [ + 'bg' => $sectionEngagement['boolean_background_dark'], + 'title' => $sectionEngagement['string_title'], + 'subtitle' => [ + 'text' => $sectionEngagement['string_subtitle'], + ], + 'list' => [], + ]; + $getConfig = fn($array, $value) => collect($array)->filter(fn($n) => $n['key'] === $value)->first(); + + foreach($sectionEngagement['list_block_content'] as $keyContent => $content) { + $positionMedium = !is_null($content['list_media']) ? intval($content['list_media'][0]['position_medium']) : 0; + array_push($sections[$key]['list'], [ + 'title' => $content['string_title'] ?? null, + 'text' => $content['wysiwyg_content'], + 'quote' => 0, + 'swap_position' => $positionMedium === \App\Enums\ElementPositionEnum::showbottom->value() + ? true + : $positionMedium === \App\Enums\ElementPositionEnum::showright->value(), + 'in_row' => $positionMedium === \App\Enums\ElementPositionEnum::showbottom->value(), + 'floated' => !is_null($content['list_media']) ? intval($content['list_media'][0]['boolean_floated']) : 0, + 'align_center' => 1, + 'borders_desktop' => [ + 'left' => true, + 'right' => true, + 'top' => true, + 'bottom' => true, + ], + 'borders_mobile' => [ + 'left' => true, + 'right' => true, + 'top' => true, + 'bottom' => true, + ], + 'image' => [], + 'video' => [], + 'button_icon' => '', + 'button' => [], + ]); + if (!is_null($content['list_media']) && $content['list_media'][0]['boolean_medium']) { + foreach ($content['list_media'][0]['list_medium_type'] as $keyImg => $value) { + unset($value['order']); + $filtered = array_filter($value); + $field = array_key_first($filtered); + $aaa = $getConfig($dynamicPageModel->config->config, 'list_section_engagement'); + $bbb = $getConfig($aaa['children'], 'list_block_content'); + $ccc = $getConfig($bbb['children'], 'list_media'); + $ddd = $getConfig($ccc['children'], 'list_medium_type'); + $eee = $getConfig($ddd['children'], $field); + + if ($eee['type'] === \App\Enums\DynamicFieldTypes::youtubeid->value()) { + $sections[$key]['list'][$keyContent]['video'] = [ + 'type_video' => 'youtube', + 'video' => $filtered[$field], + ]; + } else { + array_push($sections[$key]['list'][$keyContent]['image'], [ + 'url' => $filtered[$field] ?? null, + ]); + } + } + } + if (isset($content['list_button']) && $content['list_button'][0]['boolean_button']) { + $sections[$key]['list'][$keyContent]['button'] = [ + 'url' => $content['list_button'][0]['url_link'], + 'title' => $content['list_button'][0]['string_label'], + 'target' => '', + ]; + $sections[$key]['list'][$keyContent]['button_icon'] = $content['list_button'][0]['boolean_icon'] ? 'btn__icon_view' : 'btn__icon_arrow-right'; } } @endphp - @if(!empty($brands)) - - @else - - @endif - -
-
- @if($pageNosEngagements->childPages->count()) -
-
- + @endforeach + @foreach ($sections as $section) + + @endforeach + {{-- Sections numbers --}} + @php $section = $dynamicPageModel->content['list_section_numbers'][0]; @endphp +
+
+ @php + $brands = []; + if ( + isset($pageNosMarques) + && isset($pageNosMarques->content['list_our_big_brands']) + && isset($pageNosMarques->content['list_our_big_brands'][0]['list_brands']) + ) { + foreach ($pageNosMarques->content['list_our_big_brands'][0]['list_brands'] as $key => $logo) { + array_push($brands, [ + 'image' => [ + 'url' => asset($logo['list_logo'][0]['image_brand_logo']), + ], + ]); + } + } + @endphp + @if(!empty($brands)) + + @else + + @endif +
- @endif + @if($pageNosEngagements->childPages->count()) +
+
+ +
+
+ @endif +
@endsection