Closes #52
This commit is contained in:
parent
7072f55caa
commit
33e6a4e828
5 changed files with 41 additions and 37 deletions
|
|
@ -28,7 +28,8 @@ class ProductController extends Controller
|
|||
->where('published', true)
|
||||
->inRandomOrder()->limit(2)->get();
|
||||
$klubBloc = KlubBloc::query()->first();
|
||||
$rangeModels = Range::query()->whereNot('id', $productModel->range->id)->get()->random(2);
|
||||
$rangeModels = Range::query()->whereNot('id', $productModel->range->id)->limit(2)
|
||||
->inRandomOrder()->get();
|
||||
|
||||
return view('fo.pages.products.show', compact(
|
||||
'productModel',
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ class RangeController extends Controller
|
|||
public function show(string $slug): \Illuminate\Contracts\View\View
|
||||
{
|
||||
$rangeModel = Range::query()->where('slug', $slug)->firstOrFail();
|
||||
$rangeModels = Range::query()->where('slug', '!=', $slug)->get();
|
||||
$rangeModels = Range::query()->where('slug', '!=', $slug)->limit(2)->inRandomOrder()->get();
|
||||
$productModels = Product::query()->where('range_id', $rangeModel->id)
|
||||
->where('published', true)
|
||||
->orderBy('order', 'asc')
|
||||
|
|
|
|||
|
|
@ -233,39 +233,6 @@
|
|||
</div>
|
||||
</section>
|
||||
{{-- LIKED TOO --}}
|
||||
<section class="product-liked bg-primary bg-primary-top-tear bg-primary-bottom-shred z-1 pt-5 text-white">
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col text-lg-center text-start">
|
||||
<h1 class="fs-1 f-intro-head-h-base text-white">{{ __('Vous aimerez aussi...') }}</h1>
|
||||
<img class="img-fluid flex-shrink-1 mb-3 flex-grow-0"
|
||||
src="{{ Vite::asset('resources/assets/images/global/underline-yellow.svg') }}" alt="{{ __('Trait souligné') }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="position-relative d-flex flex-column flex-md-row justify-content-center">
|
||||
@foreach ($rangeModels as $key => $rangeModel)
|
||||
<div class="d-flex flex-column justify-content-center align-items-center mx-md-2 mx-xxl-4 m-0">
|
||||
<div class="position-relative py-3 text-center">
|
||||
<img class="rounded-circle w-100 h-auto" src="{{ asset($rangeModel->picture_ambiance) }}"
|
||||
title="{{ $rangeModel->picture_ambiance_title }}" alt="{{ $rangeModel->picture_ambiance_alt }}">
|
||||
<img class="product-liked-ellipse position-absolute translate-middle start-50 top-50 h-auto"
|
||||
alt="cercle fin de couleur blanc"
|
||||
@if ($key % 2) src="{{ Vite::asset('resources/assets/images/global/ellipse_white.png') }}"
|
||||
@else
|
||||
src="{{ Vite::asset('resources/assets/images/global/ellipse_yellow.png') }}" @endif>
|
||||
</div>
|
||||
<a class="product-liked-btn btn @if ($key % 2) btn-white btn-rotate-right @else btn-tertiary btn-rotate-left @endif fs-4 my-2 px-4"
|
||||
href="{{ route('fo.ranges.show', $rangeModel->slug) }}" title="Notre entreprise" target="_blank">
|
||||
{{ Str::limit(__($rangeModel->label), 30) }}
|
||||
</a>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
<div class="product-liked-beacon position-absolute d-none d-xl-block w-fit">
|
||||
<img class="img-fluid" src="{{ Vite::asset('resources/assets/images/product/beacon.png') }}"
|
||||
alt="{{ __('Phare qui éclaire n\'éclaire pas') }}">
|
||||
</div>
|
||||
</section>
|
||||
@include('fo.partials.liked-too', ['rangeModels' => $rangeModels])
|
||||
</section>
|
||||
@endsection
|
||||
|
|
|
|||
|
|
@ -69,7 +69,9 @@
|
|||
</div>
|
||||
</section>
|
||||
{{-- RANGES --}}
|
||||
@include('fo.partials.ranges')
|
||||
{{-- @include('fo.partials.ranges') --}}
|
||||
{{-- LIKED TOO --}}
|
||||
@include('fo.partials.liked-too', ['rangeModels' => $rangeModels])
|
||||
{{-- ENGAGEMENTS --}}
|
||||
<section class="engagements position-relative bg-tertiary-top-shred">
|
||||
<div class="bg-tertiary px-0 py-5">
|
||||
|
|
|
|||
34
resources/views/fo/partials/liked-too.blade.php
Normal file
34
resources/views/fo/partials/liked-too.blade.php
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
<section class="product-liked bg-primary bg-primary-top-tear bg-primary-bottom-shred z-1 pt-5 text-white">
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col text-lg-center text-start">
|
||||
<h1 class="fs-1 f-intro-head-h-base text-white">{{ __('Vous aimerez aussi...') }}</h1>
|
||||
<img class="img-fluid flex-shrink-1 mb-3 flex-grow-0"
|
||||
src="{{ Vite::asset('resources/assets/images/global/underline-yellow.svg') }}" alt="{{ __('Trait souligné') }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="position-relative d-flex flex-column flex-md-row justify-content-center">
|
||||
@foreach ($rangeModels as $key => $rangeModel)
|
||||
<div class="d-flex flex-column justify-content-center align-items-center mx-md-2 mx-xxl-4 m-0">
|
||||
<div class="position-relative py-3 text-center">
|
||||
<img class="rounded-circle w-100 h-auto" src="{{ asset($rangeModel->picture_ambiance) }}"
|
||||
title="{{ $rangeModel->picture_ambiance_title }}" alt="{{ $rangeModel->picture_ambiance_alt }}">
|
||||
<img class="product-liked-ellipse position-absolute translate-middle start-50 top-50 h-auto"
|
||||
alt="cercle fin de couleur blanc"
|
||||
@if ($key % 2) src="{{ Vite::asset('resources/assets/images/global/ellipse_white.png') }}"
|
||||
@else
|
||||
src="{{ Vite::asset('resources/assets/images/global/ellipse_yellow.png') }}" @endif>
|
||||
</div>
|
||||
<a class="product-liked-btn btn @if ($key % 2) btn-white btn-rotate-right @else btn-tertiary btn-rotate-left @endif fs-4 my-2 px-4"
|
||||
href="{{ route('fo.ranges.show', $rangeModel->slug) }}" title="Notre entreprise" target="_blank">
|
||||
{{ Str::limit(__($rangeModel->label), 30) }}
|
||||
</a>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
<div class="product-liked-beacon position-absolute d-none d-xl-block w-fit">
|
||||
<img class="img-fluid" src="{{ Vite::asset('resources/assets/images/product/beacon.png') }}"
|
||||
alt="{{ __('Phare qui éclaire n\'éclaire pas') }}">
|
||||
</div>
|
||||
</section>
|
||||
Loading…
Add table
Reference in a new issue