diff --git a/database/migrations/2026_06_10_130304_update_data_to_static_page_tdf.php b/database/migrations/2026_06_10_130304_update_data_to_static_page_tdf.php new file mode 100644 index 00000000..073c202e --- /dev/null +++ b/database/migrations/2026_06_10_130304_update_data_to_static_page_tdf.php @@ -0,0 +1,97 @@ +items as $key => $old) { + if ($key === $target) { + $new[$new_key ?? $key] = $value; + } else { + $new[$key] = $old; + } + } + $this->items = $new; + }); + + Collection::macro('renameKey', function ($oldKey, $newKey) { + $new = []; + foreach ($this->items as $key => $value) { + $new[$key === $oldKey ? $newKey : $key] = $value; + } + $this->items = $new; + return $this; + }); + + Schema::table('static_page_tdf', function (Blueprint $table) { + $staticPageTdf = StaticPage::query()->where('type', StaticPageType::tdf)->first(); + if ($staticPageTdf) { + $data = collect($staticPageTdf->data); + + $data->renameKey('page_title', 'banner_page_title'); + $data->renameKey('highlight_text', 'banner_highlight_text'); + + $data->renameKey('heart_title', 'fun_facts_title'); + $data->renameKey('heart_subtitle', 'fun_facts_subtitle'); + $data->renameKey('heart_picture', 'fun_facts_picture'); + $data->renameKey('heart_picture_author', 'fun_facts_picture_author'); + + $data->renameKey('prize_title_1', 'play_prize_title_1'); + $data->renameKey('prize_picture_1', 'play_prize_picture_1'); + $data->renameKey('prize_title_2', 'play_prize_title_2'); + $data->renameKey('prize_picture_2', 'play_prize_picture_2'); + $data->renameKey('prize_title_3', 'play_prize_title_3'); + $data->renameKey('prize_picture_3', 'play_prize_picture_3'); + + $selectImageVideo = [ + 'label' => 'Media de la section n°4', + 'inputType' => InputType::selectImageVideo->value, + 'value' => [ + "video" => [ + "id" => "hY0WPbkf4Ow", + "alt" => "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.", + "title" => "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua." + ], + ], + 'validate' => 'required|array', + 'dimensions' => [ + 'width' => 620, + 'height' => 348 + ], + 'required' => true + ]; + + $data->replaceItem( + "tdf_media", + $selectImageVideo + ); + + $staticPageTdf->data = $data->all(); + $staticPageTdf->saveQuietly(); + } + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('static_page_tdf', function (Blueprint $table) { + // + }); + } +}; diff --git a/resources/sass/bo/base/_bootstrap-overload.scss b/resources/sass/bo/base/_bootstrap-overload.scss index 1d02e161..40b17941 100644 --- a/resources/sass/bo/base/_bootstrap-overload.scss +++ b/resources/sass/bo/base/_bootstrap-overload.scss @@ -2,3 +2,7 @@ color: $primary; font-weight: bold; } + +.max-h-svg { + max-height: 70px; +} diff --git a/resources/ts/bo/components/ImageInputComponent.vue b/resources/ts/bo/components/ImageInputComponent.vue index ca5eaa12..2d5c53eb 100644 --- a/resources/ts/bo/components/ImageInputComponent.vue +++ b/resources/ts/bo/components/ImageInputComponent.vue @@ -126,7 +126,7 @@