diff --git a/app/Filament/Components/Forms/PageForm.php b/app/Filament/Components/Forms/PageForm.php index c1dbdcb..721a0b9 100644 --- a/app/Filament/Components/Forms/PageForm.php +++ b/app/Filament/Components/Forms/PageForm.php @@ -5,56 +5,17 @@ namespace App\Filament\Components\Forms; use App\Enums\CustomFormStatus; use App\Enums\PostStatus; use App\Filament\Components\Forms\ItemForm\Pages\ContentBuilderItem; -use App\Helpers\ByteConverter; -use App\Models\Category; -use App\Models\CustomForm; -use App\Models\Page; -use App\Models\Post; use Filament\Forms; -use Filament\Forms\Components\Builder; -use Filament\Forms\Components\FileUpload; -use Filament\Forms\Components\Hidden; -use Filament\Forms\Components\RichEditor; use Filament\Forms\Components\Section; use Filament\Forms\Components\Select; use Filament\Forms\Components\TextInput; use Filament\Forms\Components\Toggle; use Filament\Forms\Form; -use Filament\Resources\Components\Tab; -use Illuminate\Support\Carbon; use Illuminate\Support\Str; -use Livewire\Features\SupportFileUploads\TemporaryUploadedFile; -use Mohamedsabil83\FilamentFormsTinyeditor\Components\TinyEditor; -use Symfony\Component\Finder\Finder; +use TomatoPHP\FilamentIcons\Components\IconPicker; class PageForm { - - public static function getPageTemplates() { - - $finder = new Finder(); - $finder->files()->in('../resources/js/Pages/Client/BasePageTemplate'); - - - $fileInfos = []; - foreach ($finder as $fileInfo) { - $fileInfos[] = [ - 'filename' => $fileInfo->getBasename('.' . $fileInfo->getExtension()), - - 'path' => preg_replace('/.*\/(Client\/.*)/', '$1', $fileInfo->getPath() . '/' . $fileInfo->getBasename('.' . $fileInfo->getExtension())), - 'extension' => $fileInfo->getExtension(), - 'size' => $fileInfo->getSize(), - 'mtime' => $fileInfo->getMTime(), - 'atime' => $fileInfo->getATime(), - 'isReadable' => $fileInfo->isReadable(), - 'isWritable' => $fileInfo->isWritable(), - ]; - } - $fileInfos = collect($fileInfos); - return $fileInfos->pluck('filename', 'path'); - - } - public static function getForm(Form $form): Form { return $form @@ -92,13 +53,34 @@ class PageForm '500' => 'Ведутся технические работы', ])->label('Статус')->required()->default('200'), Toggle::make('searchable')->default(true)->label('Индексируется поиском')->inline(false), + IconPicker::make('icon') + ->default('heroicon-o-academic-cap') + ->label('Icon'), + + TextInput::make('search_data')->hidden(), ]), Forms\Components\Tabs\Tab::make('Контент')->schema([ ContentBuilderItem::getItem('content') ]), Forms\Components\Tabs\Tab::make('Настройки')->schema([ - Select::make('template')->label('Шаблон')->options(self::getPageTemplates())->required(), + Section::make()->schema([ + Toggle::make('settings.hide_page_sub_section_links') + ->label('Скрыть сайдбар смежных страниц') + ->columnSpan(1), + + Toggle::make('settings.hide_page_navigate_links') + ->label('Скрыть навигацию по страницу') + ->columnSpan(1), + + Toggle::make('settings.hide_breadcrumbs') + ->label('Скрыть хлебные крошки') + ->columnSpan(1), +// +// Toggle::make('settings.full_width_page') +// ->label('Страница на всю ширину') +// ->columnSpan(1)->default(true), + ]), ]), ]), diff --git a/app/Filament/Resources/PageResource/Pages/EditPage.php b/app/Filament/Resources/PageResource/Pages/EditPage.php index 8042a26..65a749e 100644 --- a/app/Filament/Resources/PageResource/Pages/EditPage.php +++ b/app/Filament/Resources/PageResource/Pages/EditPage.php @@ -13,8 +13,6 @@ class EditPage extends EditRecord protected array $seoData; - - protected function mutateFormDataBeforeSave(array $data): array { $this->seoData = $this->generateSeo($data); diff --git a/app/Http/Controllers/PageController.php b/app/Http/Controllers/PageController.php index c4a7c0a..530efbf 100644 --- a/app/Http/Controllers/PageController.php +++ b/app/Http/Controllers/PageController.php @@ -60,7 +60,7 @@ class PageController extends Controller abort($error); } - return Inertia::render($page->template, compact('page', 'subSectionPages', 'breadcrumbs', 'seo')); + return Inertia::render('Page', compact('page', 'subSectionPages', 'breadcrumbs', 'seo')); } public function getRegisteredPages() { @@ -78,74 +78,4 @@ class PageController extends Controller ]; return Inertia::render('AdminPanel/Pages/Registered', compact('pages', 'filters')); } - - - - public function index() - { - $pages = PageResource::collection(Page::query() - ->when(request()->input('search'), function ($query, $search) { - $query->where('title', 'like', "%{$search}%"); - }) - ->where('is_registered', false) - ->orderBy('id', 'desc') - ->paginate(request()->input('perPage', 9)) - ->withQueryString()); - $filters = [ - 'search' => request()->input('search'), - ]; - return Inertia::render('AdminPanel/Pages/Index', compact('pages', 'filters')); - } - - public function edit($slug) - { - $page = new PageResource(Page::where('slug', '=', $slug)->first()); - return Inertia::render('AdminPanel/Pages/Edit', compact('page')); - } - - public function update(Page $page, UpdateRequest $request) - { - $data = $request->validated(); - $data['content'] = json_encode($data['content']); - $page->update($data); - return redirect()->route('admin.page.index'); - } - - public function editRegisteredPage($id) - { - $page = new RegisteredPageResource(Page::find($id)); - return Inertia::render('AdminPanel/Pages/EditRegisteredPage', compact('page')); - } - - public function updateRegisteredPage($id, Request $request) - { - $data = $request->validate([ - 'title' => 'required', - 'path' => 'required', - 'is_visible' => 'required', - 'code' => 'required' - ]); - $page = Page::find($id); - $page->update($data); - return redirect()->route('admin.registered.page.index'); - } - - public function destroy(Page $page) - { - $page->delete(); - return redirect()->route('admin.page.index'); - } - - public function create() - { - return Inertia::render('AdminPanel/Pages/Create'); - } - - public function store(StoreRequest $request) - { - $data = $request->validated(); - $data['content'] = json_encode($data['content']); - Page::create($data); - return redirect()->route('admin.page.index'); - } } diff --git a/app/Http/Resources/ClientPageNavigateResource.php b/app/Http/Resources/ClientPageNavigateResource.php index 13b9a02..1057cb4 100644 --- a/app/Http/Resources/ClientPageNavigateResource.php +++ b/app/Http/Resources/ClientPageNavigateResource.php @@ -20,6 +20,7 @@ class ClientPageNavigateResource extends JsonResource 'slug' => $this->slug, 'path' => $this->path, 'is_url' => $this->is_url, + 'icon' => $this->icon ]; } } diff --git a/app/Http/Resources/PageResource.php b/app/Http/Resources/PageResource.php index af459a1..fba6e66 100644 --- a/app/Http/Resources/PageResource.php +++ b/app/Http/Resources/PageResource.php @@ -22,6 +22,8 @@ class PageResource extends JsonResource 'code' => $this->code, 'path' => $this->path, 'is_url' => $this->is_url, + 'settings' => $this->settings, + 'icon' => $this->icon, 'section' => $this->section ? $this->section->title : null, 'created_at' => $this->created_at->diffforhumans() ]; diff --git a/app/Models/ApplicantQuestion.php b/app/Models/ApplicantQuestion.php deleted file mode 100644 index e7818f7..0000000 --- a/app/Models/ApplicantQuestion.php +++ /dev/null @@ -1,13 +0,0 @@ -morphOne(Seo::class, 'seoable'); - } - - protected $casts = [ - 'content' => 'array', - ]; -} diff --git a/app/Models/Page.php b/app/Models/Page.php index 09eb282..274fbb4 100644 --- a/app/Models/Page.php +++ b/app/Models/Page.php @@ -25,6 +25,7 @@ class Page extends Model protected $casts = [ 'content' => 'array', + 'settings' => 'array', ]; } diff --git a/app/Models/Author.php b/app/Models/Slide.php similarity index 84% rename from app/Models/Author.php rename to app/Models/Slide.php index 58fad8b..78aa48c 100644 --- a/app/Models/Author.php +++ b/app/Models/Slide.php @@ -5,7 +5,7 @@ namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; -class Author extends Model +class Slide extends Model { use HasFactory; } diff --git a/app/Models/VirtualExhibition.php b/app/Models/Slider.php similarity index 60% rename from app/Models/VirtualExhibition.php rename to app/Models/Slider.php index df48cb4..76524bc 100644 --- a/app/Models/VirtualExhibition.php +++ b/app/Models/Slider.php @@ -5,18 +5,19 @@ namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; -class VirtualExhibition extends Model +class Slider extends Model { use HasFactory; protected $guarded = false; protected $casts = [ - 'content' => 'array' + 'settings' => 'array', + 'image' => 'array', ]; - public function seo() + public function slidable() { - return $this->morphOne(Seo::class, 'seoable'); + return $this->morphTo(); } } diff --git a/app/Models/Student.php b/app/Models/Student.php deleted file mode 100644 index 46be6a7..0000000 --- a/app/Models/Student.php +++ /dev/null @@ -1,13 +0,0 @@ -id(); + $table->string('first_name'); + $table->string('last_name'); + $table->string('email'); + $table->string('phone'); + $table->text('text'); + $table->timestamps(); + }); + } +}; diff --git a/database/migrations/2025_03_11_235454_drop_vacant_positions_table.php b/database/migrations/2025_03_11_235454_drop_vacant_positions_table.php new file mode 100644 index 0000000..11089b9 --- /dev/null +++ b/database/migrations/2025_03_11_235454_drop_vacant_positions_table.php @@ -0,0 +1,32 @@ +id(); + $table->string('department'); + $table->string('position'); + $table->double('fraction'); + $table->integer('salary'); + $table->string('notice'); + $table->timestamps(); + }); + } +}; diff --git a/database/migrations/2025_03_11_235609_drop_students_table.php b/database/migrations/2025_03_11_235609_drop_students_table.php new file mode 100644 index 0000000..0d9b3f0 --- /dev/null +++ b/database/migrations/2025_03_11_235609_drop_students_table.php @@ -0,0 +1,32 @@ +id(); + $table->string('department'); + $table->string('position'); + $table->double('fraction'); + $table->integer('salary'); + $table->string('notice'); + $table->timestamps(); + }); + } +}; diff --git a/database/migrations/2025_03_11_235730_drop_library_news_table.php b/database/migrations/2025_03_11_235730_drop_library_news_table.php new file mode 100644 index 0000000..a2cccac --- /dev/null +++ b/database/migrations/2025_03_11_235730_drop_library_news_table.php @@ -0,0 +1,32 @@ +id(); + $table->string('title'); + $table->text('preview_text'); + $table->string('category')->nullable(); + $table->text('content'); + $table->boolean('is_active'); + $table->timestamps(); + }); + } +}; diff --git a/database/migrations/2025_03_12_000019_drop_external_vacancies_table.php b/database/migrations/2025_03_12_000019_drop_external_vacancies_table.php new file mode 100644 index 0000000..d701d3c --- /dev/null +++ b/database/migrations/2025_03_12_000019_drop_external_vacancies_table.php @@ -0,0 +1,32 @@ +id(); + $table->string('city'); + $table->string('position'); + $table->integer('salary')->nullable(); + $table->string('conditions')->nullable(); + $table->string('contacts'); + $table->timestamps(); + }); + } +}; diff --git a/database/migrations/2025_03_12_111917_add_icon_column_to_pages_table.php b/database/migrations/2025_03_12_111917_add_icon_column_to_pages_table.php new file mode 100644 index 0000000..e5dd90d --- /dev/null +++ b/database/migrations/2025_03_12_111917_add_icon_column_to_pages_table.php @@ -0,0 +1,28 @@ +string('icon')->nullable()->after('searchable'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('pages', function (Blueprint $table) { + $table->dropColumn('icon'); + }); + } +}; diff --git a/package-lock.json b/package-lock.json index 1c1c381..fa12f12 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,7 @@ "version": "1.0.0", "license": "ISC", "dependencies": { + "@heroicons/vue": "^2.2.0", "@inertiajs/inertia": "^0.11.1", "@inertiajs/inertia-vue3": "^0.6.0", "@preline/carousel": "^2.6.0", @@ -468,6 +469,14 @@ "node": ">=12" } }, + "node_modules/@heroicons/vue": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@heroicons/vue/-/vue-2.2.0.tgz", + "integrity": "sha512-G3dbSxoeEKqbi/DFalhRxJU4mTXJn7GwZ7ae8NuEQzd1bqdd0jAbdaBZlHPcvPD2xI1iGzNVB4k20Un2AguYPw==", + "peerDependencies": { + "vue": ">= 3" + } + }, "node_modules/@inertiajs/core": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@inertiajs/core/-/core-1.2.0.tgz", diff --git a/package.json b/package.json index b260e5c..d3665d5 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ " \"@editorjs/image\": \"^2.8.1\",\n \"@editorjs/quote\": \"^2.5.0\"," ], "dependencies": { + "@heroicons/vue": "^2.2.0", "@inertiajs/inertia": "^0.11.1", "@inertiajs/inertia-vue3": "^0.6.0", "@preline/carousel": "^2.6.0", diff --git a/resources/js/Components/BaseComponents/BaseBuilderUi/Blocks/Contacts/ContactSectionBlock.vue b/resources/js/Components/BaseComponents/BaseBuilderUi/Blocks/Contacts/ContactSectionBlock.vue index c72201d..aa022a6 100644 --- a/resources/js/Components/BaseComponents/BaseBuilderUi/Blocks/Contacts/ContactSectionBlock.vue +++ b/resources/js/Components/BaseComponents/BaseBuilderUi/Blocks/Contacts/ContactSectionBlock.vue @@ -8,7 +8,7 @@ -
+
+ - - \ No newline at end of file + \ No newline at end of file diff --git a/resources/js/Components/BuilderUi/Pages/PageSubSectionLinks.vue b/resources/js/Components/BuilderUi/Pages/PageSubSectionLinks.vue index 6562237..940e071 100644 --- a/resources/js/Components/BuilderUi/Pages/PageSubSectionLinks.vue +++ b/resources/js/Components/BuilderUi/Pages/PageSubSectionLinks.vue @@ -4,13 +4,14 @@