fix: 🚸 check if nav links is empty, then display or not the button navigation in front
This commit is contained in:
parent
d7a81c939d
commit
c3e34984d6
5 changed files with 65 additions and 59 deletions
|
|
@ -82,7 +82,7 @@ class StaticPageController extends Controller
|
|||
public function unveil(): \Illuminate\Contracts\View\View
|
||||
{
|
||||
$staticPageModel = StaticPage::query()->where('type', StaticPageType::unveil)->first();
|
||||
$sectionModels = Section::query()->where('page_id', $staticPageModel->id)->get();
|
||||
$sectionModels = Section::query()->where('page_id', $staticPageModel->getKey())->get();
|
||||
$historicalMilestoneModels = HistoricalMilestone::query()->orderBy('year', 'ASC')->get();
|
||||
/** @var \Illuminate\Database\Eloquent\Collection<array-key,\App\Models\Site> */
|
||||
$siteModelList = Site::query()->orderBy('order')->get();
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ class StoreStickyRequest extends FormRequest
|
|||
'type' => trans('validation.custom.type'),
|
||||
'title' => trans('validation.attributes.title'),
|
||||
'anchor' => trans('validation.custom.anchor'),
|
||||
'color' => trans('validation.custom.color'),
|
||||
'color' => trans('validation.custom.color'),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,27 +17,29 @@
|
|||
|
||||
@section('content')
|
||||
<section class="commit">
|
||||
<div class="sticky-navigation">
|
||||
<div class="sticky-navigation-wrapper show row m-0 p-0">
|
||||
@foreach ($navLinks as $link)
|
||||
<div class="col-6 col-md-12 py-md-1 p-2">
|
||||
<div class="rounded-5 bg-{{ $link->color->name }}-light shadow-sm">
|
||||
<a class="d-flex justify-content-center align-items-center text-primary text-decoration-none p-sm-3 p-2"
|
||||
data-bs-toggle="tooltip" href="#{{ $link->anchor }}"
|
||||
title="{{ __('Accéder à la partie :name de la page', ['name' => $link->title]) }}">
|
||||
<span class="badge rounded-pill bg-{{ $link->color->name }} d-block me-2"></span>
|
||||
<small>{{ $link->title }}</small>
|
||||
</a>
|
||||
@if ($navLinks->count())
|
||||
<div class="sticky-navigation">
|
||||
<div class="sticky-navigation-wrapper show row m-0 p-0">
|
||||
@foreach ($navLinks as $link)
|
||||
<div class="col-6 col-md-12 py-md-1 p-2">
|
||||
<div class="rounded-5 bg-{{ $link->color->name }}-light shadow-sm">
|
||||
<a class="d-flex justify-content-center align-items-center text-primary text-decoration-none p-sm-3 p-2"
|
||||
data-bs-toggle="tooltip" href="#{{ $link->anchor }}"
|
||||
title="{{ __('Accéder à la partie :name de la page', ['name' => $link->title]) }}">
|
||||
<span class="badge rounded-pill bg-{{ $link->color->name }} d-block me-2"></span>
|
||||
<small>{{ $link->title }}</small>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endforeach
|
||||
</div>
|
||||
<button class="d-none d-md-block btn btn-primary rounded-pill mt-1 w-fit px-3"
|
||||
title="{{ __('Afficher/Masquer le menu des ancres') }}">
|
||||
<i class="fa-solid fa-plus d-none"></i>
|
||||
<i class="fa-solid fa-minus"></i>
|
||||
</button>
|
||||
</div>
|
||||
<button class="d-none d-md-block btn btn-primary rounded-pill mt-1 w-fit px-3"
|
||||
title="{{ __('Afficher/Masquer le menu des ancres') }}">
|
||||
<i class="fa-solid fa-plus d-none"></i>
|
||||
<i class="fa-solid fa-minus"></i>
|
||||
</button>
|
||||
</div>
|
||||
@endif
|
||||
{{-- AMBITION --}}
|
||||
<section class="ambition anchor-padding container my-4" id="introduction">
|
||||
<span id="sticky-displayer"></span>
|
||||
|
|
|
|||
|
|
@ -17,27 +17,29 @@
|
|||
|
||||
@section('content')
|
||||
<section class="we-hire">
|
||||
<div class="sticky-navigation">
|
||||
<div class="sticky-navigation-wrapper show row m-0 p-0">
|
||||
@foreach ($navLinks as $link)
|
||||
<div class="col-6 col-md-12 py-md-1 p-2">
|
||||
<div class="rounded-5 shadow-sm h-100 bg-{{ $link->color->name }}-light">
|
||||
<a class="d-flex justify-content-start align-items-center text-primary text-decoration-none p-sm-3 p-2 h-100"
|
||||
data-bs-toggle="tooltip" href="#{{ $link->anchor }}"
|
||||
title="{{ __('Accéder à la partie :name de la page', ['name' => $link->title]) }}">
|
||||
<span class="badge rounded-pill d-block me-2 bg-{{ $link->color->name }}"></span>
|
||||
<small>{{ $link->title }}</small>
|
||||
</a>
|
||||
@if ($navLinks->count())
|
||||
<div class="sticky-navigation">
|
||||
<div class="sticky-navigation-wrapper show row m-0 p-0">
|
||||
@foreach ($navLinks as $link)
|
||||
<div class="col-6 col-md-12 py-md-1 p-2">
|
||||
<div class="rounded-5 shadow-sm h-100 bg-{{ $link->color->name }}-light">
|
||||
<a class="d-flex justify-content-start align-items-center text-primary text-decoration-none p-sm-3 p-2 h-100"
|
||||
data-bs-toggle="tooltip" href="#{{ $link->anchor }}"
|
||||
title="{{ __('Accéder à la partie :name de la page', ['name' => $link->title]) }}">
|
||||
<span class="badge rounded-pill d-block me-2 bg-{{ $link->color->name }}"></span>
|
||||
<small>{{ $link->title }}</small>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endforeach
|
||||
</div>
|
||||
<button class="d-none d-md-block btn btn-primary rounded-pill mt-1 w-fit px-3"
|
||||
title="{{ __('Afficher/Masquer le menu des ancres') }}">
|
||||
<i class="fa-solid fa-plus d-none"></i>
|
||||
<i class="fa-solid fa-minus"></i>
|
||||
</button>
|
||||
</div>
|
||||
<button class="d-none d-md-block btn btn-primary rounded-pill mt-1 w-fit px-3"
|
||||
title="{{ __('Afficher/Masquer le menu des ancres') }}">
|
||||
<i class="fa-solid fa-plus d-none"></i>
|
||||
<i class="fa-solid fa-minus"></i>
|
||||
</button>
|
||||
</div>
|
||||
@endif
|
||||
{{-- COMPAGNY LIFE --}}
|
||||
<section class="company-life anchor-padding" id="company-life">
|
||||
<span id="sticky-displayer"></span>
|
||||
|
|
|
|||
|
|
@ -17,27 +17,29 @@
|
|||
|
||||
@section('content')
|
||||
<section class="unveil">
|
||||
<div class="sticky-navigation">
|
||||
<div class="sticky-navigation-wrapper show row m-0 p-0">
|
||||
@foreach ($navLinks as $link)
|
||||
<div class="col-6 col-md-12 py-md-1 p-2">
|
||||
<div class="rounded-5 shadow-sm h-100 bg-{{ $link->color->name }}-light">
|
||||
<a class="d-flex justify-content-start align-items-center text-primary text-decoration-none p-sm-3 p-2 h-100"
|
||||
data-bs-toggle="tooltip" href="#{{ $link->anchor }}"
|
||||
title="{{ __('Accéder à la partie :name de la page', ['name' => $link->title]) }}">
|
||||
<span class="badge rounded-pill d-block me-2 bg-{{ $link->color->name }}"></span>
|
||||
<small>{{ $link->title }}</small>
|
||||
</a>
|
||||
@if ($navLinks->count())
|
||||
<div class="sticky-navigation">
|
||||
<div class="sticky-navigation-wrapper show row m-0 p-0">
|
||||
@foreach ($navLinks as $link)
|
||||
<div class="col-6 col-md-12 py-md-1 p-2">
|
||||
<div class="rounded-5 shadow-sm h-100 bg-{{ $link->color->name }}-light">
|
||||
<a class="d-flex justify-content-start align-items-center text-primary text-decoration-none p-sm-3 p-2 h-100"
|
||||
data-bs-toggle="tooltip" href="#{{ $link->anchor }}"
|
||||
title="{{ __('Accéder à la partie :name de la page', ['name' => $link->title]) }}">
|
||||
<span class="badge rounded-pill d-block me-2 bg-{{ $link->color->name }}"></span>
|
||||
<small>{{ $link->title }}</small>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endforeach
|
||||
</div>
|
||||
<button class="d-none d-md-block btn btn-primary rounded-pill mt-1 w-fit px-3"
|
||||
title="{{ __('Afficher/Masquer le menu des ancres') }}">
|
||||
<i class="fa-solid fa-plus d-none"></i>
|
||||
<i class="fa-solid fa-minus"></i>
|
||||
</button>
|
||||
</div>
|
||||
<button class="d-none d-md-block btn btn-primary rounded-pill mt-1 w-fit px-3"
|
||||
title="{{ __('Afficher/Masquer le menu des ancres') }}">
|
||||
<i class="fa-solid fa-plus d-none"></i>
|
||||
<i class="fa-solid fa-minus"></i>
|
||||
</button>
|
||||
</div>
|
||||
@endif
|
||||
{{-- KEY NUMBERS --}}
|
||||
<section class="key-numbers anchor-padding my-5" id="key-numbers">
|
||||
<span id="sticky-displayer"></span>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue