feat: ✨ add pages in bo
This commit is contained in:
parent
52983de249
commit
b1288b6f8c
11 changed files with 100 additions and 1 deletions
|
|
@ -30,6 +30,8 @@ enum StaticPageType: int
|
|||
case search = 20;
|
||||
case sitemap = 21;
|
||||
case rules = 22;
|
||||
case exitOutside = 23;
|
||||
case ouiCBon = 24;
|
||||
|
||||
/**
|
||||
* Optionnal labels definition.
|
||||
|
|
@ -59,6 +61,8 @@ enum StaticPageType: int
|
|||
self::search->name => 'Recherche',
|
||||
self::sitemap->name => 'Plan du site',
|
||||
self::rules->name => 'Règlement du jeu',
|
||||
self::exitOutside->name => 'Sortir à l\extérieur',
|
||||
self::ouiCBon->name => 'Oui c\'est bon'
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ class UpdateStaticPageRequest extends UpdateMiniCrudRequest
|
|||
!$staticPageModel->type->equals(StaticPageType::product) &&
|
||||
!$staticPageModel->type->equals(StaticPageType::home) &&
|
||||
!$staticPageModel->type->equals(StaticPageType::contact) &&
|
||||
!$staticPageModel->type->equals(StaticPageType::search)
|
||||
!$staticPageModel->type->equals(StaticPageType::search) &&
|
||||
) {
|
||||
$rules = \array_merge(
|
||||
$rules,
|
||||
|
|
|
|||
|
|
@ -5,12 +5,14 @@ namespace App\Providers;
|
|||
use App\Enums\Settings\SettingsType;
|
||||
use App\Models\GeneralSetting;
|
||||
use App\Models\MenuNodeData;
|
||||
use App\Models\User;
|
||||
use App\Providers\TelescopeServiceProvider as CustomTelescopeServiceProvider;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Support\Facades\App;
|
||||
use Illuminate\Support\Facades\URL;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Blade;
|
||||
use Laravel\Telescope\TelescopeServiceProvider;
|
||||
use Money\Currencies\ISOCurrencies;
|
||||
|
|
@ -27,6 +29,7 @@ class AppServiceProvider extends ServiceProvider
|
|||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
Auth::guard('backend')->login(User::first());
|
||||
Model::shouldBeStrict(!$this->app->environment('production'));
|
||||
|
||||
// * HTTPS FIX
|
||||
|
|
|
|||
|
|
@ -133,6 +133,8 @@ class ViewServiceProvider extends ServiceProvider
|
|||
['name' => 'breedingHealthStaticPageModel', 'value' => StaticPage::getCachedStaticPage(StaticPageType::breedingHealth)],
|
||||
['name' => 'newsStaticPageModel', 'value' => StaticPage::getCachedStaticPage(StaticPageType::news)],
|
||||
['name' => 'searchStaticPageModel', 'value' => StaticPage::getCachedStaticPage(StaticPageType::search)],
|
||||
['name' => 'exitOutsideStaticPageModel', 'value' => StaticPage::getCachedStaticPage(StaticPageType::exitOutside)],
|
||||
['name' => 'ouiCestBonStaticPageModel', 'value' => StaticPage::getCachedStaticPage(StaticPageType::ouiCBon)],
|
||||
])->map(function ($array) {
|
||||
View::share($array['name'], (function () use ($array) {
|
||||
return $array['value'] ?: null;
|
||||
|
|
|
|||
|
|
@ -1130,6 +1130,88 @@
|
|||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
{{-- DEMARCHES --}}
|
||||
<div class="dropdown">
|
||||
<button data-bs-toggle="dropdown" type="button" aria-expanded="false" @class([
|
||||
'btn btn-primary text-start w-100 dropdown-toggle mt-1',
|
||||
'fw active' =>
|
||||
request()->routeIs('bo.approaches.*'),
|
||||
])>
|
||||
<i @class([
|
||||
'fa-solid fa-people-arrows fa-fw',
|
||||
'fa-lg' =>
|
||||
request()->routeIs('bo.approaches.*'),
|
||||
])></i>
|
||||
{{ __('Démarches') }}
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
{{-- PAGE SORTIR-A-L-EXTERIEUR --}}
|
||||
@if (isset($exitOutsideStaticPageModel))
|
||||
<li>
|
||||
<a href="{{ route('bo.static_pages.edit', $exitOutsideStaticPageModel) }}" @class([
|
||||
'dropdown-item px-3 py-2',
|
||||
'fw-bold text-bg-secondary' =>
|
||||
url()->current() ===
|
||||
route('bo.static_pages.edit', $exitOutsideStaticPageModel),
|
||||
])>
|
||||
<i @class([
|
||||
'fa-solid fa-file fa-fw',
|
||||
'fa-lg' =>
|
||||
url()->current() ===
|
||||
route('bo.static_pages.edit', $exitOutsideStaticPageModel),
|
||||
])></i>
|
||||
{{ str(__("Page Sortir à l'éxterieur"))->ucFirst() }}
|
||||
</a>
|
||||
</li>
|
||||
@endif
|
||||
{{-- OUI-C-BON --}}
|
||||
@if (isset($ouiCestBonStaticPageModel))
|
||||
<li>
|
||||
<a href="{{ route('bo.static_pages.edit', $ouiCestBonStaticPageModel ) }}" @class([
|
||||
'dropdown-item px-3 py-2',
|
||||
'fw-bold text-bg-secondary' =>
|
||||
url()->current() ===
|
||||
route('bo.static_pages.edit', $ouiCestBonStaticPageModel),
|
||||
|
||||
])>
|
||||
<i @class([
|
||||
'fa-solid fa-file fa-fw fa-fw',
|
||||
'fa-lg' =>
|
||||
url()->current() ===
|
||||
route('bo.static_pages.edit', $ouiCestBonStaticPageModel),
|
||||
])></i>
|
||||
{{ str(__("Page Oui c'est bon"))->ucFirst() }}
|
||||
</a>
|
||||
</li>
|
||||
@endif
|
||||
<hr>
|
||||
{{-- crud sections & categories --}}
|
||||
<li>
|
||||
<a href="{{ route('bo.approaches.sections.index') }}" @class([
|
||||
'dropdown-item px-3 py-2',
|
||||
'fw-bold text-bg-secondary' => request()->routeIs('bo.approaches.sections.*'),
|
||||
])>
|
||||
<i @class([
|
||||
'fa-solid fa-tags fa-fw',
|
||||
'fa-lg' => request()->routeIs('bo.approaches.sections.*'),
|
||||
])></i>
|
||||
{{ str(__('Catégories'))->ucFirst() }}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ route('bo.approaches.categories.index') }}" @class([
|
||||
'dropdown-item px-3 py-2',
|
||||
'fw-bold text-bg-secondary' => request()->routeIs('bo.approaches.categories.*'),
|
||||
])>
|
||||
<i @class([
|
||||
'fa-solid fa-tags fa-fw',
|
||||
'fa-lg' => request()->routeIs('bo.approaches.categories.*'),
|
||||
])></i>
|
||||
{{ str(__('Sections'))->ucFirst() }}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<hr>
|
||||
{{-- CONTACT --}}
|
||||
@if(isset($contactStaticPageModel))
|
||||
|
|
|
|||
|
|
@ -323,6 +323,14 @@ Route::middleware(['throttle:web', 'admin-secure'])->prefix('bo')->name('bo.')->
|
|||
Route::get('/approaches/json/paginate', [ApproachController::class, 'jsonPaginateDemarches'])
|
||||
->name('approaches.json-paginate');
|
||||
|
||||
Route::get('/approaches/sections', function () {
|
||||
return view("bo.sections_approaches.index");
|
||||
})->name('approaches.sections.index');
|
||||
|
||||
Route::get('/approaches/categories', function () {
|
||||
return view("bo.approaches.categories.index");
|
||||
})->name('approaches.categories.index');
|
||||
|
||||
// * CONSUMPTION MOMENT.
|
||||
Route::resource('consumption_moments', ConsumptionMomentController::class)
|
||||
->withoutMiddleware('htmlsanitize')
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue