integration keynumber in story.blade fo
This commit is contained in:
parent
a69259ed7e
commit
8713271e72
5 changed files with 82 additions and 0 deletions
|
|
@ -12,6 +12,7 @@ enum StaticPageType: int
|
|||
case legals = 2;
|
||||
case confidentiality = 3;
|
||||
case recruitment = 4;
|
||||
case story = 5;
|
||||
|
||||
/**
|
||||
* Optionnal labels definition.
|
||||
|
|
@ -23,5 +24,6 @@ enum StaticPageType: int
|
|||
self::legals->name => 'Mentions légales',
|
||||
self::confidentiality->name => 'Confidentialité',
|
||||
self::recruitment->name => 'Recrutement',
|
||||
self::story->name => 'Qui sommes nous ?'
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ namespace App\Http\Controllers\Fo;
|
|||
use App\Enums\StaticPageType;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\BrandAdvantage;
|
||||
use App\Models\KeyNumber;
|
||||
use App\Models\Profession;
|
||||
use App\Models\StaticPage;
|
||||
|
||||
|
|
@ -59,4 +60,17 @@ class StaticPageController extends Controller
|
|||
$brandAdvantageModels = BrandAdvantage::query()->where('published', true)->orderBy('order')->get();
|
||||
return view('fo.pages.recruitment', compact('staticPageModel', 'professionModels', 'brandAdvantageModels'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Who are we page.
|
||||
*
|
||||
* @param \App\Models\StaticPage $staticPageModel
|
||||
* @return \Illuminate\Contracts\View\View
|
||||
*/
|
||||
public function story(StaticPage $staticPageModel)
|
||||
{
|
||||
$staticPageModel = StaticPage::query()->where('type', StaticPageType::story)->first();
|
||||
$keyNumberModels = KeyNumber::query()->where('published', true)->orderBy('order')->take(5)->get();
|
||||
return view('fo.pages.story', compact('staticPageModel', 'keyNumberModels'));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,5 +55,15 @@ class StaticPageSeeder extends Seeder
|
|||
'content' => \clean(\fake()->randomHtml()),
|
||||
]
|
||||
);
|
||||
StaticPage::query()->updateOrCreate(
|
||||
['type' => StaticPageType::story],
|
||||
[
|
||||
'seo_title' => sprintf('Seo title pour la page %s', StaticPageType::story->label()),
|
||||
'seo_description' => sprintf('Seo description pour la page %s', StaticPageType::story->label()),
|
||||
'title' => StaticPageType::story->label(),
|
||||
'type' => StaticPageType::story,
|
||||
'content' => \clean(\fake()->randomHtml()),
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
55
resources/views/fo/pages/story.blade.php
Normal file
55
resources/views/fo/pages/story.blade.php
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
@extends('fo.layout')
|
||||
|
||||
@section('title', __($staticPageModel->seo_title))
|
||||
@section('description', __($staticPageModel->seo_description))
|
||||
@section('breadcrumb', request()->route()->getName())
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<h1 class="f-intro-head-h-base text-center">{{ __($staticPageModel->title) }}</h1>
|
||||
</div>
|
||||
<div class="col-12 ck-content">
|
||||
{!! clean($staticPageModel->content) !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<section class="key-number line-border-large bg-warning pt-5 pb-3">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<h2 class="text-center text-uppercase">
|
||||
{{ __('Le gaulois en quelques chiffres') }}
|
||||
</h2>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<p class="text-center fs-8">
|
||||
{{ __('Le Gaulois est une marque du groupe LDC : leader européen de la volaille en volume.') }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
@foreach ($keyNumberModels as $keyNumberModel)
|
||||
<div class="col-6 col-lg-2 mx-auto">
|
||||
<figure class="text-center">
|
||||
<img src="{{ asset($keyNumberModel->picto) }}" alt="{{ asset($keyNumberModel->picto_alt) }}" title="{{ asset($keyNumberModel->picto_title) }}"/>
|
||||
<figcaption>{{ __($keyNumberModel->text) }}</figcaption>
|
||||
</figure>
|
||||
</div>
|
||||
@endforeach
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-12 ms-auto">
|
||||
<p class="fs-10 text-end">
|
||||
@foreach ($keyNumberModels as $keyNumberModel)
|
||||
{{ __($keyNumberModel->source) }}
|
||||
@endforeach
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@endsection
|
||||
|
|
@ -19,4 +19,5 @@ Route::middleware(['throttle:credentials'])
|
|||
Route::get('/mentions-legales', [StaticPageController::class, 'legals'])->name('legals.show');
|
||||
Route::get('/charte-de-confidentialite', [StaticPageController::class, 'policies'])->name('policies.show');
|
||||
Route::get('/contact', [StaticPageController::class, 'contact'])->name('contact.show');
|
||||
Route::get('/qui-sommes-nous', [StaticPageController::class, 'story'])->name('story.show');
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue