diff --git a/app/Http/Controllers/Fo/StaticPageController.php b/app/Http/Controllers/Fo/StaticPageController.php index 43848c31..9094baaa 100644 --- a/app/Http/Controllers/Fo/StaticPageController.php +++ b/app/Http/Controllers/Fo/StaticPageController.php @@ -6,6 +6,7 @@ use App\Enums\StaticPageType; use App\Http\Controllers\Controller; use App\Models\BrandAdvantage; use App\Models\KeyNumber; +use App\Models\Offer; use App\Models\Profession; use App\Models\StaticPage; use App\Models\Video; @@ -57,9 +58,19 @@ class StaticPageController extends Controller public function recruitment(StaticPage $staticPageModel): \Illuminate\Contracts\View\View { $staticPageModel = StaticPage::query()->where('type', StaticPageType::recruitment)->first(); + $offerModels = Offer::query() + ->where('published', true) + ->orderBy('updated_at', 'DESC') + ->take(6) + ->get(); $professionModels = Profession::query()->where('published', true)->take(5)->get(); $brandAdvantageModels = BrandAdvantage::query()->where('published', true)->orderBy('order')->get(); - return view('fo.pages.recruitment', compact('staticPageModel', 'professionModels', 'brandAdvantageModels')); + return view('fo.pages.recruitment', compact( + 'staticPageModel', + 'offerModels', + 'professionModels', + 'brandAdvantageModels' + )); } /** diff --git a/database/migrations/2024_12_25_104803_add_fields_to_static_page_offers_table.php b/database/migrations/2024_12_25_104803_add_fields_to_static_page_offers_table.php new file mode 100644 index 00000000..0f611dad --- /dev/null +++ b/database/migrations/2024_12_25_104803_add_fields_to_static_page_offers_table.php @@ -0,0 +1,109 @@ +where('type', StaticPageType::recruitment)->first(); + $staticPage->data = [ + "offers_title" => [ + "label" => "Titre des offres", + "inputType" => InputType::string->value, + "value" => "le titre des offres", + "validate" => "required|string|between:3,255", + 'required' => true + ], + "offers_description" => [ + "label" => "Description des offres", + "inputType" => InputType::text->value, + "value" => "la description des offres", + "validate" => "required|string|min:15", + 'required' => true + ], + "jobs_title" => [ + "label" => "Titre des métiers", + "inputType" => InputType::string->value, + "value" => "le titre des métiers", + "validate" => "required|string|between:3,255", + 'required' => true + ], + "jobs_description" => [ + "label" => "Description des métiers", + "inputType" => InputType::text->value, + "value" => "la description des métiers", + "validate" => "required|string|min:15", + 'required' => true + ], + "testimonies_title" => [ + "label" => "Titre des témoignages", + "inputType" => InputType::string->value, + "value" => "le titre des témoignages", + "validate" => "required|string|between:3,255", + 'required' => true + ], + "testimonies_description" => [ + "label" => "Description des témoignages", + "inputType" => InputType::text->value, + "value" => "la description des témoignages", + "validate" => "required|string|min:15", + 'required' => true + ], + "advantages_title" => [ + "label" => "Titre des avantages", + "inputType" => InputType::string->value, + "value" => "le titre des avantages", + "validate" => "required|string|between:3,255", + 'required' => true + ], + "advantages_description" => [ + "label" => "Description des avantages", + "inputType" => InputType::text->value, + "value" => "la description des avantages", + "validate" => "required|string|min:15", + 'required' => true + ], + "actualities_title" => [ + "label" => "Titre des actualités", + "inputType" => InputType::string->value, + "value" => "le titre des actualités", + "validate" => "required|string|between:3,255", + 'required' => true + ], + "actualities_description" => [ + "label" => "Description des actualités", + "inputType" => InputType::text->value, + "value" => "la description des actualités", + "validate" => "required|string|min:15", + 'required' => true + ], + ]; + $staticPage->saveQuietly(); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down(): void + { + Schema::table('static_pages', function () { + // RECRUITMENT. + $staticPage = StaticPage::query()->where('type', StaticPageType::recruitment)->first(); + $staticPage->data = []; + $staticPage->saveQuietly(); + }); + } +}; diff --git a/resources/sass/fo/pages/recruitment.scss b/resources/sass/fo/pages/recruitment.scss index 58a712ca..c2a58626 100644 --- a/resources/sass/fo/pages/recruitment.scss +++ b/resources/sass/fo/pages/recruitment.scss @@ -1,11 +1,30 @@ -.jobs { - .card { - &-professions { - max-width: calc(300px + (2 * 0.5rem)); +#recruitment { + &-offers { + &-count { + top: -1rem; + right: -1rem; + width: 2rem; + height: 2rem; } - &-body { - height: 13rem; + .swiper-recruitment-offers img { + width: 100%; + + @include media-breakpoint-up(md) { + width: 50%; + } + } + } + + &-jobs { + .card { + &-professions { + max-width: calc(300px + (2 * 0.5rem)); + } + + &-body { + height: 13rem; + } } } } diff --git a/resources/ts/fo/base/common.ts b/resources/ts/fo/base/common.ts index 4fba13a4..23d84bb1 100644 --- a/resources/ts/fo/base/common.ts +++ b/resources/ts/fo/base/common.ts @@ -141,6 +141,41 @@ document.addEventListener("DOMContentLoaded", function () { // SWIPER const swiperConfig = { + "swiper-recruitment-offers": { + modules: [Navigation, Keyboard, Pagination], + grabCursor: true, + slidesPerView: 1.3, + initialSlide: 0, + spaceBetween: 10, + navigation: { + nextEl: ".swiper-recruitment-offers-button-next", + prevEl: ".swiper-recruitment-offers-button-prev", + }, + keyboard: { + enabled: true, + }, + pagination: { + el: ".swiper-recruitment-offers-pagination", + clickable: true, + renderBullet: function (index: number, className: string) { + return ""; + }, + }, + breakpoints: { + 576: { + slidesPerView: 2, + spaceBetween: 25, + }, + 768: { + slidesPerView: 2, + spaceBetween: 35, + }, + 992: { + slidesPerView: 2, + spaceBetween: 55, + }, + }, + }, "swiper-recruitment-jobs": { modules: [Navigation, Keyboard, Pagination], grabCursor: true, diff --git a/resources/views/bo/pages/offers/form.blade.php b/resources/views/bo/pages/offers/form.blade.php index d20f9007..cac1d88c 100644 --- a/resources/views/bo/pages/offers/form.blade.php +++ b/resources/views/bo/pages/offers/form.blade.php @@ -215,22 +215,35 @@ {{-- DESCRIPTION --}}
-
- {{ str(__('validation.attributes.description'))->ucfirst() }} -
+
+ {{ str(__('validation.attributes.description'))->ucFirst() }} +
- @include('bo.partials.inputs.text-html', [ + @include('bo.partials.inputs.varchar-multiline', [ 'id' => 'offerDescription', - 'label' => str( - __(':field :inter:model', [ + 'label' => __(':field :inter:model', [ + 'field' => str(__('validation.attributes.description'))->ucFirst(), + 'inter' => __('validation.custom.of_the.vowel'), + 'model' => __('models.classes.offer'), + ]), + 'hasWordCounter' => true, + 'name' => 'description', + 'required' => true, + 'model' => $offerModel ?? null, + 'helper' => __('validation.between.string', [ + 'attribute' => __(':field :inter:model', [ 'field' => __('validation.attributes.description'), 'inter' => __('validation.custom.of_the.vowel'), 'model' => __('models.classes.offer'), - ]))->ucfirst(), - 'name' => 'description', - 'model' => $offerModel ?? null, - 'required' => true, - 'helper' => __('crud.minicrud.text_warning'), + ]), + 'min' => 3, + 'max' => 255, + ]), + 'placeholder' => __(':field :inter:model', [ + 'field' => str(__('validation.attributes.description'))->ucFirst(), + 'inter' => __('validation.custom.of_the.vowel'), + 'model' => __('models.classes.offer'), + ]), ])
diff --git a/resources/views/bo/pages/static_pages/form.blade.php b/resources/views/bo/pages/static_pages/form.blade.php index e537f0bd..b6c20edf 100644 --- a/resources/views/bo/pages/static_pages/form.blade.php +++ b/resources/views/bo/pages/static_pages/form.blade.php @@ -80,11 +80,9 @@
@endif - @if ( - !$staticPageModel->type->equals(StaticPageType::recruitment) && - !$staticPageModel->type->equals(StaticPageType::recipe) && - !$staticPageModel->type->equals(StaticPageType::product) && - !$staticPageModel->type->equals(StaticPageType::home)) + @if (!$staticPageModel->type->equals(StaticPageType::recipe) && + !$staticPageModel->type->equals(StaticPageType::product) && + !$staticPageModel->type->equals(StaticPageType::home)) {{-- TITLE --}}
diff --git a/resources/views/fo/pages/recruitment.blade.php b/resources/views/fo/pages/recruitment.blade.php index 4d00fff3..706a95a9 100644 --- a/resources/views/fo/pages/recruitment.blade.php +++ b/resources/views/fo/pages/recruitment.blade.php @@ -8,68 +8,130 @@ @section('content') {{-- HEADER --}} @include('fo.layouts.header-banner') -
-
-
-

{{ __($staticPageModel->title) }}

-
-
- {!! clean($staticPageModel->content) !!} -
-
-
- {{-- PROFESSIONS --}} -
-
-
-

{{ __('Nos métiers') }}

-
-
-
-
- @foreach ($professionModels as $professionModel) -
- @include('fo.partials.job-card', [ - 'title' => $professionModel->title, - 'jobs_list' => $professionModel->jobs_list, - 'picture' => [ - 'src' => asset($professionModel->picture), - 'alt' => $professionModel->picture_alt, - 'title' => $professionModel->picture_title, - ], - 'job_url' => $professionModel->job_url, - ]) -
- @endforeach + {{-- OFFERS --}} +
+
+
+
+

{{ $staticPageModel->data['offers_title']['value'] }}

+

{{ $staticPageModel->data['offers_description']['value'] }}

+
+
+
+
+ @foreach ($offerModels as $offerModel) +
+ @include('fo.partials.offer-card', [ + 'title' => $offerModel->title, + 'location' => $offerModel->location, + 'contract' => $offerModel->contract, + 'function' => $offerModel->function, + 'description' => $offerModel->description, + 'picture' => [ + 'src' => asset($offerModel->picture), + 'alt' => $offerModel->picture_alt, + 'title' => $offerModel->picture_title, + ], + ]) +
+ @endforeach +
+
+
+ +
-
- {{-- REASONS TO JOIN US --}} -
+ {{-- PROFESSIONS --}} +
+
+
+
+

{{ $staticPageModel->data['jobs_title']['value'] }}

+

{{ $staticPageModel->data['jobs_description']['value'] }}

+
+
+
+
+ @foreach ($professionModels as $professionModel) +
+ @include('fo.partials.job-card', [ + 'title' => $professionModel->title, + 'jobs_list' => $professionModel->jobs_list, + 'picture' => [ + 'src' => asset($professionModel->picture), + 'alt' => $professionModel->picture_alt, + 'title' => $professionModel->picture_title, + ], + 'job_url' => $professionModel->job_url, + ]) +
+ @endforeach +
+
+
+
+ + +
+
+
+
+ {{-- TESTIMONIES --}} +
+
+
+
+

{{ $staticPageModel->data['testimonies_title']['value'] }} +

+

{{ $staticPageModel->data['testimonies_description']['value'] }}

+
+
+ {{-- content --}} +
+
+
+
+ {{-- ADVANTAGES --}} +
-

{{ __("Pourquoi nous rejoindre\u{00A0}?") }}

-

{{ __('Lorem, ipsum dolor sit amet consectetur adipisicing elit. Excepturi commodi ipsa quas laudantium consequatur explicabo quasi voluptatum vitae dolorem dolores necessitatibus numquam, praesentium quod doloribus! Atque quisquam ullam modi exercitationem.') }} -

+

+ {{ $staticPageModel->data['advantages_title']['value'] }}

+

{{ $staticPageModel->data['advantages_description']['value'] }}

-
-
@foreach ($brandAdvantageModels as $brandAdvantageModel)
!$brandAdvantageModel->is_large])> {{ $brandAdvantageModel->picto_alt }} + title="{{ $brandAdvantageModel->picto_title }}" + alt="{{ $brandAdvantageModel->picto_alt }}">
!$brandAdvantageModel->is_large])>

{{ $brandAdvantageModel->sustitle }}

@@ -116,4 +179,19 @@
--}}
+ {{-- ACTUALITIES --}} +
+
+
+
+

{{ $staticPageModel->data['actualities_title']['value'] }} +

+

{{ $staticPageModel->data['actualities_description']['value'] }}

+
+
+ {{-- content --}} +
+
+
+
@endsection diff --git a/resources/views/fo/partials/offer-card.blade.php b/resources/views/fo/partials/offer-card.blade.php new file mode 100644 index 00000000..58e0f71f --- /dev/null +++ b/resources/views/fo/partials/offer-card.blade.php @@ -0,0 +1,34 @@ + diff --git a/routes/web-bo.php b/routes/web-bo.php index b3738053..62f0e3d0 100644 --- a/routes/web-bo.php +++ b/routes/web-bo.php @@ -323,9 +323,7 @@ Route::middleware(['throttle:web'])->prefix('bo')->name('bo.')->group(function ( ->name('products.json-paginate'); // * OFFERS. - Route::resource('offers', OfferController::class) - ->withoutMiddleware('htmlsanitize') - ->middleware('htmlsanitize:description'); + Route::resource('offers', OfferController::class); Route::patch('/offers/{offer}/change-published', [ OfferController::class, 'changePublished' ])->name('offers.change-published');