add ranges.show page
This commit is contained in:
parent
9481b4ca70
commit
aba83a5c91
5 changed files with 141 additions and 3 deletions
|
|
@ -4,6 +4,7 @@ namespace App\Http\Controllers\Fo;
|
|||
|
||||
use App\Enums\StaticPageType;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Product;
|
||||
use App\Models\Range;
|
||||
use App\Models\StaticPage;
|
||||
|
||||
|
|
@ -24,4 +25,21 @@ class RangeController extends Controller
|
|||
|
||||
return view('fo.pages.ranges.index', compact('rangeModels', 'staticPageModel'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show a specific resource.
|
||||
*
|
||||
* @param string $slug
|
||||
* @return \Illuminate\Contracts\View\View
|
||||
*/
|
||||
public function show(string $slug): \Illuminate\Contracts\View\View
|
||||
{
|
||||
/** @var \App\Models\Range $rangeModel */
|
||||
$rangeModel = Range::query()->where('published', true)->where('slug', $slug)->firstOrFail();
|
||||
|
||||
/** @var \App\Models\Product $productModels */
|
||||
$productModels = Product::query()->where('range_id', $rangeModel->id)->where('published', true)->get();
|
||||
|
||||
return view('fo.pages.ranges.show', compact('rangeModel', 'productModels'));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,6 +17,10 @@
|
|||
word-break: break-word;
|
||||
}
|
||||
}
|
||||
|
||||
&-range {
|
||||
max-width: 332px;
|
||||
}
|
||||
}
|
||||
|
||||
.swiper-button {
|
||||
|
|
@ -54,3 +58,14 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
.range {
|
||||
&-title,
|
||||
.highlight {
|
||||
width: 100%;
|
||||
|
||||
@include media-breakpoint-up(xl) {
|
||||
width: fit-content;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
@foreach ($rangeModels as $rangeModel)
|
||||
<div class="col-4 mb-5">
|
||||
<div class="card position-relative mx-auto border-0 bg-transparent p-4">
|
||||
<a class="text-decoration-none stretched-link" href="#">
|
||||
<a class="text-decoration-none stretched-link" href="{{ route('fo.ranges.show', $rangeModel->slug) }}">
|
||||
<img class="position-absolute top-50 start-50 translate-middle w-100 h-100 z-n1"
|
||||
src="{{ Vite::asset('resources/assets/images/global/bg-white-desktop.png') }}"
|
||||
title="{{ __('Visuel servant de fond') }}" alt="{{ __('fond blanc') }}">
|
||||
|
|
@ -44,7 +44,7 @@
|
|||
<div class="card-body position-relative p-0">
|
||||
<div
|
||||
class="position-absolute w-100 h-100 visibility-hidden text-dark start-0 top-0 bg-white bg-opacity-75 p-2 opacity-0">
|
||||
{{ Str::of($rangeModel->tagline)->limit(255) }}
|
||||
{{ Str::of($rangeModel->tagline)->limit(100) }}
|
||||
</div>
|
||||
<img src="{{ asset($rangeModel->picture_thumbnail) }}"
|
||||
title="{{ $rangeModel->picture_thumbnail_title }}" alt="{{ $rangeModel->picture_thumbnail_alt }}">
|
||||
|
|
@ -76,7 +76,8 @@
|
|||
<img src="{{ asset($rangeModel->picture_thumbnail) }}" title="{{ $rangeModel->picture_thumbnail_title }}"
|
||||
alt="{{ $rangeModel->picture_thumbnail_alt }}">
|
||||
<div class="w-100 d-xl-none">
|
||||
<a class="w-fit" href="#">{{ __('> En savoir +') }}</a>
|
||||
<a class="w-fit"
|
||||
href="{{ route('fo.ranges.show', $rangeModel->slug) }}">{{ __('> En savoir +') }}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
103
resources/views/fo/pages/ranges/show.blade.php
Normal file
103
resources/views/fo/pages/ranges/show.blade.php
Normal file
|
|
@ -0,0 +1,103 @@
|
|||
@extends('fo.layout')
|
||||
|
||||
@section('title', $rangeModel->seo_title ?? __('Gamme'))
|
||||
@section('description', $rangeModel->seo_description ?? __('La gamme à savourer !'))
|
||||
@section('breadcrumb',
|
||||
request()->route()->getName())
|
||||
|
||||
@section('content')
|
||||
<section class="ranges range position-relative">
|
||||
<div class="container">
|
||||
<div class="row w-100 mx-auto">
|
||||
<div class="col-12">
|
||||
<h1 class="ranges-title f-sheldon text-uppercase my-3 text-center">
|
||||
<span class="divide d-block w-100 mt-xl-3 my-2"></span>
|
||||
{{ $rangeModel->title }}
|
||||
<span class="divide d-block w-100 mt-xl-3 my-2"></span>
|
||||
</h1>
|
||||
</div>
|
||||
<div class="col-12 col-md-6">
|
||||
<p class="m-0 mb-4 text-center">
|
||||
{{ Str::of($rangeModel->subtitle)->ucFirst() }}
|
||||
</p>
|
||||
<p class="highlight black m-0 mb-2 px-3 text-white">
|
||||
{{ Str::of($rangeModel->tagline)->ucFirst() }}
|
||||
</p>
|
||||
{!! clean($rangeModel->description) !!}
|
||||
</div>
|
||||
<div class="col-12 col-md-6 m-xl-0 my-4">
|
||||
<div class="d-flex justify-content-center">
|
||||
<img src="{{ asset($rangeModel->picture) }}" title="{{ Str::of($rangeModel->picture_alt)->ucFirst() }}"
|
||||
alt="{{ Str::of($rangeModel->picture_title)->ucFirst() }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 d-flex justify-content-center my-xl-5">
|
||||
<p class="highlight black m-0 w-fit px-3 text-white">
|
||||
{{ Str::of(__('Quelques-unes de nos recettes...'))->ucFirst() }}
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<div class="ranges-swiper position-relative d-xl-none">
|
||||
<div class="swiper swiper-ranges overflow-hidden py-4" id="swiper-ranges">
|
||||
<img class="position-absolute top-50 start-50 translate-middle w-100 h-100 z-n1 d-xl-none"
|
||||
src="{{ Vite::asset('resources/assets/images/global/bg-white-desktop.png') }}"
|
||||
title="{{ __('Visuel servant de fond') }}" alt="{{ __('fond blanc') }}">
|
||||
<div class="swiper-wrapper">
|
||||
@foreach ($productModels as $productModel)
|
||||
<div class="swiper-slide">
|
||||
<div class="swiper-slide-range m-xl-0 mx-auto">
|
||||
<img src="{{ asset($productModel->picture_thumbnail) }}"
|
||||
title="{{ $productModel->picture_thumbnail_title }}"
|
||||
alt="{{ $productModel->picture_thumbnail_alt }}">
|
||||
<p class="text-dark fw-bold m-0 my-2 p-0">
|
||||
{{ $productModel->title }}
|
||||
</p>
|
||||
<p class="text-dark m-0 mb-2 p-0">
|
||||
{{ $productModel->subtitle }}
|
||||
</p>
|
||||
<div class="w-100 d-xl-none">
|
||||
<a class="text-dark w-fit" href="#">{{ __('> En savoir +') }}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
<div
|
||||
class="navigation d-flex justify-content-evenly justify-content-xl-between align-items-center p-xl-4 mb-2 mt-3 flex-row p-0">
|
||||
<div class="swiper-button-prev rounded-circle" role="button">
|
||||
<img src="{{ Vite::asset('resources/assets/images/global/btn-arrow.png') }}"
|
||||
title="{{ __('Navigation du slider (gauche)') }}" alt="{{ __('flèche vers la gauche') }}">
|
||||
</div>
|
||||
<div class="swiper-button-next rounded-circle" role="button">
|
||||
<img src="{{ Vite::asset('resources/assets/images/global/btn-arrow.png') }}"
|
||||
title="{{ __('Navigation du slider (droite)') }}" alt="{{ __('flèche vers la droite') }}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<div class="d-none d-xl-flex row gx-5 justify-content-start align-items-start flex-row flex-wrap">
|
||||
@foreach ($productModels as $productModel)
|
||||
<div class="col-4 mb-5">
|
||||
<div class="card mx-auto border-0">
|
||||
<a class="text-decoration-none stretched-link" href="#">
|
||||
<img class="card-img-top rounded-0" src="{{ asset($productModel->picture_thumbnail) }}"
|
||||
title="{{ $productModel->picture_thumbnail_title }}"
|
||||
alt="{{ $productModel->picture_thumbnail_alt }}">
|
||||
<div class="card-body p-0">
|
||||
<p class="text-dark card-title fw-bold my-2">{{ $productModel->title }}</p>
|
||||
<p class="text-dark card-text m-0">
|
||||
{{ $productModel->subtitle }}
|
||||
</p>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@endsection
|
||||
|
|
@ -13,6 +13,7 @@ Route::middleware(['throttle:credentials'])
|
|||
|
||||
// * RANGES
|
||||
Route::get('/gammes', [RangeController::class, 'index'])->name('ranges.index');
|
||||
Route::get('/gammes/{slug}', [RangeController::class, 'show'])->name('ranges.show');
|
||||
|
||||
// * CONTACT
|
||||
Route::get('/contact', [StaticPageController::class, 'contact'])->name('contact.show');
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue