fix: 🐛 add section query in StaticPageController in listen method to have the section h2 and text

This commit is contained in:
Nicolas Demangeat 2025-07-08 15:52:31 +02:00
parent 33a0206ade
commit e025969e93
4 changed files with 15 additions and 5 deletions

View file

@ -216,15 +216,18 @@ class StaticPageController extends Controller
/**
* Display the 'we_listen' page.
* This page is used to send a contact form.
*
* @return \Illuminate\Contracts\View\View
*/
public function listen(): \Illuminate\Contracts\View\View
{
$staticPageModel = StaticPage::query()->where('type', StaticPageType::we_listen)->first();
$sectionModel = Section::query()->where('page_id', $staticPageModel->id)->first();
return view('fo.pages.listen', compact(
'staticPageModel',
'sectionModel',
));
}

View file

@ -14,6 +14,7 @@ use Spatie\Sitemap\Tags\Url;
use Uwil\SitemapGenerator\Lib\SitemapHelper;
/**
* @property int $id
* @property string $seo_title SEO title.
* @property string $seo_description SEO description.
* @property string $title Title.

View file

@ -10,6 +10,7 @@ use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Str;
/**
* @property int $id
* @property \App\Enums\StaticPageType $type Page type (StaticPageEnum).
* @property string $seo_title Seo title about 70 chars as recommended.
* @property string $seo_description Seo description about 160 chars as recommended.

View file

@ -30,10 +30,15 @@
{{ __('Je suis candidat') }}
</a>
</div>
<div class="col-12 col-lg-10 text-lg-start d-lg-flex align-items-end justify-content-center text-center">
@if ($staticPageModel->content)
<div class="ck-content text-primary">
{!! clean($staticPageModel->content) !!}
<div class="col-6 col-lg-5 d-flex flex-column justify-content-end align-items-center">
@if ($sectionModel->text)
<h2 class="m-0 fw-semibold text-primary">{!! clean($sectionModel->h2_title) !!}</h2>
@endif
</div>
<div class="col-6 col-lg-5 d-flex flex-column justify-content-end align-items-center">
@if ($sectionModel->text)
<div class="ck-content text-primary mb-2">
{!! clean($sectionModel->text) !!}
</div>
@endif
</div>
@ -44,7 +49,7 @@
<div class="border-3 border-primary fw-bold rounded-4 cn-cookie-activate d-flex flex-column flex-md-row mx-3 mb-3 mt-4 border bg-white p-3"
data-cookie-name="recaptcha">
<span class="d-flex flex-column w-md-75 w-100">
<strong class="text-underline text-bold text-primary fs-5 mb-2">
<strong class="text-underline fw-bold text-primary fs-5 mb-2">
{{ __('cookie-notice.custom.recaptcha.warning') }}
</strong>
<br><br>