feat: ✨ organize navbar bo
This commit is contained in:
parent
25f4e0a344
commit
fccfc1734e
5 changed files with 358 additions and 65 deletions
|
|
@ -7,6 +7,7 @@ use App\Http\Controllers\Controller;
|
|||
use App\Http\Requests\Bo\Sections\UpdateSectionRequest;
|
||||
use App\Models\Section;
|
||||
use App\Models\StaticPage;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
|
@ -144,4 +145,16 @@ class SectionController extends Controller
|
|||
}
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the list of sections for ids.
|
||||
*
|
||||
* @param array $ids
|
||||
* @return \Illuminate\Database\Eloquent\Collection
|
||||
*/
|
||||
public static function getSections(array $ids): Collection {
|
||||
$query = Section::query()->whereIn('id', $ids)->get();
|
||||
|
||||
return $query;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ class SlideController extends Controller
|
|||
$slideModels,
|
||||
$search,
|
||||
null,
|
||||
'slider',
|
||||
'type',
|
||||
'title',
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ namespace App\Http\Controllers\Bo;
|
|||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\Bo\StaticPages\UpdateStaticPageRequest;
|
||||
use App\Models\StaticPage;
|
||||
use App\Enums\StaticPageType;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Str;
|
||||
|
|
@ -88,4 +89,15 @@ class StaticPageController extends Controller
|
|||
]));
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the static page for a page type.
|
||||
*
|
||||
* @param \App\Enums\StaticPageType $type
|
||||
* @return \App\Models\StaticPage
|
||||
*/
|
||||
public static function getStaticPage(StaticPageType $type): StaticPage {
|
||||
$query = StaticPage::query()->where('type', $type)->first();
|
||||
return $query;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,9 @@ use Illuminate\Support\Facades\Cache;
|
|||
use Illuminate\Support\Facades\File;
|
||||
use Illuminate\Support\Facades\View;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use App\Enums\StaticPageType;
|
||||
use App\Http\Controllers\Bo\StaticPageController;
|
||||
use App\Http\Controllers\Bo\SectionController;
|
||||
|
||||
class ViewServiceProvider extends ServiceProvider
|
||||
{
|
||||
|
|
@ -34,6 +37,36 @@ class ViewServiceProvider extends ServiceProvider
|
|||
} else {
|
||||
Paginator::useBootstrapFive();
|
||||
}
|
||||
|
||||
collect([
|
||||
['name' => 'homeStaticPageModel', 'value' => StaticPageController::getStaticPage(StaticPageType::home)],
|
||||
['name' => 'veilStaticPageModel', 'value' => StaticPageController::getStaticPage(StaticPageType::unveil)],
|
||||
['name' => 'hireStaticPageModel', 'value' => StaticPageController::getStaticPage(StaticPageType::we_hire)],
|
||||
['name' => 'commitStaticPageModel', 'value' => StaticPageController::getStaticPage(StaticPageType::we_commit)],
|
||||
['name' => 'moveStaticPageModel', 'value' => StaticPageController::getStaticPage(StaticPageType::we_move)],
|
||||
['name' => 'produceStaticPageModel', 'value' => StaticPageController::getStaticPage(StaticPageType::we_produce)],
|
||||
['name' => 'listenStaticPageModel', 'value' => StaticPageController::getStaticPage(StaticPageType::we_listen)],
|
||||
['name' => 'confidentialityStaticPageModel', 'value' => StaticPageController::getStaticPage(StaticPageType::confidentiality)],
|
||||
['name' => 'legalsStaticPageModel', 'value' => StaticPageController::getStaticPage(StaticPageType::legals)],
|
||||
/* HOME SECTIONS */
|
||||
['name' => 'homeSections', 'value' => SectionController::getSections([1, 2, 3, 4])],
|
||||
/* UNVEIL SECTION */
|
||||
['name' => 'veilSections', 'value' => SectionController::getSections([5, 6, 7, 8, 9, 10])],
|
||||
/* WE HIRE SECTION */
|
||||
['name' => 'hireSections', 'value' => SectionController::getSections([11, 12, 13, 14, 15])],
|
||||
/* WE COMMIT SECTION */
|
||||
['name' => 'commitSections', 'value' => SectionController::getSections([16, 17, 18, 19, 20, 21])],
|
||||
/* WE MOVE SECTION */
|
||||
['name' => 'moveSections', 'value' => SectionController::getSections([22, 23])],
|
||||
/* WE PRODUCE SECTION */
|
||||
['name' => 'produceSections', 'value' => SectionController::getSections([24, 25, 26, 27, 28, 29])],
|
||||
/* WE LISTEN SECTION */
|
||||
['name' => 'listenSections', 'value' => SectionController::getSections([30])],
|
||||
])->map(function ($array) {
|
||||
View::share($array['name'], (function () use ($array) {
|
||||
return $array['value'] ?: null;
|
||||
})());
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,49 +6,104 @@
|
|||
{{ __('Accueil') }}
|
||||
</a>
|
||||
</li>
|
||||
{{-- HOME --}}
|
||||
<li class="nav-item">
|
||||
<div class="dropdown">
|
||||
<a class="nav-link @if (request()->routeIs('bo.static_pages.*') || request()->routeIs('bo.sections.*')) active @endif dropdown-toggle" data-bs-toggle="dropdown" type="button"
|
||||
<a class="nav-link @if (url()->current() === route('bo.static_pages.edit', $homeStaticPageModel->type->value()) || route('bo.slides.index', 'search=Accueil') || request()->is('bo/sections/1/edit') || request()->is('bo/sections/2/edit') || request()->is('bo/sections/3/edit') || request()->is('bo/sections/4/edit') || request()->routeIs('bo.news.*') || request()->routeIs('bo.strips.*')) active @endif dropdown-toggle" data-bs-toggle="dropdown" type="button"
|
||||
aria-expanded="false">
|
||||
{{ Str::of(__('Pages'))->ucfirst() }}
|
||||
{{ Str::of(__('Accueil du site'))->ucfirst() }}
|
||||
</a>
|
||||
<ol class="dropdown-menu">
|
||||
{{-- HOME PAGE --}}
|
||||
@can('viewAny', \App\Models\StaticPage::class)
|
||||
<li class="nav-item">
|
||||
<a class="nav-link @if (request()->routeIs('bo.static_pages.*')) active @endif" data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.static_pages.index') }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => Str::of(trans_choice('models.classes.static_page', 2))->title()]) }}">
|
||||
{{ Str::of(trans_choice('models.classes.static_page', 2))->title() }}
|
||||
<a class="nav-link @if (url()->current() === route('bo.static_pages.edit', $homeStaticPageModel->type->value())) active @endif" data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.static_pages.edit', $homeStaticPageModel) }}"
|
||||
title="{{ __('crud.helpers.update_model', ['model' => $homeStaticPageModel->type->label()]) }}">
|
||||
{{ sprintf('Page %s', $homeStaticPageModel->type->label()) }}
|
||||
</a>
|
||||
</li>
|
||||
@endcan
|
||||
@can('viewAny', \App\Models\Section::class)
|
||||
{{-- SLIDES --}}
|
||||
@can('viewAny', \App\Models\Slide::class)
|
||||
<li class="nav-item">
|
||||
<a class="nav-link @if (request()->routeIs('bo.sections.*')) active @endif" data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.sections.index') }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => Str::of(__('models.classes.section'))->plural()->title()]) }}">
|
||||
{{ Str::of(__('models.classes.section'))->plural()->title() }}
|
||||
<a class="nav-link @if (url()->current() === route('bo.slides.index', 'search=Accueil')) active @endif" data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.slides.index', 'search=Accueil') }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => Str::of(__('models.classes.slide'))->plural()->title()]) }}">
|
||||
{{ Str::of(__('models.classes.slide'))->plural()->ucfirst() }}
|
||||
</a>
|
||||
</li>
|
||||
@endcan
|
||||
{{-- SECTIONS --}}
|
||||
@can('viewAny', \App\Models\Section::class)
|
||||
@foreach ($homeSections as $section)
|
||||
<li class="nav-item">
|
||||
<a class="nav-link @if (url()->current() === route('bo.sections.edit', $section->id)) active @endif" data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.sections.edit', $section) }}"
|
||||
title="{{ __('crud.helpers.update_model', ['model' => $section->section->label()]) }}">
|
||||
{{ $section->section->label() }}
|
||||
</a>
|
||||
</li>
|
||||
@endforeach
|
||||
@endcan
|
||||
{{-- NEWS --}}
|
||||
@can('viewAny', \App\Models\News::class)
|
||||
<li class="nav-item">
|
||||
<a class="nav-link @if (request()->routeIs('bo.news.*')) active @endif" data-bs-toggle="tooltip" href="{{ route('bo.news.index') }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => Str::of(__('models.classes.news'))->plural()->title()]) }}">
|
||||
{{ Str::of(__('models.classes.news'))->plural()->ucfirst() }}
|
||||
</a>
|
||||
</li>
|
||||
@endcan
|
||||
{{-- STRIPS --}}
|
||||
@can('viewAny', \App\Models\Strip::class)
|
||||
<li class="nav-item">
|
||||
<a class="nav-link @if (request()->routeIs('bo.strips.*')) active @endif" data-bs-toggle="tooltip" href="{{ route('bo.strips.index') }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => Str::of(trans_choice('models.classes.strip', 2))->title()]) }}">
|
||||
{{ Str::of(trans_choice('models.classes.strip', 2))->ucfirst() }}
|
||||
</a>
|
||||
</li>
|
||||
@endcan
|
||||
</ol>
|
||||
</div>
|
||||
</li>
|
||||
@can('viewAny', \App\Models\News::class)
|
||||
<li class="nav-item">
|
||||
<a class="nav-link @if (request()->routeIs('bo.news.*')) active @endif" data-bs-toggle="tooltip" href="{{ route('bo.news.index') }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => Str::of(__('models.classes.news'))->plural()->title()]) }}">
|
||||
{{ Str::of(__('models.classes.news'))->plural()->ucfirst() }}
|
||||
</a>
|
||||
</li>
|
||||
@endcan
|
||||
{{-- UNVEIL --}}
|
||||
<li class="nav-item">
|
||||
<div class="dropdown">
|
||||
<a class="nav-link @if (request()->routeIs('bo.sites.*') || request()->routeIs('bo.logos.*')) active @endif dropdown-toggle" data-bs-toggle="dropdown" type="button"
|
||||
<a class="nav-link @if (url()->current() === route('bo.static_pages.edit', $veilStaticPageModel->type->value()) || request()->is('bo/sections/5/edit') || request()->is('bo/sections/6/edit') || request()->is('bo/sections/7/edit') || request()->is('bo/sections/8/edit') || request()->is('bo/sections/9/edit') || request()->is('bo/sections/10/edit') || request()->routeIs('bo.historicalmilestones.*') || request()->routeIs('bo.sites.*')) active @endif dropdown-toggle" data-bs-toggle="dropdown" type="button"
|
||||
aria-expanded="false">
|
||||
{{ Str::of(__('models.classes.site'))->plural()->title() }}
|
||||
{{ Str::of(__('On se dévoile'))->ucfirst() }}
|
||||
</a>
|
||||
<ol class="dropdown-menu">
|
||||
@can('viewAny', \App\Models\StaticPage::class)
|
||||
<li class="nav-item">
|
||||
<a class="nav-link @if (url()->current() === route('bo.static_pages.edit', $veilStaticPageModel->type->value())) active @endif" data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.static_pages.edit', $veilStaticPageModel) }}"
|
||||
title="{{ __('crud.helpers.update_model', ['model' => $veilStaticPageModel->type->label()]) }}">
|
||||
{{ $veilStaticPageModel->type->label() }}
|
||||
</a>
|
||||
</li>
|
||||
@endcan
|
||||
@can('viewAny', \App\Models\Section::class)
|
||||
@foreach ($veilSections as $section)
|
||||
<li class="nav-item">
|
||||
<a class="nav-link @if (url()->current() === route('bo.sections.edit', $section->id)) active @endif" data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.sections.edit', $section) }}"
|
||||
title="{{ __('crud.helpers.update_model', ['model' => $section->section->label()]) }}">
|
||||
{{ $section->section->label() }}
|
||||
</a>
|
||||
</li>
|
||||
@endforeach
|
||||
@endcan
|
||||
@can('viewAny', \App\Models\HistoricalMilestone::class)
|
||||
<li class="nav-item">
|
||||
<a class="nav-link @if (request()->routeIs('bo.historicalmilestones.*')) active @endif" data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.historicalmilestones.index') }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => Str::of(trans_choice('models.classes.historicalMilestone', 2))->title()]) }}">
|
||||
{{ Str::of(trans_choice('models.classes.historicalMilestone', 2))->ucfirst() }}
|
||||
</a>
|
||||
</li>
|
||||
@endcan
|
||||
@can('viewAny', \App\Models\Site::class)
|
||||
<li class="nav-item">
|
||||
<a class="nav-link @if (request()->routeIs('bo.sites.*')) active @endif" data-bs-toggle="tooltip"
|
||||
|
|
@ -58,6 +113,208 @@
|
|||
</a>
|
||||
</li>
|
||||
@endcan
|
||||
</ol>
|
||||
</div>
|
||||
</li>
|
||||
{{-- WE HIRE --}}
|
||||
<li class="nav-item">
|
||||
<div class="dropdown">
|
||||
<a class="nav-link @if (url()->current() === route('bo.static_pages.edit', $hireStaticPageModel->type->value()) || request()->is('bo/sections/11/edit') || request()->is('bo/sections/12/edit') || request()->is('bo/sections/13/edit') || request()->is('bo/sections/14/edit') || request()->is('bo/sections/15/edit') || request()->routeIs('bo.job_video.*') || route('bo.slides.index', 'search=Respecter la terre') || request()->routeIs('bo.testimonials.*')) active @endif dropdown-toggle" data-bs-toggle="dropdown" type="button"
|
||||
aria-expanded="false">
|
||||
{{ Str::of(__('On embauche'))->ucfirst() }}
|
||||
</a>
|
||||
<ol class="dropdown-menu">
|
||||
@can('viewAny', \App\Models\StaticPage::class)
|
||||
<li class="nav-item">
|
||||
<a class="nav-link @if (url()->current() === route('bo.static_pages.edit', $hireStaticPageModel->type->value())) active @endif" data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.static_pages.edit', $hireStaticPageModel) }}"
|
||||
title="{{ __('crud.helpers.update_model', ['model' => $hireStaticPageModel->type->label()]) }}">
|
||||
{{ $hireStaticPageModel->type->label() }}
|
||||
</a>
|
||||
</li>
|
||||
@endcan
|
||||
@can('viewAny', \App\Models\Section::class)
|
||||
@foreach ($hireSections as $section)
|
||||
<li class="nav-item">
|
||||
<a class="nav-link @if (url()->current() === route('bo.sections.edit', $section->id)) active @endif" data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.sections.edit', $section) }}"
|
||||
title="{{ __('crud.helpers.update_model', ['model' => $section->section->label()]) }}">
|
||||
{{ $section->section->label() }}
|
||||
</a>
|
||||
</li>
|
||||
@endforeach
|
||||
@endcan
|
||||
@can('viewAny', \App\Models\JobVideo::class)
|
||||
<li class="nav-item">
|
||||
<a class="nav-link @if (request()->routeIs('bo.jobvideos.*')) active @endif" data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.jobvideos.index') }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => Str::of(trans_choice('models.classes.job_video', 2))->title()]) }}">
|
||||
{{ Str::of(trans_choice('models.classes.job_video', 2))->ucfirst() }}
|
||||
</a>
|
||||
</li>
|
||||
@endcan
|
||||
@can('viewAny', \App\Models\Slide::class)
|
||||
<li class="nav-item">
|
||||
<a class="nav-link @if (url()->current() === route('bo.slides.index', 'search=Respecter la terre')) active @endif" data-bs-toggle="tooltip" href="{{ route('bo.slides.index', 'search=Respecter la terre') }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => Str::of(__('models.classes.slide'))->plural()->title()]) }}">
|
||||
{{ Str::of(__('models.classes.slide'))->plural()->ucfirst() }}
|
||||
</a>
|
||||
</li>
|
||||
@endcan
|
||||
@can('viewAny', \App\Models\Testimonial::class)
|
||||
<li class="nav-item">
|
||||
<a class="nav-link @if (request()->routeIs('bo.testimonials.*')) active @endif" data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.testimonials.index') }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => Str::of(__('models.classes.testimonial'))->plural()->title()]) }}">
|
||||
{{ Str::of(__('models.classes.testimonial'))->plural()->ucfirst() }}
|
||||
</a>
|
||||
</li>
|
||||
@endcan
|
||||
</ol>
|
||||
</div>
|
||||
</li>
|
||||
{{-- WE COMMIT --}}
|
||||
<li class="nav-item">
|
||||
<div class="dropdown">
|
||||
<a class="nav-link @if (url()->current() === route('bo.static_pages.edit', $commitStaticPageModel->type->value()) || request()->is('bo/sections/16/edit') || request()->is('bo/sections/17/edit') || request()->is('bo/sections/18/edit') || request()->is('bo/sections/19/edit') || request()->is('bo/sections/20/edit') || request()->is('bo/sections/21/edit')) active @endif dropdown-toggle" data-bs-toggle="dropdown" type="button"
|
||||
aria-expanded="false">
|
||||
{{ Str::of(__('On s\'engage'))->ucfirst() }}
|
||||
</a>
|
||||
<ol class="dropdown-menu">
|
||||
@can('viewAny', \App\Models\StaticPage::class)
|
||||
<li class="nav-item">
|
||||
<a class="nav-link @if (url()->current() === route('bo.static_pages.edit', $commitStaticPageModel->type->value())) active @endif" data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.static_pages.edit', $commitStaticPageModel) }}"
|
||||
title="{{ __('crud.helpers.update_model', ['model' => $commitStaticPageModel->type->label()]) }}">
|
||||
{{ $commitStaticPageModel->type->label() }}
|
||||
</a>
|
||||
</li>
|
||||
@endcan
|
||||
@can('viewAny', \App\Models\Section::class)
|
||||
@foreach ($commitSections as $section)
|
||||
<li class="nav-item">
|
||||
<a class="nav-link @if (url()->current() === route('bo.sections.edit', $section->id)) active @endif" data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.sections.edit', $section) }}"
|
||||
title="{{ __('crud.helpers.update_model', ['model' => $section->section->label()]) }}">
|
||||
{{ $section->section->label() }}
|
||||
</a>
|
||||
</li>
|
||||
@endforeach
|
||||
@endcan
|
||||
@can('viewAny', \App\Models\Testimonial::class)
|
||||
<li class="nav-item">
|
||||
<a class="nav-link @if (request()->routeIs('bo.testimonials.*')) active @endif" data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.testimonials.index') }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => Str::of(__('models.classes.testimonial'))->plural()->title()]) }}">
|
||||
{{ Str::of(__('models.classes.testimonial'))->plural()->ucfirst() }}
|
||||
</a>
|
||||
</li>
|
||||
@endcan
|
||||
</ol>
|
||||
</div>
|
||||
</li>
|
||||
{{-- WE MOVE --}}
|
||||
<li class="nav-item">
|
||||
<div class="dropdown">
|
||||
<a class="nav-link @if (url()->current() === route('bo.static_pages.edit', $moveStaticPageModel->type->value()) || request()->is('bo/sections/22/edit') || request()->is('bo/sections/23/edit')) active @endif dropdown-toggle" data-bs-toggle="dropdown" type="button"
|
||||
aria-expanded="false">
|
||||
{{ Str::of(__('On bouge ensemble'))->ucfirst() }}
|
||||
</a>
|
||||
<ol class="dropdown-menu">
|
||||
@can('viewAny', \App\Models\StaticPage::class)
|
||||
<li class="nav-item">
|
||||
<a class="nav-link @if (url()->current() === route('bo.static_pages.edit', $moveStaticPageModel->type->value())) active @endif" data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.static_pages.edit', $moveStaticPageModel) }}"
|
||||
title="{{ __('crud.helpers.update_model', ['model' => $moveStaticPageModel->type->label()]) }}">
|
||||
{{ $moveStaticPageModel->type->label() }}
|
||||
</a>
|
||||
</li>
|
||||
@endcan
|
||||
@can('viewAny', \App\Models\Section::class)
|
||||
@foreach ($moveSections as $section)
|
||||
<li class="nav-item">
|
||||
<a class="nav-link @if (url()->current() === route('bo.sections.edit', $section->id)) active @endif" data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.sections.edit', $section) }}"
|
||||
title="{{ __('crud.helpers.update_model', ['model' => $section->section->label()]) }}">
|
||||
{{ $section->section->label() }}
|
||||
</a>
|
||||
</li>
|
||||
@endforeach
|
||||
@endcan
|
||||
</ol>
|
||||
</div>
|
||||
</li>
|
||||
{{-- WE PRODUCE --}}
|
||||
<li class="nav-item">
|
||||
<div class="dropdown">
|
||||
<a class="nav-link @if (url()->current() === route('bo.static_pages.edit', $produceStaticPageModel->type->value()) || request()->is('bo/sections/24/edit') || request()->is('bo/sections/25/edit') || request()->is('bo/sections/26/edit') || request()->is('bo/sections/27/edit') || request()->is('bo/sections/28/edit') || request()->is('bo/sections/29/edit')) active @endif dropdown-toggle" data-bs-toggle="dropdown" type="button"
|
||||
aria-expanded="false">
|
||||
{{ Str::of(__('On produit'))->ucfirst() }}
|
||||
</a>
|
||||
<ol class="dropdown-menu">
|
||||
@can('viewAny', \App\Models\StaticPage::class)
|
||||
<li class="nav-item">
|
||||
<a class="nav-link @if (url()->current() === route('bo.static_pages.edit', $produceStaticPageModel->type->value())) active @endif" data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.static_pages.edit', $produceStaticPageModel) }}"
|
||||
title="{{ __('crud.helpers.update_model', ['model' => $produceStaticPageModel->type->label()]) }}">
|
||||
{{ $produceStaticPageModel->type->label() }}
|
||||
</a>
|
||||
</li>
|
||||
@endcan
|
||||
@can('viewAny', \App\Models\Section::class)
|
||||
@foreach ($produceSections as $section)
|
||||
<li class="nav-item">
|
||||
<a class="nav-link @if (url()->current() === route('bo.sections.edit', $section->id)) active @endif" data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.sections.edit', $section) }}"
|
||||
title="{{ __('crud.helpers.update_model', ['model' => $section->section->label()]) }}">
|
||||
{{ $section->section->label() }}
|
||||
</a>
|
||||
</li>
|
||||
@endforeach
|
||||
@endcan
|
||||
</ol>
|
||||
</div>
|
||||
</li>
|
||||
{{-- WE LISTEN --}}
|
||||
<li class="nav-item">
|
||||
<div class="dropdown">
|
||||
<a class="nav-link @if (url()->current() === route('bo.static_pages.edit', $listenStaticPageModel->type->value()) || request()->is('bo/sections/30/edit')) active @endif dropdown-toggle" data-bs-toggle="dropdown" type="button"
|
||||
aria-expanded="false">
|
||||
{{ Str::of(__('On vous écoute'))->ucfirst() }}
|
||||
</a>
|
||||
<ol class="dropdown-menu">
|
||||
@can('viewAny', \App\Models\StaticPage::class)
|
||||
<li class="nav-item">
|
||||
<a class="nav-link @if (url()->current() === route('bo.static_pages.edit', $listenStaticPageModel->type->value())) active @endif" data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.static_pages.edit', $listenStaticPageModel) }}"
|
||||
title="{{ __('crud.helpers.update_model', ['model' => $listenStaticPageModel->type->label()]) }}">
|
||||
{{ $listenStaticPageModel->type->label() }}
|
||||
</a>
|
||||
</li>
|
||||
@endcan
|
||||
@can('viewAny', \App\Models\Section::class)
|
||||
@foreach ($listenSections as $section)
|
||||
<li class="nav-item">
|
||||
<a class="nav-link @if (url()->current() === route('bo.sections.edit', $section->id)) active @endif" data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.sections.edit', $section) }}"
|
||||
title="{{ __('crud.helpers.update_model', ['model' => $section->section->label()]) }}">
|
||||
{{ $section->section->label() }}
|
||||
</a>
|
||||
</li>
|
||||
@endforeach
|
||||
@endcan
|
||||
</ol>
|
||||
</div>
|
||||
</li>
|
||||
{{-- MORE --}}
|
||||
<li class="nav-item">
|
||||
<div class="dropdown">
|
||||
<a class="nav-link @if (request()->routeIs('bo.logos.*') || request()->is('bo/pages/2/edit') || request()->is('bo/pages/3/edit')) active @endif dropdown-toggle" data-bs-toggle="dropdown" type="button"
|
||||
aria-expanded="false">
|
||||
{{ Str::of(__('Voir plus'))->ucfirst() }}
|
||||
</a>
|
||||
<ol class="dropdown-menu">
|
||||
{{-- LOGO --}}
|
||||
@can('viewAny', \App\Models\Logo::class)
|
||||
<li class="nav-item">
|
||||
<a class="nav-link @if (request()->routeIs('bo.logos.*')) active @endif" data-bs-toggle="tooltip"
|
||||
|
|
@ -67,52 +324,30 @@
|
|||
</a>
|
||||
</li>
|
||||
@endcan
|
||||
{{-- CONFIDENTIALITY --}}
|
||||
@can('viewAny', \App\Models\StaticPage::class)
|
||||
<li class="nav-item">
|
||||
<a class="nav-link @if (url()->current() === route('bo.static_pages.edit', $confidentialityStaticPageModel->type->value())) active @endif" data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.static_pages.edit', $confidentialityStaticPageModel) }}"
|
||||
title="{{ __('crud.helpers.update_model', ['model' => $confidentialityStaticPageModel->type->label()]) }}">
|
||||
{{ sprintf('Page %s', $confidentialityStaticPageModel->type->label()) }}
|
||||
</a>
|
||||
</li>
|
||||
@endcan
|
||||
{{-- LEGALS --}}
|
||||
@can('viewAny', \App\Models\StaticPage::class)
|
||||
<li class="nav-item">
|
||||
<a class="nav-link @if (url()->current() === route('bo.static_pages.edit', $legalsStaticPageModel->type->value())) active @endif" data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.static_pages.edit', $legalsStaticPageModel) }}"
|
||||
title="{{ __('crud.helpers.update_model', ['model' => $legalsStaticPageModel->type->label()]) }}">
|
||||
{{ sprintf('Page %s', $legalsStaticPageModel->type->label()) }}
|
||||
</a>
|
||||
</li>
|
||||
@endcan
|
||||
</ol>
|
||||
</div>
|
||||
</li>
|
||||
@can('viewAny', \App\Models\Slide::class)
|
||||
<li class="nav-item">
|
||||
<a class="nav-link @if (request()->routeIs('bo.slides.*')) active @endif" data-bs-toggle="tooltip" href="{{ route('bo.slides.index') }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => Str::of(__('models.classes.slide'))->plural()->title()]) }}">
|
||||
{{ Str::of(__('models.classes.slide'))->plural()->ucfirst() }}
|
||||
</a>
|
||||
</li>
|
||||
@endcan
|
||||
@can('viewAny', \App\Models\Strip::class)
|
||||
<li class="nav-item">
|
||||
<a class="nav-link @if (request()->routeIs('bo.strips.*')) active @endif" data-bs-toggle="tooltip" href="{{ route('bo.strips.index') }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => Str::of(trans_choice('models.classes.strip', 2))->title()]) }}">
|
||||
{{ Str::of(trans_choice('models.classes.strip', 2))->ucfirst() }}
|
||||
</a>
|
||||
</li>
|
||||
@endcan
|
||||
@can('viewAny', \App\Models\Testimonial::class)
|
||||
<li class="nav-item">
|
||||
<a class="nav-link @if (request()->routeIs('bo.testimonials.*')) active @endif" data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.testimonials.index') }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => Str::of(__('models.classes.testimonial'))->plural()->title()]) }}">
|
||||
{{ Str::of(__('models.classes.testimonial'))->plural()->ucfirst() }}
|
||||
</a>
|
||||
</li>
|
||||
@endcan
|
||||
@can('viewAny', \App\Models\JobVideo::class)
|
||||
<li class="nav-item">
|
||||
<a class="nav-link @if (request()->routeIs('bo.jobvideos.*')) active @endif" data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.jobvideos.index') }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => Str::of(trans_choice('models.classes.job_video', 2))->title()]) }}">
|
||||
{{ Str::of(trans_choice('models.classes.job_video', 2))->ucfirst() }}
|
||||
</a>
|
||||
</li>
|
||||
@endcan
|
||||
@can('viewAny', \App\Models\HistoricalMilestone::class)
|
||||
<li class="nav-item">
|
||||
<a class="nav-link @if (request()->routeIs('bo.historicalmilestones.*')) active @endif" data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.historicalmilestones.index') }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => Str::of(trans_choice('models.classes.historicalMilestone', 2))->title()]) }}">
|
||||
{{ Str::of(trans_choice('models.classes.historicalMilestone', 2))->ucfirst() }}
|
||||
</a>
|
||||
</li>
|
||||
@endcan
|
||||
|
||||
@canAny(['isConceptor', 'viewAny'], \App\Models\User::class)
|
||||
<li class="nav-item">
|
||||
<div class="dropdown">
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue