Update PHP version requirement to ^8.2 in composer files, refactor User model access control logic, clean up MainSectionResource, enhance EditMainSection to include related pages, modify AppServiceProvider to clear subsection cache, change fallback locale to 'en', and improve DesktopNavBar and BasicFooter components for better accessibility and content accuracy.

This commit is contained in:
F4ilji
2025-09-01 13:48:24 +05:00
parent 3d300ac4d1
commit 8b213ee803
9 changed files with 47 additions and 53 deletions
+1 -2
View File
@@ -100,8 +100,7 @@ class User extends Authenticatable implements FilamentUser, SeoTitleInterface, S
public function canAccessPanel(Panel|\Filament\Panel $panel): bool public function canAccessPanel(Panel|\Filament\Panel $panel): bool
{ {
return match ($panel->getId()) { return match ($panel->getId()) {
"admin" => $this->hasRole(Utils::getSuperAdminName()), "admin", "dashboard" => $this->hasRole(config('filament-shield.dashboard_user.name', 'dashboard_user'))
"dashboard" => $this->hasRole(config('filament-shield.dashboard_user.name', 'dashboard_user'))
|| $this->hasRole(Utils::getSuperAdminName()) || $this->hasRole(Utils::getSuperAdminName())
|| $this->hasRole(config('filament-shield.invited_user.name', 'invited_user')), || $this->hasRole(config('filament-shield.invited_user.name', 'invited_user')),
default => false, default => false,
@@ -23,15 +23,8 @@ class MainSectionResource extends Resource
public static ?string $pluralLabel = 'Главные разделы'; public static ?string $pluralLabel = 'Главные разделы';
protected static ?string $navigationGroup = 'Структура приложения'; protected static ?string $navigationGroup = 'Структура приложения';
public static function form(Form $form): Form public static function form(Form $form): Form
{ {
return $form return $form
@@ -32,7 +32,7 @@ class EditMainSection extends EditRecord
$this->subSection_ids = SubSection::query()->where('main_section_id', '=', $this->record->id)->pluck('id')->toArray(); $this->subSection_ids = SubSection::query()->where('main_section_id', '=', $this->record->id)->pluck('id')->toArray();
SubSection::query()->where('main_section_id', '=', $this->record->id)->update(['main_section_id' => NULL]); SubSection::query()->where('main_section_id', '=', $this->record->id)->update(['main_section_id' => NULL]);
SubSection::whereIn('id', $this->subSection_ids)->update(['main_section_id' => $this->record->id]); SubSection::whereIn('id', $this->subSection_ids)->update(['main_section_id' => $this->record->id]);
$subSections = SubSection::query()->where('main_section_id', '=', $this->record->id)->get(); $subSections = SubSection::query()->where('main_section_id', '=', $this->record->id)->with('pages')->get();
foreach ($subSections as $subSection) { foreach ($subSections as $subSection) {
foreach ($subSection->pages as $page) { foreach ($subSection->pages as $page) {
+3
View File
@@ -23,6 +23,7 @@ use App\Containers\User\Observers\UserDetailObserver;
use App\Containers\Widget\Models\ContactWidget; use App\Containers\Widget\Models\ContactWidget;
use App\Containers\Widget\Models\PageReferenceList; use App\Containers\Widget\Models\PageReferenceList;
use App\Containers\Widget\Models\Slide; use App\Containers\Widget\Models\Slide;
use App\Filament\Resources\MainSectionResource\RelationManagers\SubSectionsRelationManager;
use App\Observers\AcademicJournalObserver; use App\Observers\AcademicJournalObserver;
use App\Observers\AdditionalEducationObserver; use App\Observers\AdditionalEducationObserver;
use App\Observers\AdmissionCampaignObserver; use App\Observers\AdmissionCampaignObserver;
@@ -41,6 +42,7 @@ use App\Observers\SlideObserver;
use App\Observers\SubSectionObserver; use App\Observers\SubSectionObserver;
use App\Observers\UserObserver; use App\Observers\UserObserver;
use App\Services\App\Cache\SliderCacheService; use App\Services\App\Cache\SliderCacheService;
use App\Services\App\Cache\SubSectionCacheService;
use App\Ship\Contracts\SeoServiceInterface; use App\Ship\Contracts\SeoServiceInterface;
use App\Ship\Services\SeoPageService; use App\Ship\Services\SeoPageService;
use Carbon\Carbon; use Carbon\Carbon;
@@ -76,6 +78,7 @@ class AppServiceProvider extends ServiceProvider
FilamentView::registerRenderHook(TablesRenderHook::TOOLBAR_REORDER_TRIGGER_AFTER, function () { FilamentView::registerRenderHook(TablesRenderHook::TOOLBAR_REORDER_TRIGGER_AFTER, function () {
(new SliderCacheService())->clearAllCacheByModel(); (new SliderCacheService())->clearAllCacheByModel();
(new SubSectionCacheService())->clearAllCacheByModel();
}); });
} }
+1 -1
View File
@@ -5,7 +5,7 @@
"keywords": ["laravel", "framework"], "keywords": ["laravel", "framework"],
"license": "MIT", "license": "MIT",
"require": { "require": {
"php": "^8.1", "php": "^8.2",
"ext-curl": "*", "ext-curl": "*",
"ext-zip": "*", "ext-zip": "*",
"alxdorosenco/porto-for-laravel": "^10.0", "alxdorosenco/porto-for-laravel": "^10.0",
Generated
+2 -2
View File
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "46d10b4875c40f8c0425ba3eab11c904", "content-hash": "43b10611f8194dcbafa73ce6ec065b66",
"packages": [ "packages": [
{ {
"name": "alxdorosenco/porto-for-laravel", "name": "alxdorosenco/porto-for-laravel",
@@ -13506,7 +13506,7 @@
"prefer-stable": true, "prefer-stable": true,
"prefer-lowest": false, "prefer-lowest": false,
"platform": { "platform": {
"php": "^8.1", "php": "^8.2",
"ext-curl": "*", "ext-curl": "*",
"ext-zip": "*" "ext-zip": "*"
}, },
+1 -1
View File
@@ -96,7 +96,7 @@ return [
| |
*/ */
'fallback_locale' => 'ru', 'fallback_locale' => 'en',
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
+10 -10
View File
@@ -3,13 +3,14 @@
class="hs-collapse hidden overflow-hidden transition-all duration-300 basis-full grow lg:block"> class="hs-collapse hidden overflow-hidden transition-all duration-300 basis-full grow lg:block">
<div <div
class="overflow-hidden overflow-y-auto max-h-[75vh] [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300"> class="overflow-hidden overflow-y-auto max-h-[75vh] [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300">
<div <div
class="flex flex-col gap-x-0 mt-5 md:flex-row md:items-center md:justify-end md:gap-x-7 md:mt-0 md:ps-7 md:divide-y-0 md:divide-solid"> class="flex flex-col gap-x-0 mt-5 md:flex-row md:items-center md:justify-end md:gap-x-7 md:mt-0 md:ps-7 md:divide-y-0 md:divide-solid">
<template v-if="sections && sections.data"> <template v-if="sections && sections.data">
<template v-for="section in sections.data" :key="section.id"> <template v-for="section in sections.data" :key="section.id">
<div <div
:id="'nav-section-' + section.slug" :id="'nav-section-' + section.slug"
class="hs-dropdown [--strategy:static] md:[--strategy:absolute] [--adaptive:none] md:[--trigger:hover] py-3 md:py-6"> class="hs-dropdown [--strategy:static] md:[--strategy:absolute] [--adaptive:none] md:[--trigger:hover] py-3">
<button <button
:id="'nav-section-btn-' + section.slug" :id="'nav-section-btn-' + section.slug"
type="button" type="button"
@@ -59,8 +60,9 @@
</div> </div>
</template> </template>
</template> </template>
</div>
<a @click="this.toggleBvi" href="#" class="hover:opacity-70 py-3 open-bvi "> <div class="flex md:gap-x-7 md:items-center md:justify-end">
<a @click="this.toggleBvi" href="#" class="hover:opacity-70 open-bvi ">
<svg :class="!underSliderHeader ? 'text-white' : 'text-black'" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" <svg :class="!underSliderHeader ? 'text-white' : 'text-black'" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
stroke="currentColor" stroke="currentColor"
class="w-6 h-6 duration-300 md:block hidden"> class="w-6 h-6 duration-300 md:block hidden">
@@ -71,8 +73,7 @@
<span :class="!underSliderHeader ? 'text-white' : 'text-black'" class="md:hidden">Режим для слабовидящих</span> <span :class="!underSliderHeader ? 'text-white' : 'text-black'" class="md:hidden">Режим для слабовидящих</span>
</a> </a>
<Link :href="route('client.schedule.index')" class="hover:opacity-70">
<Link :href="route('client.schedule.index')" class="hover:opacity-70 py-3">
<svg :class="!underSliderHeader ? 'text-white' : 'text-black'" xmlns="http://www.w3.org/2000/svg" <svg :class="!underSliderHeader ? 'text-white' : 'text-black'" xmlns="http://www.w3.org/2000/svg"
fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"
class="w-6 h-6 duration-300 md:block hidden"> class="w-6 h-6 duration-300 md:block hidden">
@@ -82,7 +83,7 @@
<span :class="!underSliderHeader ? 'text-white' : 'text-black'" class="md:hidden">Расписание</span> <span :class="!underSliderHeader ? 'text-white' : 'text-black'" class="md:hidden">Расписание</span>
</Link> </Link>
<button class="hover:opacity-70 py-3 cursor-pointer" data-hs-overlay="#open-search-modal"> <button class="hover:opacity-70 cursor-pointer" data-hs-overlay="#open-search-modal">
<svg :class="!underSliderHeader ? 'text-white' : 'text-black'" xmlns="http://www.w3.org/2000/svg" <svg :class="!underSliderHeader ? 'text-white' : 'text-black'" xmlns="http://www.w3.org/2000/svg"
fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"
class="w-6 h-6 duration-300 md:block hidden"> class="w-6 h-6 duration-300 md:block hidden">
@@ -92,7 +93,7 @@
<span :class="!underSliderHeader ? 'text-white' : 'text-black'" class="md:hidden">Поиск</span> <span :class="!underSliderHeader ? 'text-white' : 'text-black'" class="md:hidden">Поиск</span>
</button> </button>
<button class="hover:opacity-70 py-3 cursor-pointer" data-hs-overlay="#open-search-sveden-modal"> <button class="hover:opacity-70 cursor-pointer" data-hs-overlay="#open-search-sveden-modal">
<svg :class="!underSliderHeader ? 'text-white' : 'text-black'" xmlns="http://www.w3.org/2000/svg" <svg :class="!underSliderHeader ? 'text-white' : 'text-black'" xmlns="http://www.w3.org/2000/svg"
fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"
class="w-6 h-6 duration-300 md:block hidden"> class="w-6 h-6 duration-300 md:block hidden">
@@ -102,10 +103,9 @@
<span :class="!underSliderHeader ? 'text-white' : 'text-black'" class="md:hidden">Поиск</span> <span :class="!underSliderHeader ? 'text-white' : 'text-black'" class="md:hidden">Поиск</span>
</button> </button>
</div> </div>
</div> </div>
</div> </div>
</template> </template>
+1 -2
View File
@@ -16,7 +16,7 @@ export default {
<!-- End Language Dropdown --> <!-- End Language Dropdown -->
<div> <div>
<div class="mt-3 grid space-y-3 text-sm"> <div class="mt-3 grid space-y-3 text-sm">
<p class="inline-flex gap-x-2 text-[12px]">© Нижнетагильский государственный социально-педагогический институт (Филиал УРГПУ)</p> <p class="inline-flex gap-x-2 text-[12px]">© Нижнетагильский государственный социально-педагогический институт (филиал) УрГПУ</p>
<p class="inline-flex gap-x-2 text-[12px]">Красногвардейская улица, 57, Нижний Тагил, Свердловская область, 622031</p> <p class="inline-flex gap-x-2 text-[12px]">Красногвардейская улица, 57, Нижний Тагил, Свердловская область, 622031</p>
</div> </div>
</div> </div>
@@ -24,7 +24,6 @@ export default {
<div> <div>
<div class="mt-3 grid space-y-3 text-sm"> <div class="mt-3 grid space-y-3 text-sm">
<p><a class="underline inline-flex gap-x-2 hover:text-gray-200 text-[12px]" target="_blank" href="/sveden/">Сведения об образовательной организации</a></p> <p><a class="underline inline-flex gap-x-2 hover:text-gray-200 text-[12px]" target="_blank" href="/sveden/">Сведения об образовательной организации</a></p>
<p><a class="underline inline-flex gap-x-2 hover:text-gray-200 text-[12px]" target="_blank" href="/upload/824_%D0%9E%D0%B1_%D1%83%D1%82%D0%B2_%D0%9F%D0%BE%D0%BB%D0%B8%D1%82_%D0%BE%D0%B1%D1%80_%D0%B7%D0%B0%D1%89%D0%B8%D1%82_%D0%BF%D0%B5%D1%80%D1%81_%D0%B4%D0%B0%D0%BD.pdf">Политика обработки персональных данных</a></p>
</div> </div>
</div> </div>