From 158f933faeaa212dc9c3e2eff6eaebfc2859d463 Mon Sep 17 00:00:00 2001 From: Noah Lancien Date: Wed, 24 Jul 2024 16:28:50 +0200 Subject: [PATCH] fix: #32 - some fixes in hire page --- app/Http/Middleware/SecureHeaders.php | 2 + ..._07_24_145556_alter_sections_hire_page.php | 68 +++++++++++++++++++ resources/ts/fo/base/common.ts | 4 +- resources/views/fo/pages/hire.blade.php | 28 ++++---- 4 files changed, 87 insertions(+), 15 deletions(-) create mode 100644 database/migrations/2024_07_24_145556_alter_sections_hire_page.php diff --git a/app/Http/Middleware/SecureHeaders.php b/app/Http/Middleware/SecureHeaders.php index 3429977..37ae290 100644 --- a/app/Http/Middleware/SecureHeaders.php +++ b/app/Http/Middleware/SecureHeaders.php @@ -61,6 +61,8 @@ class SecureHeaders "img-src 'self' data: blob: " . implode(' ', [ // * Leaftlet With OpenStreetmaps 'https://tile.openstreetmap.org', + // * Youtube thumbnails + 'https://img.youtube.com/vi/', // * VITE DEV config('app.debug') ? "https://{$host}:4443" : '', ]) . ';', diff --git a/database/migrations/2024_07_24_145556_alter_sections_hire_page.php b/database/migrations/2024_07_24_145556_alter_sections_hire_page.php new file mode 100644 index 0000000..6a359d7 --- /dev/null +++ b/database/migrations/2024_07_24_145556_alter_sections_hire_page.php @@ -0,0 +1,68 @@ +where('section', PageSectionEnum::hire_find)->first(); + if ($hireSection) { + /** @var \App\Models\Section $hireSection */ + + $oldPictureField = $hireSection->data['bloc_image']; + + $hireSection->data = array_merge( + $hireSection->data, + $hireSection->emptyPictureBloc( + [], + $oldPictureField['value'], + $oldPictureField['alt'], + $oldPictureField['title'], + $oldPictureField['dimensions']['width'], + $oldPictureField['dimensions']['height'], + false, + 'Image' + ) + ); + $hireSection->save(); + } + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down(): void + { + $hireSection = Section::query()->where('section', PageSectionEnum::hire_find)->first(); + if ($hireSection) { + /** @var \App\Models\Section $hireSection */ + + $oldPictureField = $hireSection->data['bloc_image']; + + $hireSection->data = array_merge( + $hireSection->data, + $hireSection->emptyPictureBloc( + [], + $oldPictureField['value'], + $oldPictureField['alt'], + $oldPictureField['title'], + $oldPictureField['dimensions']['width'], + $oldPictureField['dimensions']['height'], + true, + 'Image' + ) + ); + $hireSection->save(); + } + } +}; diff --git a/resources/ts/fo/base/common.ts b/resources/ts/fo/base/common.ts index 87f001f..fba862e 100644 --- a/resources/ts/fo/base/common.ts +++ b/resources/ts/fo/base/common.ts @@ -136,7 +136,6 @@ document.addEventListener("DOMContentLoaded", function () { modules: [Navigation], grabCursor: true, slidesPerView: 1.2, - centeredSlides: true, spaceBetween: 10, navigation: { nextEl: ".testi-next", @@ -154,6 +153,8 @@ document.addEventListener("DOMContentLoaded", function () { 1200: { slidesPerView: 3, spaceBetween: 20, + initialSlide: 1, + centerInsufficientSlides: true, }, }, }, @@ -246,7 +247,6 @@ document.addEventListener("DOMContentLoaded", function () { modules: [Navigation, Keyboard], grabCursor: true, slidesPerView: 2, - // slidesPerView: "auto", centerInsufficientSlides: true, keyboard: { enabled: true, diff --git a/resources/views/fo/pages/hire.blade.php b/resources/views/fo/pages/hire.blade.php index d59c573..cb24dba 100644 --- a/resources/views/fo/pages/hire.blade.php +++ b/resources/views/fo/pages/hire.blade.php @@ -75,10 +75,11 @@ 'type' => 'youtube', 'title' => __('Visionner la vidéo'), 'videoId' => $video->video_id, - 'picture' => Vite::asset( - 'resources/assets/images/others/background_video.png'), + 'picture' => sprintf( + 'https://img.youtube.com/vi/%s/maxresdefault.jpg', + $video->video_id), 'alt' => __('Video_about_who_we_are'), - 'linkNewTab' => false, + 'linkNewTab' => true, ])
@@ -100,7 +101,7 @@
+ href="https://www.youtube.com/@Volena-ldc" title="{{ __('Lien vers YouTube') }}" target="blank"> {{ __('Voir toutes les vidéos') }} @@ -259,12 +260,6 @@ {!! clean($paritySection->data['bloc_contenu_n2_content']['value']) !!}
-
-
- {{ __('Schéma des activités') }} -
-
-

{{ $findSection->data['bloc_string_titre_h3_de_la_section']['value'] }}

+

{{ $findSection->h2_title }}

+
+
+
+ {!! clean($findSection->text) !!} +
+
+
+

{{ $findSection->data['bloc_string_titre_h3_de_la_section']['value'] }}

@@ -305,8 +308,7 @@
- {{ $findSection->data['bloc_image']['alt'] }}