From dda250aaadd2bc4ef5f677a36da1a0bcf91c44f9 Mon Sep 17 00:00:00 2001 From: Friederich Loheide Date: Sat, 26 Sep 2026 13:56:57 +0000 Subject: [PATCH] =?UTF-8?q?Men=C3=BC-Editor,=20farbige=20Initialen,=20Seit?= =?UTF-8?q?enk=C3=B6pfe,=20Favoriten,=20Vorschaubilder?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Admin → Portal → Menü: Bereiche, Seiten (mit Unterseiten), Links und Gruppen mit Unterpunkten, sortierbar, je Rolle einschränkbar; Kopfzeile misst den Platz und legt Überzähliges unter „Mehr“ - Initialen in fester Farbe je Person, Abteilungsfarben im Organigramm - PageHeader für alle Übersichtsseiten - Dokumente: Favoriten (auch als Startseiten-Kachel), „Häufig genutzt“, Vorschaubilder (Bilder, erste PDF-Seite per pdf.js im Browser) - Platzhalter beim Nachladen Co-Authored-By: Claude Opus 5.5 (1M context) --- CHANGELOG.md | 10 + app/Filament/Pages/MenuSettings.php | 230 ++++++++ app/Support/Navigation.php | 181 +++++- app/Version.php | 2 +- docs/PLUGINS.md | 3 + package-lock.json | 280 ++++++++++ package.json | 3 + .../birthdays/resources/js/pages/Index.vue | 10 +- ...1_add_document_favorites_and_downloads.php | 34 ++ .../resources/js/components/DocumentGrid.vue | 19 +- .../js/components/DocumentMiniList.vue | 32 ++ .../resources/js/components/DocumentTable.vue | 19 +- .../resources/js/components/DocumentThumb.vue | 56 ++ .../js/components/FavoriteButton.vue | 23 + .../documents/resources/js/pages/Index.vue | 65 ++- .../documents/resources/js/pdfThumbnail.js | 47 ++ .../resources/js/widgets/MyDocuments.vue | 31 ++ plugins-core/documents/routes/web.php | 2 + .../documents/src/DocumentPresenter.php | 13 +- .../documents/src/DocumentsPlugin.php | 18 + .../Http/Controllers/DocumentController.php | 47 +- .../documents/src/Models/Document.php | 9 + .../events/resources/js/pages/Index.vue | 6 +- .../forms/resources/js/pages/Index.vue | 6 +- .../news/resources/js/pages/Index.vue | 13 +- .../pages/resources/js/pages/Index.vue | 13 +- plugins-core/pages/src/PagesPlugin.php | 26 + public/.htaccess | 5 + ...dion-BDgTZ9gX.js => Accordion-DK-7ujf4.js} | 2 +- public/build/assets/AppLayout-DBinOVTS.js | 1 - public/build/assets/AppLayout-r9U2b6YO.js | 1 + .../{Areas-DdYrrFsh.js => Areas-BIQPYO9r.js} | 2 +- ...m-CuAIWSDz.js => BirthdayItem-Dn6aFsau.js} | 2 +- ...4L8ms3la.js => BirthdaysBlock-CJbcLJgn.js} | 2 +- public/build/assets/Box-DVfrwGLZ.js | 1 + public/build/assets/Box-VoQIN4Ir.js | 1 - ...Logo-Xcsq8sJC.js => BrandLogo-DM5NGAFt.js} | 2 +- ...uilder-BRaGSn9N.js => Builder-D1kToRct.js} | 2 +- ...tacts-DlJRNFd8.js => Contacts-ChRDfQ7w.js} | 2 +- ...ile-DCImeMWc.js => CustomTile-TQcTgCB8.js} | 2 +- public/build/assets/Dashboard-CGd8Zl7_.js | 2 + public/build/assets/Dashboard-k0fe86EG.js | 2 - ...r-DZlBIGxi.js => DialogHeader-DuzItPWJ.js} | 2 +- ...CAa1Trjj.js => DirectoryLogin-DvK04h-T.js} | 2 +- .../{Edit-Dc8BVLRn.js => Edit-DGWqi5uh.js} | 4 +- ...{Editor-CeFyiTZE.js => Editor-BUqm5Jno.js} | 2 +- ...{Editor-DOsqh8HX.js => Editor-CpoIj1fY.js} | 2 +- ...LZ1XxhC5.js => EditorialForms-Ckh7TDY0.js} | 2 +- ...-B93xitMD.js => EditorialNews-C5nv01tK.js} | 2 +- ...BI8IIhWZ.js => EditorialPages-DM_pjzoM.js} | 2 +- ...BNB1SIga.js => EventDateBlock-B2RjLpBs.js} | 2 +- ...-CkxhKgZv.js => EventListItem-CO123dzl.js} | 2 +- ...ck-2AFelrX6.js => FolderBlock-Dk9-cZ6y.js} | 2 +- ...BRlCzyXf.js => ForgotPassword-WzM8o-LX.js} | 2 +- ...lock-C0pmL8K9.js => FormBlock-BXSh1pTU.js} | 2 +- ...r-rRNH-U7X.js => FormRenderer-DlZeAsaC.js} | 2 +- ...allery-BB33NFXt.js => Gallery-BmUUXFE8.js} | 2 +- ...eting-CEnV1-yl.js => Greeting-rKSqpzAv.js} | 2 +- ...ut-BFAdzNkH.js => GuestLayout-DDoXSJnO.js} | 2 +- .../{Hero-DE5OL13e.js => Hero-D01igNxI.js} | 2 +- ...nList-Bax4U4fS.js => IconList-CwnPxfyP.js} | 2 +- public/build/assets/Index-22mWraD3.js | 2 - public/build/assets/Index-BAaSIrNp.js | 1 - public/build/assets/Index-BOec1oZE.js | 1 + public/build/assets/Index-BQEXm8Ai.js | 2 + public/build/assets/Index-BjKJ8Joc.js | 1 - public/build/assets/Index-C3RC5EAj.js | 1 + public/build/assets/Index-C7Db1xre.js | 1 - public/build/assets/Index-CE6ZF2OL.js | 1 - public/build/assets/Index-CTShGDF7.js | 1 - public/build/assets/Index-CkcFzMOK.js | 1 - public/build/assets/Index-D-CqdWdJ.js | 2 + public/build/assets/Index-DLaBAT3X.js | 1 + public/build/assets/Index-DNIOKMPD.js | 1 + public/build/assets/Index-DQ_HGq0C.js | 1 - public/build/assets/Index-DqCs_mVy.js | 1 + public/build/assets/Index-fzpZ2RtL.js | 1 + ...{Latest-CJSF5rdL.js => Latest-DKo_bZLA.js} | 2 +- ...ews-Brpe8tLA.js => LatestNews-CFfxfX7p.js} | 2 +- .../{Login-B65gdNp3.js => Login-CXJ1WMJL.js} | 2 +- public/build/assets/MyDocuments-BXQx0__j.js | 1 + ...-p-gNpdkd.js => NewColleagues-COveuZ0u.js} | 2 +- ...-CATU2cNQ.js => NewPageDialog-BW2AcPJu.js} | 2 +- ...sCard-BsNlyb2E.js => NewsCard-lfxtA04q.js} | 2 +- ...mage-DDjX5Y1w.js => NewsImage-kMJC2FhL.js} | 2 +- ...m-C81fom13.js => NewsListItem-Bleag06t.js} | 2 +- public/build/assets/Organigram-BbtQtkMj.js | 1 - public/build/assets/Organigram-DO2Toxu8.js | 1 + public/build/assets/PageContent-E6hV6oXy.js | 2 + public/build/assets/PageContent-xVwK_0KY.js | 2 - public/build/assets/PageHeader-DGQaldEZ.js | 1 + .../{Panel-k9q_Ov9s.js => Panel-y6rdQHuA.js} | 2 +- ...h-lDaPGaip.js => PeopleSearch-BorIgi7E.js} | 2 +- ...z6Q9aZi.js => ProfileBirthday-BLUOyeRa.js} | 2 +- ...FFy4y.js => ProfileIncomplete-D9vN006S.js} | 2 +- ...nks-DQjrSbx_.js => QuickLinks-DCw7H7_b.js} | 2 +- ...-B3V5v7ks.js => ResetPassword-BM3qbSdi.js} | 2 +- ...mdsmZEiF.js => RichTextEditor-B-PJD_l_.js} | 2 +- ...{Sample-5cHz3B8f.js => Sample-PDO9s2ZO.js} | 2 +- .../{Show-DX-VYleJ.js => Show-5AvRCFGB.js} | 2 +- .../{Show-BLpsuklN.js => Show-BjshvwC5.js} | 2 +- .../{Show-CmceKqDr.js => Show-Cwyp8egJ.js} | 2 +- .../{Show-BBV3GeXo.js => Show-mPe1tAoZ.js} | 2 +- .../{Show-BDS5Ic0m.js => Show-r0iCnKEl.js} | 2 +- ...pages-Cs5bKSy2.js => Subpages-DQoFelA5.js} | 2 +- .../{Text-DptCcts8.js => Text-BzpIt0yF.js} | 4 +- ...oming-DtRNuBoY.js => Upcoming-BMz5N8b3.js} | 2 +- ...oming-pa1wCLCt.js => Upcoming-CnEQnXPe.js} | 2 +- ...C9oaBKXg.js => UpcomingEvents-BzeBYPf4.js} | 2 +- .../{app-01dYL7ER.css => app-B6E_phOc.css} | 2 +- .../{app-CSCzQ2ju.js => app-Cy8mmMrT.js} | 4 +- ...{dialog-Bnq2xLhE.js => dialog-C2mI2iwY.js} | 2 +- public/build/assets/format-2iB7L6ww.js | 1 - public/build/assets/format-CuWoExAa.js | 1 + .../{icons-COQb0lsF.js => icons-DYh1aOMI.js} | 2 +- public/build/assets/pdf-D-imJWIE.js | 11 + .../build/assets/pdf.worker.min-D00xlTFB.js | 1 + .../build/assets/pdf.worker.min-yatZIOMy.mjs | 21 + public/build/assets/pdfThumbnail-C7jaWm5M.js | 2 + public/build/assets/star-m4aZJlZ6.js | 1 + .../build/assets/useStoredChoice-BAacDiWy.js | 1 - .../build/assets/useStoredChoice-DGWodkrG.js | 1 + public/build/manifest.json | 517 ++++++++++-------- resources/js/components/PageHeader.vue | 33 ++ resources/js/components/PersonAvatar.vue | 9 +- resources/js/components/nav/NavLink.vue | 15 + resources/js/components/org/OrgCard.vue | 12 +- resources/js/components/org/OrgChartNode.vue | 13 +- resources/js/components/org/OrgFocus.vue | 6 +- .../js/components/ui/skeleton/Skeleton.vue | 11 + resources/js/components/ui/skeleton/index.js | 1 + resources/js/layouts/AppLayout.vue | 150 ++++- resources/js/lib/colors.js | 31 ++ resources/js/pages/Editorial/Index.vue | 6 +- resources/js/pages/People/Index.vue | 21 +- resources/js/pages/People/Organigram.vue | 30 +- tests/Feature/Documents/DocumentsTest.php | 45 ++ tests/Feature/MenuTest.php | 120 ++++ vendor/composer/autoload_classmap.php | 1 + vendor/composer/autoload_static.php | 1 + 140 files changed, 1993 insertions(+), 427 deletions(-) create mode 100644 app/Filament/Pages/MenuSettings.php create mode 100644 plugins-core/documents/database/migrations/2026_09_30_000001_add_document_favorites_and_downloads.php create mode 100644 plugins-core/documents/resources/js/components/DocumentMiniList.vue create mode 100644 plugins-core/documents/resources/js/components/DocumentThumb.vue create mode 100644 plugins-core/documents/resources/js/components/FavoriteButton.vue create mode 100644 plugins-core/documents/resources/js/pdfThumbnail.js create mode 100644 plugins-core/documents/resources/js/widgets/MyDocuments.vue rename public/build/assets/{Accordion-BDgTZ9gX.js => Accordion-DK-7ujf4.js} (99%) delete mode 100644 public/build/assets/AppLayout-DBinOVTS.js create mode 100644 public/build/assets/AppLayout-r9U2b6YO.js rename public/build/assets/{Areas-DdYrrFsh.js => Areas-BIQPYO9r.js} (91%) rename public/build/assets/{BirthdayItem-CuAIWSDz.js => BirthdayItem-Dn6aFsau.js} (91%) rename public/build/assets/{BirthdaysBlock-4L8ms3la.js => BirthdaysBlock-CJbcLJgn.js} (91%) create mode 100644 public/build/assets/Box-DVfrwGLZ.js delete mode 100644 public/build/assets/Box-VoQIN4Ir.js rename public/build/assets/{BrandLogo-Xcsq8sJC.js => BrandLogo-DM5NGAFt.js} (95%) rename public/build/assets/{Builder-BRaGSn9N.js => Builder-D1kToRct.js} (99%) rename public/build/assets/{Contacts-DlJRNFd8.js => Contacts-ChRDfQ7w.js} (93%) rename public/build/assets/{CustomTile-DCImeMWc.js => CustomTile-TQcTgCB8.js} (97%) create mode 100644 public/build/assets/Dashboard-CGd8Zl7_.js delete mode 100644 public/build/assets/Dashboard-k0fe86EG.js rename public/build/assets/{DialogHeader-DZlBIGxi.js => DialogHeader-DuzItPWJ.js} (88%) rename public/build/assets/{DirectoryLogin-CAa1Trjj.js => DirectoryLogin-DvK04h-T.js} (95%) rename public/build/assets/{Edit-Dc8BVLRn.js => Edit-DGWqi5uh.js} (94%) rename public/build/assets/{Editor-CeFyiTZE.js => Editor-BUqm5Jno.js} (95%) rename public/build/assets/{Editor-DOsqh8HX.js => Editor-CpoIj1fY.js} (96%) rename public/build/assets/{EditorialForms-LZ1XxhC5.js => EditorialForms-Ckh7TDY0.js} (94%) rename public/build/assets/{EditorialNews-B93xitMD.js => EditorialNews-C5nv01tK.js} (92%) rename public/build/assets/{EditorialPages-BI8IIhWZ.js => EditorialPages-DM_pjzoM.js} (88%) rename public/build/assets/{EventDateBlock-BNB1SIga.js => EventDateBlock-B2RjLpBs.js} (88%) rename public/build/assets/{EventListItem-CkxhKgZv.js => EventListItem-CO123dzl.js} (85%) rename public/build/assets/{FolderBlock-2AFelrX6.js => FolderBlock-Dk9-cZ6y.js} (96%) rename public/build/assets/{ForgotPassword-BRlCzyXf.js => ForgotPassword-WzM8o-LX.js} (92%) rename public/build/assets/{FormBlock-C0pmL8K9.js => FormBlock-BXSh1pTU.js} (93%) rename public/build/assets/{FormRenderer-rRNH-U7X.js => FormRenderer-DlZeAsaC.js} (99%) rename public/build/assets/{Gallery-BB33NFXt.js => Gallery-BmUUXFE8.js} (96%) rename public/build/assets/{Greeting-CEnV1-yl.js => Greeting-rKSqpzAv.js} (92%) rename public/build/assets/{GuestLayout-BFAdzNkH.js => GuestLayout-DDoXSJnO.js} (96%) rename public/build/assets/{Hero-DE5OL13e.js => Hero-D01igNxI.js} (98%) rename public/build/assets/{IconList-Bax4U4fS.js => IconList-CwnPxfyP.js} (94%) delete mode 100644 public/build/assets/Index-22mWraD3.js delete mode 100644 public/build/assets/Index-BAaSIrNp.js create mode 100644 public/build/assets/Index-BOec1oZE.js create mode 100644 public/build/assets/Index-BQEXm8Ai.js delete mode 100644 public/build/assets/Index-BjKJ8Joc.js create mode 100644 public/build/assets/Index-C3RC5EAj.js delete mode 100644 public/build/assets/Index-C7Db1xre.js delete mode 100644 public/build/assets/Index-CE6ZF2OL.js delete mode 100644 public/build/assets/Index-CTShGDF7.js delete mode 100644 public/build/assets/Index-CkcFzMOK.js create mode 100644 public/build/assets/Index-D-CqdWdJ.js create mode 100644 public/build/assets/Index-DLaBAT3X.js create mode 100644 public/build/assets/Index-DNIOKMPD.js delete mode 100644 public/build/assets/Index-DQ_HGq0C.js create mode 100644 public/build/assets/Index-DqCs_mVy.js create mode 100644 public/build/assets/Index-fzpZ2RtL.js rename public/build/assets/{Latest-CJSF5rdL.js => Latest-DKo_bZLA.js} (77%) rename public/build/assets/{LatestNews-Brpe8tLA.js => LatestNews-CFfxfX7p.js} (90%) rename public/build/assets/{Login-B65gdNp3.js => Login-CXJ1WMJL.js} (97%) create mode 100644 public/build/assets/MyDocuments-BXQx0__j.js rename public/build/assets/{NewColleagues-p-gNpdkd.js => NewColleagues-COveuZ0u.js} (87%) rename public/build/assets/{NewPageDialog-CATU2cNQ.js => NewPageDialog-BW2AcPJu.js} (91%) rename public/build/assets/{NewsCard-BsNlyb2E.js => NewsCard-lfxtA04q.js} (88%) rename public/build/assets/{NewsImage-DDjX5Y1w.js => NewsImage-kMJC2FhL.js} (85%) rename public/build/assets/{NewsListItem-C81fom13.js => NewsListItem-Bleag06t.js} (84%) delete mode 100644 public/build/assets/Organigram-BbtQtkMj.js create mode 100644 public/build/assets/Organigram-DO2Toxu8.js create mode 100644 public/build/assets/PageContent-E6hV6oXy.js delete mode 100644 public/build/assets/PageContent-xVwK_0KY.js create mode 100644 public/build/assets/PageHeader-DGQaldEZ.js rename public/build/assets/{Panel-k9q_Ov9s.js => Panel-y6rdQHuA.js} (93%) rename public/build/assets/{PeopleSearch-lDaPGaip.js => PeopleSearch-BorIgi7E.js} (84%) rename public/build/assets/{ProfileBirthday-Cz6Q9aZi.js => ProfileBirthday-BLUOyeRa.js} (92%) rename public/build/assets/{ProfileIncomplete-C_sFFy4y.js => ProfileIncomplete-D9vN006S.js} (82%) rename public/build/assets/{QuickLinks-DQjrSbx_.js => QuickLinks-DCw7H7_b.js} (94%) rename public/build/assets/{ResetPassword-B3V5v7ks.js => ResetPassword-BM3qbSdi.js} (93%) rename public/build/assets/{RichTextEditor-mdsmZEiF.js => RichTextEditor-B-PJD_l_.js} (99%) rename public/build/assets/{Sample-5cHz3B8f.js => Sample-PDO9s2ZO.js} (87%) rename public/build/assets/{Show-DX-VYleJ.js => Show-5AvRCFGB.js} (95%) rename public/build/assets/{Show-BLpsuklN.js => Show-BjshvwC5.js} (94%) rename public/build/assets/{Show-CmceKqDr.js => Show-Cwyp8egJ.js} (87%) rename public/build/assets/{Show-BBV3GeXo.js => Show-mPe1tAoZ.js} (81%) rename public/build/assets/{Show-BDS5Ic0m.js => Show-r0iCnKEl.js} (90%) rename public/build/assets/{Subpages-Cs5bKSy2.js => Subpages-DQoFelA5.js} (95%) rename public/build/assets/{Text-DptCcts8.js => Text-BzpIt0yF.js} (78%) rename public/build/assets/{Upcoming-DtRNuBoY.js => Upcoming-BMz5N8b3.js} (82%) rename public/build/assets/{Upcoming-pa1wCLCt.js => Upcoming-CnEQnXPe.js} (89%) rename public/build/assets/{UpcomingEvents-C9oaBKXg.js => UpcomingEvents-BzeBYPf4.js} (88%) rename public/build/assets/{app-01dYL7ER.css => app-B6E_phOc.css} (52%) rename public/build/assets/{app-CSCzQ2ju.js => app-Cy8mmMrT.js} (95%) rename public/build/assets/{dialog-Bnq2xLhE.js => dialog-C2mI2iwY.js} (89%) delete mode 100644 public/build/assets/format-2iB7L6ww.js create mode 100644 public/build/assets/format-CuWoExAa.js rename public/build/assets/{icons-COQb0lsF.js => icons-DYh1aOMI.js} (96%) create mode 100644 public/build/assets/pdf-D-imJWIE.js create mode 100644 public/build/assets/pdf.worker.min-D00xlTFB.js create mode 100644 public/build/assets/pdf.worker.min-yatZIOMy.mjs create mode 100644 public/build/assets/pdfThumbnail-C7jaWm5M.js create mode 100644 public/build/assets/star-m4aZJlZ6.js delete mode 100644 public/build/assets/useStoredChoice-BAacDiWy.js create mode 100644 public/build/assets/useStoredChoice-DGWodkrG.js create mode 100644 resources/js/components/PageHeader.vue create mode 100644 resources/js/components/nav/NavLink.vue create mode 100644 resources/js/components/ui/skeleton/Skeleton.vue create mode 100644 resources/js/components/ui/skeleton/index.js create mode 100644 resources/js/lib/colors.js create mode 100644 tests/Feature/MenuTest.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 474e5875..32d32ecf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,16 @@ Neueste Version oben. Jeder Abschnitt beginnt mit `## MAJOR.MINOR.PATCH` und enthält kurze Stichpunkte für Anwenderinnen und Anwender – keine Commit-Texte. Der Self-Updater zeigt diese Abschnitte bei neuen Versionen an. +## 0.10.0 + +- **Menü selbst gestalten** (Admin → Portal → Menü): Bereiche, Seiten (auf Wunsch mit Unterseiten als Untermenü), eigene Links (auch im neuen Tab) und Gruppen mit Unterpunkten; per Ziehen sortieren, einzelne Punkte nur für bestimmte Rollen. Ohne eigenes Menü gilt weiter das automatische +- Passt das Menü nicht in die Kopfzeile, wandern die letzten Punkte unter „Mehr“ +- Initialen ohne Foto erscheinen in einer festen Farbe je Person; das Organigramm zeigt jede Abteilung mit eigener Farbe samt Legende +- Einheitliche Seitenköpfe (Pfad, Titel, Beschreibung, Aktionen) auf allen Übersichtsseiten +- Dokumente: mit dem Stern gemerkte Dokumente unter „Meine Dokumente“ – in der Ablage und als Kachel auf der Startseite; „Häufig genutzt“ nach Downloads +- Dokumente: Vorschaubilder in der Kachelansicht (Bilder und erste PDF-Seite, im Browser erzeugt) +- Platzhalter beim Nachladen statt springender Inhalte + ## 0.9.1 - Organigramm neu gestaltet: grafischer Baum mit Verbindungslinien, Zoom und Verschieben; Mitarbeitende ohne eigenes Team stehen platzsparend untereinander diff --git a/app/Filament/Pages/MenuSettings.php b/app/Filament/Pages/MenuSettings.php new file mode 100644 index 00000000..e8c06880 --- /dev/null +++ b/app/Filament/Pages/MenuSettings.php @@ -0,0 +1,230 @@ +|null */ + public ?array $data = []; + + public static function canAccess(): bool + { + return auth()->user()?->can('appearance.manage') ?? false; + } + + public function getSubheading(): ?string + { + return app(Settings::class)->get(Navigation::MENU_SETTING) + ? 'Eigenes Menü aktiv. Punkte, die jemand nicht sehen darf (Rolle, Recht, Seite), werden für diese Person ausgeblendet.' + : 'Zurzeit gilt das automatische Menü aus allen Bereichen und den Seiten „in der Hauptnavigation“. Mit dem ersten Speichern gilt das Menü unten.'; + } + + public function mount(Settings $settings, Navigation $navigation): void + { + $menu = $settings->get(Navigation::MENU_SETTING); + $this->form->fill(['items' => is_array($menu) && $menu !== [] ? $menu : $this->fromAutomatic($navigation)]); + } + + public function form(Schema $schema): Schema + { + return $schema->statePath('data')->components([ + Section::make('Menüpunkte') + ->description('Reihenfolge per Ziehen. Punkte mit Unterpunkten öffnen in der Kopfzeile ein Aufklappmenü. Passt nicht alles in die Kopfzeile, erscheinen die letzten Punkte unter „Mehr“.') + ->schema([ + Repeater::make('items') + ->hiddenLabel() + ->schema($this->itemFields(nested: false)) + ->columns(4) + ->reorderableWithDragAndDrop() + ->collapsible() + ->collapsed() + ->cloneable() + ->itemLabel(fn (array $state) => $this->itemLabel($state)) + ->addActionLabel('Menüpunkt hinzufügen') + ->defaultItems(0), + ]), + ]); + } + + /** + * @return list + */ + private function itemFields(bool $nested): array + { + $navigation = app(Navigation::class); + $types = ['module' => 'Bereich (z. B. Neuigkeiten)', ...$navigation->sourceTypes(), 'link' => 'Link']; + + if (! $nested) { + $types['group'] = 'Gruppe (nur Überschrift mit Unterpunkten)'; + } + + $fields = [ + Hidden::make('id')->default(fn () => (string) Str::uuid()), + Select::make('type')->label('Art')->options($types)->default('module')->required()->live()->native(false)->selectablePlaceholder(false), + Select::make('module')->label('Bereich')->required()->native(false) + ->options(fn (Get $get) => $navigation->modules() + (filled($get('module')) && ! isset($navigation->modules()[$get('module')]) ? [$get('module') => $get('module').' (Plugin deaktiviert)'] : [])) + ->visible(fn (Get $get) => $get('type') === 'module'), + Select::make('target')->label(fn (Get $get) => $navigation->sourceTypes()[$get('type')] ?? 'Ziel') + ->options(fn (Get $get) => $navigation->sourceOptions((string) $get('type'))) + ->searchable()->required()->native(false) + ->visible(fn (Get $get) => array_key_exists((string) $get('type'), $navigation->sourceTypes())), + TextInput::make('url')->label('Adresse')->placeholder('/seiten/… oder https://…')->required()->maxLength(500) + ->regex(self::URL_PATTERN)->validationMessages(['regex' => 'Bitte mit / (im Portal) oder https:// beginnen.']) + ->visible(fn (Get $get) => $get('type') === 'link'), + TextInput::make('label')->label('Bezeichnung')->maxLength(60) + ->placeholder(fn (Get $get) => in_array($get('type'), ['link', 'group'], true) ? '' : 'wie Bereich bzw. Seite') + ->required(fn (Get $get) => in_array($get('type'), ['link', 'group'], true)), + Toggle::make('subpages')->label('Unterseiten als Untermenü')->inline(false) + ->visible(fn (Get $get) => $get('type') === 'page'), + Toggle::make('new_tab')->label('In neuem Tab öffnen')->inline(false) + ->visible(fn (Get $get) => $get('type') === 'link'), + Select::make('roles')->label('Nur sichtbar für')->multiple()->placeholder('Alle')->native(false) + ->options(fn () => Role::query()->orderBy('name')->pluck('name', 'id')->all()) + ->columnSpan(2), + ]; + + if (! $nested) { + $fields[] = Repeater::make('children') + ->label('Unterpunkte') + ->schema($this->itemFields(nested: true)) + ->columns(4) + ->reorderableWithDragAndDrop() + ->collapsible() + ->itemLabel(fn (array $state) => $this->itemLabel($state)) + ->addActionLabel('Unterpunkt hinzufügen') + ->defaultItems(0) + ->columnSpanFull(); + } + + return $fields; + } + + /** + * @param array $state + */ + private function itemLabel(array $state): string + { + $navigation = app(Navigation::class); + $type = (string) ($state['type'] ?? ''); + $label = trim((string) ($state['label'] ?? '')); + + if ($label === '') { + $label = match ($type) { + 'module' => $navigation->modules()[$state['module'] ?? ''] ?? (($state['module'] ?? 'Bereich').' (Plugin deaktiviert)'), + 'link' => $state['url'] ?? 'Link', + 'group' => 'Gruppe', + default => trim($navigation->sourceOptions($type)[$state['target'] ?? ''] ?? ($navigation->sourceTypes()[$type] ?? ''), '— '), + }; + } + + $kind = ['module' => 'Bereich', 'link' => 'Link', 'group' => 'Gruppe'][$type] ?? ($navigation->sourceTypes()[$type] ?? ''); + $children = count((array) ($state['children'] ?? [])); + + return $label.' · '.$kind.($children ? " · {$children} Unterpunkte" : '').(! empty($state['roles']) ? ' · eingeschränkt' : ''); + } + + /** + * Startpunkt für den Editor: das bisherige automatische Menü. + * + * @return list> + */ + private function fromAutomatic(Navigation $navigation): array + { + $modules = $navigation->modules(); + $items = []; + + foreach ($navigation->automatic(request(), auth()->user()) as $item) { + if (isset($modules[$item['key']])) { + $items[] = ['id' => (string) Str::uuid(), 'type' => 'module', 'module' => $item['key'], 'label' => null, 'roles' => [], 'children' => []]; + } elseif (preg_match('/^page-(\d+)$/', $item['key'], $m) && array_key_exists('page', $navigation->sourceTypes())) { + $items[] = ['id' => (string) Str::uuid(), 'type' => 'page', 'target' => $m[1], 'subpages' => true, 'label' => null, 'roles' => [], 'children' => []]; + } + } + + return $items; + } + + public function save(Settings $settings): void + { + $items = $this->form->getState()['items'] ?? []; + $clean = fn (array $item) => array_filter([ + 'id' => $item['id'] ?? (string) Str::uuid(), + 'type' => $item['type'] ?? 'module', + 'module' => $item['module'] ?? null, + 'target' => isset($item['target']) ? (string) $item['target'] : null, + 'url' => $item['url'] ?? null, + 'label' => filled($item['label'] ?? null) ? trim($item['label']) : null, + 'subpages' => ! empty($item['subpages']), + 'new_tab' => ! empty($item['new_tab']), + 'roles' => array_values(array_map('intval', (array) ($item['roles'] ?? []))), + ], fn ($value) => $value !== null); + + $menu = array_values(array_map(fn (array $item) => [ + ...$clean($item), + 'children' => array_values(array_map($clean, array_values((array) ($item['children'] ?? [])))), + ], array_values($items))); + + $settings->set(Navigation::MENU_SETTING, $menu); + Audit::log('navigation.menu_saved', ['items' => count($menu)]); + + Notification::make()->success()->title('Menü gespeichert')->send(); + } + + protected function getHeaderActions(): array + { + return [ + Action::make('automatic')->label('Automatisches Menü verwenden')->icon(Heroicon::OutlinedArrowUturnLeft)->color('gray') + ->visible(fn () => (bool) app(Settings::class)->get(Navigation::MENU_SETTING)) + ->requiresConfirmation() + ->modalDescription('Das eigene Menü wird gelöscht. Danach erscheinen wieder alle Bereiche und die Seiten „in der Hauptnavigation“.') + ->action(function (Settings $settings, Navigation $navigation) { + $settings->set(Navigation::MENU_SETTING, null); + Audit::log('navigation.menu_reset'); + $this->form->fill(['items' => $this->fromAutomatic($navigation)]); + Notification::make()->success()->title('Automatisches Menü aktiv')->send(); + }), + Action::make('preview')->label('Portal ansehen')->icon(Heroicon::OutlinedEye)->color('gray') + ->url('/')->openUrlInNewTab(), + ]; + } +} diff --git a/app/Support/Navigation.php b/app/Support/Navigation.php index f3de7f41..aeded8d9 100644 --- a/app/Support/Navigation.php +++ b/app/Support/Navigation.php @@ -17,6 +17,10 @@ use Illuminate\Http\Request; * app(Navigation::class)->provider('pages', fn (Request $request, ?User $user) => [ * ['key' => 'page-3', 'label' => 'MAV', 'href' => '/seiten/mav', 'active' => true, 'sort' => 40], * ]); + * + * Hat die Administration unter „Menü“ ein eigenes Menü gespeichert, gilt dieses: + * Bereiche (die Einträge oben), Links, Gruppen und Arten aus Plugins (z. B. „Seite“, + * registriert mit source()), jeweils mit Unterpunkten. */ class Navigation { @@ -26,6 +30,14 @@ class Navigation /** @var array */ private array $providers = []; + public const MENU_SETTING = 'navigation.menu'; + + /** @var array */ + private array $sources = []; + + /** @var list|null Rollen der aktuellen Person (für „Sichtbar für“) */ + private ?array $roleIds = null; + public function __construct() { $this->add('home', 'Startseite', '/', active: 'dashboard', sort: 0); @@ -55,9 +67,66 @@ class Navigation } /** - * @return list + * Weitere Art von Menüpunkten für den Menü-Editor, z. B. „Seite“. + * + * @param Closure(): array $options Auswahl im Editor + * @param Closure(string, array, Request, User|null): (array{label: string, href: string, active: bool, children?: list}|null) $resolve + * null = nicht (mehr) vorhanden oder nicht sichtbar + */ + public function source(string $type, string $label, Closure $options, Closure $resolve): void + { + $this->sources[$type] = compact('label', 'options', 'resolve'); + } + + /** + * @return array Art => Bezeichnung + */ + public function sourceTypes(): array + { + return array_map(fn (array $source) => $source['label'], $this->sources); + } + + /** + * @return array + */ + public function sourceOptions(string $type): array + { + return isset($this->sources[$type]) ? ($this->sources[$type]['options'])() : []; + } + + /** + * Bereiche für den Menü-Editor. + * + * @return array Schlüssel => Bezeichnung + */ + public function modules(): array + { + return collect($this->items)->sortBy('sort')->map(fn (array $item) => $item['label'])->all(); + } + + /** + * Menü für die Kopfzeile. Einträge können Unterpunkte (children) haben. + * + * @return list>}> */ public function items(Request $request, ?User $user = null): array + { + $this->roleIds = null; // je Aufruf neu – die Registry lebt über Requests hinweg + $menu = app(Settings::class)->get(self::MENU_SETTING); + + $items = is_array($menu) && $menu !== [] + ? $this->fromMenu($menu, $request, $user) + : $this->automatic($request, $user); + + return Hooks::apply('navigation.items', $items, $request, $user); + } + + /** + * Das automatische Menü aus Kern, Plugins und Seiten „in der Hauptnavigation“. + * + * @return list> + */ + public function automatic(Request $request, ?User $user = null): array { $items = collect($this->items) ->filter(fn (array $item) => $item['ability'] === null || ($user?->can($item['ability']) ?? false)) @@ -74,11 +143,115 @@ class Navigation $items = $items->merge($provider($request, $user)); } - $items = $items->sortBy('sort') - ->map(fn (array $item) => ['key' => $item['key'], 'label' => $item['label'], 'href' => $item['href'], 'active' => (bool) $item['active']]) + return $items->sortBy('sort') + ->map(fn (array $item) => ['key' => $item['key'], 'label' => $item['label'], 'href' => $item['href'], 'active' => (bool) $item['active'], 'new_tab' => false, 'children' => []]) ->values() ->all(); + } - return Hooks::apply('navigation.items', $items, $request, $user); + /** + * @param list> $menu + * @return list> + */ + private function fromMenu(array $menu, Request $request, ?User $user): array + { + return array_values(array_filter(array_map(fn ($item) => is_array($item) ? $this->resolve($item, $request, $user, true) : null, $menu))); + } + + /** + * Einen gespeicherten Menüpunkt auflösen – null, wenn er für diese Person nicht + * sichtbar ist (Rolle, Recht, Plugin deaktiviert, Seite gelöscht, Gruppe leer). + * + * @param array $item + * @return array|null + */ + private function resolve(array $item, Request $request, ?User $user, bool $topLevel): ?array + { + $roles = array_map('intval', (array) ($item['roles'] ?? [])); + + if ($roles !== [] && array_intersect($roles, $this->roleIds($user)) === []) { + return null; + } + + $type = (string) ($item['type'] ?? ''); + $base = match ($type) { + 'module' => $this->module((string) ($item['module'] ?? ''), $request, $user), + 'link' => $this->link((string) ($item['url'] ?? ''), $request), + 'group' => ['label' => '', 'href' => null, 'active' => false], + default => isset($this->sources[$type]) && filled($item['target'] ?? null) + ? ($this->sources[$type]['resolve'])((string) $item['target'], $item, $request, $user) + : null, + }; + + if ($base === null) { + return null; + } + + $children = []; + + if ($topLevel) { + foreach ((array) ($item['children'] ?? []) as $child) { + if (is_array($child) && ($resolved = $this->resolve($child, $request, $user, false))) { + $children[] = $resolved; + } + } + + foreach ((array) ($base['children'] ?? []) as $child) { + $children[] = ['key' => ($item['id'] ?? $type).'-'.md5($child['href']), 'label' => $child['label'], 'href' => $child['href'], 'active' => (bool) $child['active'], 'new_tab' => false, 'children' => []]; + } + } + + $label = trim((string) ($item['label'] ?? '')) ?: $base['label']; + + if ($label === '' || ($type === 'group' && $children === [])) { + return null; + } + + return [ + 'key' => (string) ($item['id'] ?? md5(json_encode($item))), + 'label' => $label, + 'href' => $base['href'], + 'active' => $base['active'] || collect($children)->contains('active', true), + 'new_tab' => $type === 'link' && ! empty($item['new_tab']), + 'children' => $children, + ]; + } + + /** + * @return array{label: string, href: string, active: bool}|null + */ + private function module(string $key, Request $request, ?User $user): ?array + { + $item = $this->items[$key] ?? null; + + if (! $item + || ($item['ability'] !== null && ! ($user?->can($item['ability']) ?? false)) + || ($item['visible'] !== null && ($user === null || ! ($item['visible'])($user)))) { + return null; + } + + return ['label' => $item['label'], 'href' => $item['href'], 'active' => $item['active'] !== [] && $request->routeIs(...$item['active'])]; + } + + /** + * @return array{label: string, href: string, active: bool}|null + */ + private function link(string $url, Request $request): ?array + { + if (! preg_match('#^(/|https?://|mailto:|tel:)#i', $url)) { + return null; + } + + $path = str_starts_with($url, '/') ? (parse_url($url, PHP_URL_PATH) ?: '/') : null; + + return ['label' => '', 'href' => $url, 'active' => $path !== null && $path !== '/' && '/'.ltrim($request->path(), '/') === rtrim($path, '/')]; + } + + /** + * @return list + */ + private function roleIds(?User $user): array + { + return $this->roleIds ??= $user ? $user->roles()->pluck('roles.id')->map(fn ($id) => (int) $id)->all() : []; } } diff --git a/app/Version.php b/app/Version.php index c7999736..a947dd9b 100644 --- a/app/Version.php +++ b/app/Version.php @@ -9,5 +9,5 @@ namespace App; */ final class Version { - public const VERSION = '0.9.1'; + public const VERSION = '0.10.0'; } diff --git a/docs/PLUGINS.md b/docs/PLUGINS.md index ceb567d2..d7269bc4 100644 --- a/docs/PLUGINS.md +++ b/docs/PLUGINS.md @@ -128,6 +128,9 @@ $this->app->make(Blocks::class)->add(BlockType::make('mein-plugin.liste', 'Meine ## Redaktion, Navigation und Benachrichtigungen - Arbeitslisten im Bereich „Redaktion“: `app(App\Editorial\Editorial::class)->add($key, $label, 'mein-plugin::Liste', $sort, $sichtbar, $props)`. +- Eigene Menüpunkt-Arten für den Menü-Editor (Admin → Menü), z. B. „Seite“: + `app(Navigation::class)->source('typ', 'Bezeichnung', fn () => [id => 'Name'], fn (string $id, array $item, Request $request, ?User $user) => ['label' => …, 'href' => …, 'active' => …, 'children' => [...]] ?: null)`. +- Seitenköpfe im Portal: `@/components/PageHeader.vue` (Titel, Beschreibung, Pfad, Slot „actions“). - Dynamische Menüpunkte: `app(Navigation::class)->provider('mein-plugin', fn (Request $request, ?User $user) => [...])`; feste Menüpunkte können mit `visible: fn (User $user) => …` je Person ausgeblendet werden. - Benachrichtigungen (Glocke im Portal): `$user->notify(new App\Notifications\PortalNotification($titel, $text, $url))`. diff --git a/package-lock.json b/package-lock.json index 0cef1324..218b14de 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,6 +4,9 @@ "requires": true, "packages": { "": { + "dependencies": { + "pdfjs-dist": "^4.10.38" + }, "devDependencies": { "@fontsource-variable/figtree": "^5.3.0", "@fontsource-variable/ibm-plex-sans": "^5.3.0", @@ -383,6 +386,271 @@ "vue": ">=3.0.1" } }, + "node_modules/@napi-rs/canvas": { + "version": "0.1.100", + "resolved": "https://registry.npmjs.org/@napi-rs/canvas/-/canvas-0.1.100.tgz", + "integrity": "sha512-xglYA6q3XO5P3BNJYxVZ1IV7DLVjp1Py6nwag88YntrS+3vKHyYcMqXVS4ZztJmwz2uGvz1FWhI/4LgbR5uQDA==", + "license": "MIT", + "optional": true, + "workspaces": [ + "e2e/*" + ], + "engines": { + "node": ">= 10" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Brooooooklyn" + }, + "optionalDependencies": { + "@napi-rs/canvas-android-arm64": "0.1.100", + "@napi-rs/canvas-darwin-arm64": "0.1.100", + "@napi-rs/canvas-darwin-x64": "0.1.100", + "@napi-rs/canvas-linux-arm-gnueabihf": "0.1.100", + "@napi-rs/canvas-linux-arm64-gnu": "0.1.100", + "@napi-rs/canvas-linux-arm64-musl": "0.1.100", + "@napi-rs/canvas-linux-riscv64-gnu": "0.1.100", + "@napi-rs/canvas-linux-x64-gnu": "0.1.100", + "@napi-rs/canvas-linux-x64-musl": "0.1.100", + "@napi-rs/canvas-win32-arm64-msvc": "0.1.100", + "@napi-rs/canvas-win32-x64-msvc": "0.1.100" + } + }, + "node_modules/@napi-rs/canvas-android-arm64": { + "version": "0.1.100", + "resolved": "https://registry.npmjs.org/@napi-rs/canvas-android-arm64/-/canvas-android-arm64-0.1.100.tgz", + "integrity": "sha512-hjhCKhntPv9+t4ckHymdx0phYNcVW+GKQR6Lzw2zE+pOVjOplSmtx9nNNknTjbEDLcuLZqA1y8ufKg1XfgftzQ==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 10" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Brooooooklyn" + } + }, + "node_modules/@napi-rs/canvas-darwin-arm64": { + "version": "0.1.100", + "resolved": "https://registry.npmjs.org/@napi-rs/canvas-darwin-arm64/-/canvas-darwin-arm64-0.1.100.tgz", + "integrity": "sha512-2PcswRaC7Ly645DGt88///zuFDhJxJYdKAs1uU3mfk1atYkXufgcgLfBpk6Tm12nCQBaNt1wpybuPZ4qOhTo8A==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Brooooooklyn" + } + }, + "node_modules/@napi-rs/canvas-darwin-x64": { + "version": "0.1.100", + "resolved": "https://registry.npmjs.org/@napi-rs/canvas-darwin-x64/-/canvas-darwin-x64-0.1.100.tgz", + "integrity": "sha512-ePNZtj7pNIva/siZMg+HmbeozkIjqUIYdoymH8HaA3qK7LfzFN4WMBM8G6HQ9ZC+H3+Dnn5pqtiXpgLykaPOhw==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Brooooooklyn" + } + }, + "node_modules/@napi-rs/canvas-linux-arm-gnueabihf": { + "version": "0.1.100", + "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-arm-gnueabihf/-/canvas-linux-arm-gnueabihf-0.1.100.tgz", + "integrity": "sha512-d5cDB48oWFGU8/XPhUOFAlySgb/VAu7D+s8fi55K1Pcfg8aPplHWqMgibhVLU8ky7Pyg/fuiVLz4Nf3JrSTuUA==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Brooooooklyn" + } + }, + "node_modules/@napi-rs/canvas-linux-arm64-gnu": { + "version": "0.1.100", + "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-arm64-gnu/-/canvas-linux-arm64-gnu-0.1.100.tgz", + "integrity": "sha512-rDxgxRu69RvDlX/bh9o22DxLsGr8EqsNgotL9+RwQE1S0b0cqeatqsw6aW45mukm0B42DIAaAacKaYQ8cqS1nw==", + "cpu": [ + "arm64" + ], + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Brooooooklyn" + } + }, + "node_modules/@napi-rs/canvas-linux-arm64-musl": { + "version": "0.1.100", + "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-arm64-musl/-/canvas-linux-arm64-musl-0.1.100.tgz", + "integrity": "sha512-K3mDW66N+xT2/V439u1alFANiBUjdEx2gLiNYnCmUsva5jZMxWTjafBYwTzYK+EMFMHrUoabuU+T1BIP5CgbYQ==", + "cpu": [ + "arm64" + ], + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Brooooooklyn" + } + }, + "node_modules/@napi-rs/canvas-linux-riscv64-gnu": { + "version": "0.1.100", + "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-riscv64-gnu/-/canvas-linux-riscv64-gnu-0.1.100.tgz", + "integrity": "sha512-mooqUBTIsccZpnoQC4NgrC1v6C1vof39etLNMnBwCY+p0gajWJvAHLGQ6g/gGyS5YrpDW+GefSN4+Cvcr08UWw==", + "cpu": [ + "riscv64" + ], + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Brooooooklyn" + } + }, + "node_modules/@napi-rs/canvas-linux-x64-gnu": { + "version": "0.1.100", + "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-x64-gnu/-/canvas-linux-x64-gnu-0.1.100.tgz", + "integrity": "sha512-1eCvkDCazm7FFhsT7DfGOdSaHgZVK3bt/dSBl5EWHOWmnz+I7j8tPseJqqD81NF+MH21jKUK4wQSDjN0mdhnTg==", + "cpu": [ + "x64" + ], + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Brooooooklyn" + } + }, + "node_modules/@napi-rs/canvas-linux-x64-musl": { + "version": "0.1.100", + "resolved": "https://registry.npmjs.org/@napi-rs/canvas-linux-x64-musl/-/canvas-linux-x64-musl-0.1.100.tgz", + "integrity": "sha512-20arT6lnI19S68qNlii73TSEDbECNgzMz2EpldC1V3mZFuRkeujXkcebRk0LRJe9SEUAooYiLokfMViY8IX7yA==", + "cpu": [ + "x64" + ], + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Brooooooklyn" + } + }, + "node_modules/@napi-rs/canvas-win32-arm64-msvc": { + "version": "0.1.100", + "resolved": "https://registry.npmjs.org/@napi-rs/canvas-win32-arm64-msvc/-/canvas-win32-arm64-msvc-0.1.100.tgz", + "integrity": "sha512-DZFFT1wIAg37LJw37yhMRFfjATd3vTQzjZ1Yki8u2vhO6Hi5VE6BVaGQ1aaDu7xb4iMErz+9EOwjpS7xcxFeBw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Brooooooklyn" + } + }, + "node_modules/@napi-rs/canvas-win32-x64-msvc": { + "version": "0.1.100", + "resolved": "https://registry.npmjs.org/@napi-rs/canvas-win32-x64-msvc/-/canvas-win32-x64-msvc-0.1.100.tgz", + "integrity": "sha512-MyT1j3mHC2+Lu4pBi9mKyMJhtP6U7k7EldY7sj/uS5gJA65gTXt8MefJQXLJo5d/vZbuWmfxzkEUNc/urV3pHA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Brooooooklyn" + } + }, "node_modules/@oxc-project/types": { "version": "0.151.0", "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.151.0.tgz", @@ -2472,6 +2740,18 @@ "dev": true, "license": "MIT" }, + "node_modules/pdfjs-dist": { + "version": "4.10.38", + "resolved": "https://registry.npmjs.org/pdfjs-dist/-/pdfjs-dist-4.10.38.tgz", + "integrity": "sha512-/Y3fcFrXEAsMjJXeL9J8+ZG9U01LbuWaYypvDW2ycW1jL269L3js3DVBjDJ0Up9Np1uqDXsDrRihHANhZOlwdQ==", + "license": "Apache-2.0", + "engines": { + "node": ">=20" + }, + "optionalDependencies": { + "@napi-rs/canvas": "^0.1.65" + } + }, "node_modules/picocolors": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", diff --git a/package.json b/package.json index ba02e2d2..d4a86061 100644 --- a/package.json +++ b/package.json @@ -41,5 +41,8 @@ "vue": "^3.5.43", "vue-draggable-plus": "^0.6.1", "vue-sonner": "^2.0.9" + }, + "dependencies": { + "pdfjs-dist": "^4.10.38" } } diff --git a/plugins-core/birthdays/resources/js/pages/Index.vue b/plugins-core/birthdays/resources/js/pages/Index.vue index 925c9ef8..9db9e8c7 100644 --- a/plugins-core/birthdays/resources/js/pages/Index.vue +++ b/plugins-core/birthdays/resources/js/pages/Index.vue @@ -3,6 +3,7 @@ import { computed } from 'vue'; import { Link } from '@inertiajs/vue3'; import { Cake } from '@lucide/vue'; import EmptyState from '@/components/EmptyState.vue'; +import PageHeader from '@/components/PageHeader.vue'; import AppLayout from '@/layouts/AppLayout.vue'; import BirthdayItem from '../components/BirthdayItem.vue'; @@ -30,15 +31,14 @@ const label = (group) => group.today ? 'Heute' : new Intl.DateTimeFormat('de-DE' diff --git a/plugins-core/documents/database/migrations/2026_09_30_000001_add_document_favorites_and_downloads.php b/plugins-core/documents/database/migrations/2026_09_30_000001_add_document_favorites_and_downloads.php new file mode 100644 index 00000000..0fa21901 --- /dev/null +++ b/plugins-core/documents/database/migrations/2026_09_30_000001_add_document_favorites_and_downloads.php @@ -0,0 +1,34 @@ +foreignId('user_id')->constrained()->cascadeOnDelete(); + $table->foreignId('document_id')->constrained()->cascadeOnDelete(); + $table->timestamp('created_at')->nullable(); + + $table->primary(['user_id', 'document_id']); + }); + + Schema::table('documents', function (Blueprint $table) { + $table->unsignedInteger('downloads')->default(0)->after('updated_by'); + $table->index('downloads'); + }); + } + + public function down(): void + { + Schema::table('documents', function (Blueprint $table) { + $table->dropIndex(['downloads']); + $table->dropColumn('downloads'); + }); + + Schema::dropIfExists('document_favorites'); + } +}; diff --git a/plugins-core/documents/resources/js/components/DocumentGrid.vue b/plugins-core/documents/resources/js/components/DocumentGrid.vue index 90f5f43d..be0e2886 100644 --- a/plugins-core/documents/resources/js/components/DocumentGrid.vue +++ b/plugins-core/documents/resources/js/components/DocumentGrid.vue @@ -1,11 +1,12 @@