diff --git a/.gitignore b/.gitignore index 61397b2b..703206f1 100644 --- a/.gitignore +++ b/.gitignore @@ -24,5 +24,9 @@ /storage/.version /storage/.update-progress /storage/.maintenance +# Laufzeitzustand der Installation – nie ausliefern (ein manuelles Update würde sonst fällige Migrationen überspringen) +/storage/.migrations-fingerprint +/storage/.background-heartbeat +/storage/.background.lock _ide_helper.php Thumbs.db diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ea1b20f..42a8e92e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,21 @@ 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.5.0 + +- Seiten: eigener Seitenbaum für Bereiche, Abteilungen und Gremien – mit Seitennavigation, Brotkrumen und optional in der Hauptnavigation +- Pagebuilder im Portal: Abschnitte, Spalten, Tabs, Akkordeon, Boxen, Text, Bilder, Galerie, Video, Tabellen, Schaltflächen, Ansprechpartner, Downloads und mehr – per Ziehen und Ablegen +- Entwürfe werden laufend gespeichert; veröffentlicht wird ausdrücklich oder zeitgesteuert, jede Veröffentlichung bleibt als Version erhalten +- Rechte je Seite inklusive Unterseiten, z. B. darf die MAV ihre Seite und alles darunter pflegen; ohne Veröffentlichungsrecht wird eine Freigabe angefordert +- Sichtbarkeit je Seite und je Block (Rollen, Abteilungen, Standorte) +- Bearbeitungssperre verhindert, dass zwei Personen gleichzeitig dieselbe Seite ändern +- Neuigkeiten direkt im Portal schreiben – mit Titelbild und Bildern im Text +- Freigabe-Workflow für Beiträge: einreichen, freigeben oder mit Anmerkung zurückgeben; wer veröffentlichen darf, kann auch planen und hervorheben +- Neuer Bereich „Redaktion“ mit Entwürfen, Freigaben und Geplantem +- Benachrichtigungen im Portal (Glocke im Kopfbereich), z. B. bei Freigabe-Anfragen +- Rechte für einzelne Seiten lassen sich im Rollen-Formular „inkl. Unterseiten“ vergeben +- Behoben: Nach einem manuellen Update per FTP wurde die Datenbank unter Umständen nicht aktualisiert + ## 0.4.0 - Anmeldung mit Microsoft Entra ID („Mit Microsoft anmelden“) – Konten werden bei der ersten Anmeldung angelegt oder per E-Mail verknüpft diff --git a/app/Editorial/Editorial.php b/app/Editorial/Editorial.php new file mode 100644 index 00000000..690565ee --- /dev/null +++ b/app/Editorial/Editorial.php @@ -0,0 +1,66 @@ + */ + private array $sections = []; + + /** + * @param Closure(User): bool $visible schnelle Rechteprüfung (ohne Abfragen) + * @param Closure(User): array $props + */ + public function add(string $key, string $label, string $component, int $sort, Closure $visible, Closure $props): void + { + $this->sections[$key] = compact('label', 'component', 'sort', 'visible', 'props'); + } + + public function remove(string $key): void + { + unset($this->sections[$key]); + } + + public function visibleFor(User $user): bool + { + foreach ($this->sections as $section) { + if (($section['visible'])($user)) { + return true; + } + } + + return false; + } + + /** + * @return list}> + */ + public function resolve(User $user): array + { + $result = []; + + foreach (collect($this->sections)->sortBy('sort') as $key => $section) { + if (! ($section['visible'])($user)) { + continue; + } + + try { + $result[] = ['key' => $key, 'label' => $section['label'], 'component' => $section['component'], 'props' => ($section['props'])($user)]; + } catch (Throwable $e) { + Log::error("Redaktionsbereich {$key} fehlgeschlagen: ".$e->getMessage(), ['exception' => $e]); + } + } + + return $result; + } +} diff --git a/app/Filament/Components/RoleGrantSelect.php b/app/Filament/Components/RoleGrantSelect.php index c00ff065..6a84d6ed 100644 --- a/app/Filament/Components/RoleGrantSelect.php +++ b/app/Filament/Components/RoleGrantSelect.php @@ -13,7 +13,7 @@ use Illuminate\Database\Eloquent\Model; */ class RoleGrantSelect { - public static function make(string $name, string $label, string $ability, string $resourceType): Select + public static function make(string $name, string $label, string $ability, string $resourceType, bool $includeChildren = false): Select { return Select::make($name) ->label($label) @@ -23,14 +23,14 @@ class RoleGrantSelect ->afterStateHydrated(fn (Select $component, ?Model $record) => $component->state($record ? Grant::query()->where('ability', $ability)->where('resource_type', $resourceType)->where('resource_id', $record->getKey())->pluck('role_id')->all() : [])) - ->saveRelationshipsUsing(function (Model $record, ?array $state) use ($ability, $resourceType) { + ->saveRelationshipsUsing(function (Model $record, ?array $state) use ($ability, $resourceType, $includeChildren) { $roleIds = array_map('intval', $state ?? []); $existing = Grant::query()->where('ability', $ability)->where('resource_type', $resourceType)->where('resource_id', $record->getKey()); (clone $existing)->whereNotIn('role_id', $roleIds)->get()->each->delete(); foreach (array_diff($roleIds, (clone $existing)->pluck('role_id')->all()) as $roleId) { - Grant::query()->create(['role_id' => $roleId, 'ability' => $ability, 'resource_type' => $resourceType, 'resource_id' => $record->getKey()]); + Grant::query()->create(['role_id' => $roleId, 'ability' => $ability, 'resource_type' => $resourceType, 'resource_id' => $record->getKey(), 'include_children' => $includeChildren]); } }) ->dehydrated(false); diff --git a/app/Filament/Resources/Roles/RoleResource.php b/app/Filament/Resources/Roles/RoleResource.php index e9e3908d..d1cbfb24 100644 --- a/app/Filament/Resources/Roles/RoleResource.php +++ b/app/Filament/Resources/Roles/RoleResource.php @@ -18,6 +18,7 @@ use Filament\Forms\Components\Repeater; use Filament\Forms\Components\Select; use Filament\Forms\Components\Textarea; use Filament\Forms\Components\TextInput; +use Filament\Forms\Components\Toggle; use Filament\Resources\Resource; use Filament\Schemas\Components\Section; use Filament\Schemas\Components\Utilities\Get; @@ -89,7 +90,7 @@ class RoleResource extends Resource ->schema([ Repeater::make('object_grants') ->hiddenLabel() - ->columns(2) + ->columns(3) ->addActionLabel('Recht hinzufügen') ->defaultItems(0) ->schema([ @@ -111,13 +112,19 @@ class RoleResource extends Resource return ['*' => 'Alle'] + $options; }), + Toggle::make('include_children') + ->label('Inkl. Unterseiten') + ->inline(false) + ->default(true) + ->visible(fn (Get $get) => $abilities->isHierarchical($abilities->all()[$get('ability')]['resource'] ?? null)), ]) ->afterStateHydrated(fn (Repeater $component, ?Role $record) => $component->state( $record?->grants()->whereNotNull('resource_type')->get() - ->groupBy('ability') - ->map(fn ($grants, $ability) => [ - 'ability' => $ability, + ->groupBy(fn (Grant $g) => $g->ability.'|'.(int) $g->include_children) + ->map(fn ($grants) => [ + 'ability' => $grants->first()->ability, 'resource_ids' => $grants->map(fn (Grant $g) => $g->resource_id === null ? '*' : (string) $g->resource_id)->values()->all(), + 'include_children' => (bool) $grants->first()->include_children, ])->values()->all() ?? [] )) ->saveRelationshipsUsing(function (Role $record, ?array $state) use ($abilities) { @@ -132,8 +139,10 @@ class RoleResource extends Resource $ids = in_array('*', (array) $item['resource_ids'], true) ? [null] : array_map('intval', (array) $item['resource_ids']); + $inherit = $abilities->isHierarchical($type) && ($item['include_children'] ?? false); + foreach (array_unique($ids) as $id) { - $record->grants()->create(['ability' => $item['ability'], 'resource_type' => $type, 'resource_id' => $id]); + $record->grants()->create(['ability' => $item['ability'], 'resource_type' => $type, 'resource_id' => $id, 'include_children' => $inherit && $id !== null]); } } }) diff --git a/app/Http/Controllers/EditorialController.php b/app/Http/Controllers/EditorialController.php new file mode 100644 index 00000000..49bcf98c --- /dev/null +++ b/app/Http/Controllers/EditorialController.php @@ -0,0 +1,20 @@ +visibleFor($request->user()), 403); + + return Inertia::render('Editorial/Index', [ + 'sections' => $editorial->resolve($request->user()), + ]); + } +} diff --git a/app/Http/Controllers/NotificationController.php b/app/Http/Controllers/NotificationController.php new file mode 100644 index 00000000..193bc533 --- /dev/null +++ b/app/Http/Controllers/NotificationController.php @@ -0,0 +1,50 @@ +user()->notifications()->limit(20)->get(); + + return response()->json([ + 'notifications' => $notifications->map(fn (DatabaseNotification $n) => [ + 'id' => $n->id, + 'title' => (string) ($n->data['title'] ?? ''), + 'body' => (string) ($n->data['body'] ?? ''), + 'icon' => (string) ($n->data['icon'] ?? 'bell'), + 'has_url' => filled($n->data['url'] ?? null), + 'read' => $n->read_at !== null, + 'created_at' => $n->created_at?->toIso8601String(), + ]), + 'unread' => $request->user()->unreadNotifications()->count(), + ]); + } + + public function open(Request $request, string $id): RedirectResponse + { + $notification = $request->user()->notifications()->whereKey($id)->firstOrFail(); + $notification->markAsRead(); + $url = (string) ($notification->data['url'] ?? ''); + + // Nur Adressen innerhalb des Portals ansteuern. + return redirect()->to($url !== '' && (Str::startsWith($url, '/') && ! Str::startsWith($url, '//') || Str::startsWith($url, url('/'))) ? $url : '/'); + } + + public function markAllRead(Request $request): JsonResponse + { + $request->user()->unreadNotifications()->update(['read_at' => now()]); + + return response()->json(['unread' => 0]); + } +} diff --git a/app/Http/Controllers/PeopleController.php b/app/Http/Controllers/PeopleController.php index f2f43c0a..bf742df3 100644 --- a/app/Http/Controllers/PeopleController.php +++ b/app/Http/Controllers/PeopleController.php @@ -6,6 +6,7 @@ use App\Http\Resources\PersonResource; use App\Models\User; use App\Support\ProfileFields; use Illuminate\Database\Eloquent\Builder; +use Illuminate\Http\JsonResponse; use Illuminate\Http\Request; use Illuminate\Support\Facades\Cache; use Inertia\Inertia; @@ -55,6 +56,30 @@ class PeopleController extends Controller ]); } + /** + * Personenauswahl in Formularen (z. B. Block „Ansprechpartner“): Suche oder Abruf per ID. + */ + public function search(Request $request): JsonResponse + { + $data = $request->validate([ + 'q' => ['nullable', 'string', 'max:100'], + 'ids' => ['nullable', 'array', 'max:50'], + 'ids.*' => ['integer'], + ]); + + $search = trim($data['q'] ?? ''); + $like = '%'.str_replace(['\\', '%', '_'], ['\\\\', '\\%', '\\_'], $search).'%'; + + $people = User::query()->active() + ->when(isset($data['ids']), fn (Builder $q) => $q->whereIn('id', $data['ids'])) + ->when(! isset($data['ids']), fn (Builder $q) => $q->where(fn (Builder $q) => $q->where('name', 'like', $like)->orWhere('email', 'like', $like))) + ->orderBy('name') + ->limit(20) + ->get(); + + return response()->json(['people' => PersonResource::collection($people)->resolve()]); + } + public function show(User $user): Response { abort_unless($user->is_active, 404); diff --git a/app/Http/Middleware/HandleInertiaRequests.php b/app/Http/Middleware/HandleInertiaRequests.php index e85519f7..11e570e7 100644 --- a/app/Http/Middleware/HandleInertiaRequests.php +++ b/app/Http/Middleware/HandleInertiaRequests.php @@ -38,7 +38,8 @@ class HandleInertiaRequests extends Middleware 'can_admin' => $user->canAccessAdmin(), ] : null, ], - 'navigation' => fn () => $user ? $this->navigation->items($request) : [], + 'navigation' => fn () => $user ? $this->navigation->items($request, $user) : [], + 'notifications' => fn () => $user ? ['unread' => $user->unreadNotifications()->count()] : null, 'flash' => [ 'status' => fn () => $request->session()->get('status'), ], diff --git a/app/Notifications/PortalNotification.php b/app/Notifications/PortalNotification.php new file mode 100644 index 00000000..0b481bec --- /dev/null +++ b/app/Notifications/PortalNotification.php @@ -0,0 +1,40 @@ +notify(new PortalNotification('Beitrag freigegeben', '„Sommerfest“ ist online.', '/neuigkeiten/sommerfest', 'check')); + */ +class PortalNotification extends Notification +{ + use Queueable; + + public function __construct( + public readonly string $title, + public readonly string $body = '', + public readonly ?string $url = null, + public readonly string $icon = 'bell', + ) {} + + /** + * @return list + */ + public function via(object $notifiable): array + { + return ['database']; + } + + /** + * @return array + */ + public function toArray(object $notifiable): array + { + return ['title' => $this->title, 'body' => $this->body, 'url' => $this->url, 'icon' => $this->icon]; + } +} diff --git a/app/Pagebuilder/BlockType.php b/app/Pagebuilder/BlockType.php new file mode 100644 index 00000000..12118a80 --- /dev/null +++ b/app/Pagebuilder/BlockType.php @@ -0,0 +1,94 @@ + $fields + * @param array{min: int, max: int, titled: bool, label: string}|null $container + * @param (Closure(array, User|null, array): (array|null))|null $resolve + * Daten für die Anzeige (z. B. Bild-URL, aktuelle Beiträge); null = Block ausblenden + */ + public function __construct( + public readonly string $key, + public readonly string $label, + public readonly string $icon, + public readonly string $group, + public readonly string $component, + public readonly array $fields = [], + public readonly ?array $container = null, + public readonly ?Closure $resolve = null, + public readonly string $description = '', + ) {} + + public static function make(string $key, string $label, string $icon, string $group, ?string $component = null): self + { + return new self($key, $label, $icon, $group, $component ?? str_replace(' ', '', ucwords(str_replace(['-', '_', '.'], ' ', $key)))); + } + + /** + * @param list $fields + */ + public function fields(array $fields): self + { + return new self($this->key, $this->label, $this->icon, $this->group, $this->component, $fields, $this->container, $this->resolve, $this->description); + } + + public function container(int $min = 1, int $max = 1, bool $titled = false, string $label = 'Bereich'): self + { + return new self($this->key, $this->label, $this->icon, $this->group, $this->component, $this->fields, ['min' => $min, 'max' => $max, 'titled' => $titled, 'label' => $label], $this->resolve, $this->description); + } + + public function resolveUsing(Closure $resolve): self + { + return new self($this->key, $this->label, $this->icon, $this->group, $this->component, $this->fields, $this->container, $resolve, $this->description); + } + + public function description(string $description): self + { + return new self($this->key, $this->label, $this->icon, $this->group, $this->component, $this->fields, $this->container, $this->resolve, $description); + } + + /** + * @return array + */ + public function defaults(): array + { + $data = []; + + foreach ($this->fields as $field) { + $data[$field->name] = $field->default(); + } + + return $data; + } + + /** + * @return array + */ + public function toArray(): array + { + return [ + 'key' => $this->key, + 'label' => $this->label, + 'icon' => $this->icon, + 'group' => $this->group, + 'component' => $this->component, + 'description' => $this->description, + 'fields' => array_map(fn (Field $field) => $field->toArray(), $this->fields), + 'container' => $this->container, + 'defaults' => $this->defaults(), + 'dynamic' => $this->resolve !== null, + ]; + } +} diff --git a/app/Pagebuilder/Blocks.php b/app/Pagebuilder/Blocks.php new file mode 100644 index 00000000..fd11e8c5 --- /dev/null +++ b/app/Pagebuilder/Blocks.php @@ -0,0 +1,239 @@ +add(BlockType::make('news.latest', 'Neuigkeiten', 'newspaper', 'dynamic', 'news::LatestBlock') + * ->fields([...])->resolveUsing(fn (array $data, ?User $user) => [...])); + * + * Vue-Komponenten liegen unter resources/js/pagebuilder/blocks/.vue + * bzw. plugins-core//resources/js/blocks/.vue („slug::Name“). + */ +class Blocks +{ + public const GROUPS = [ + 'layout' => 'Layout', + 'content' => 'Inhalt', + 'media' => 'Medien', + 'dynamic' => 'Dynamisch', + ]; + + /** @var array */ + private array $types = []; + + public function __construct() + { + $this->registerLayout(); + $this->registerContent(); + } + + public function add(BlockType $type): void + { + $this->types[$type->key] = $type; + } + + public function remove(string $key): void + { + unset($this->types[$key]); + } + + public function get(string $key): ?BlockType + { + return $this->types[$key] ?? null; + } + + /** + * @return array + */ + public function all(): array + { + return Hooks::apply('pagebuilder.blocks', $this->types); + } + + /** + * @return list> + */ + public function forEditor(): array + { + return array_values(array_map(fn (BlockType $type) => $type->toArray(), $this->all())); + } + + public static function imageUrl(?string $path): ?string + { + return $path ? Storage::disk('uploads')->url($path) : null; + } + + private function registerLayout(): void + { + $backgrounds = ['none' => 'Ohne', 'muted' => 'Grau', 'card' => 'Weiß mit Rahmen', 'brand-soft' => 'Markenfarbe hell', 'brand' => 'Markenfarbe']; + + $this->add(BlockType::make('section', 'Abschnitt', 'square-dashed', 'layout') + ->description('Fasst Blöcke zusammen, optional mit Hintergrund.') + ->container() + ->fields([ + Field::select('background', 'Hintergrund', $backgrounds, 'none'), + Field::select('padding', 'Innenabstand', ['none' => 'Ohne', 'normal' => 'Normal', 'large' => 'Groß'], 'normal'), + ])); + + $this->add(BlockType::make('columns', 'Spalten', 'columns-3', 'layout') + ->description('Zwei bis vier Spalten nebeneinander.') + ->container(1, 4, label: 'Spalte') + ->fields([ + Field::select('layout', 'Aufteilung', [ + '1-1' => '2 Spalten (1:1)', + '2-1' => '2 Spalten (2:1)', + '1-2' => '2 Spalten (1:2)', + '1-1-1' => '3 Spalten', + '1-2-1' => '3 Spalten (1:2:1)', + '1-1-1-1' => '4 Spalten', + ], '1-1'), + Field::select('stack', 'Untereinander auf', ['sm' => 'Smartphones', 'md' => 'Tablets und Smartphones', 'lg' => 'Kleinen Bildschirmen'], 'md'), + Field::select('gap', 'Abstand', ['small' => 'Klein', 'normal' => 'Normal', 'large' => 'Groß'], 'normal'), + Field::select('align', 'Vertikal ausrichten', ['start' => 'Oben', 'center' => 'Mitte', 'stretch' => 'Gleiche Höhe'], 'start'), + ])); + + $this->add(BlockType::make('tabs', 'Tabs', 'panel-top', 'layout') + ->description('Inhalte auf Reiter verteilt.') + ->container(1, 12, titled: true, label: 'Tab')); + + $this->add(BlockType::make('accordion', 'Akkordeon', 'list-collapse', 'layout') + ->description('Aufklappbare Abschnitte, z. B. für häufige Fragen.') + ->container(1, 30, titled: true, label: 'Abschnitt') + ->fields([ + Field::toggle('first_open', 'Ersten Abschnitt geöffnet anzeigen'), + Field::toggle('multiple', 'Mehrere gleichzeitig öffnen'), + ])); + + $this->add(BlockType::make('box', 'Box', 'message-square-warning', 'layout') + ->description('Hervorgehobener Kasten: Info, Hinweis, Warnung …') + ->container() + ->fields([ + Field::select('variant', 'Art', [ + 'info' => 'Info', + 'note' => 'Hinweis', + 'warning' => 'Warnung', + 'success' => 'Erfolg', + 'neutral' => 'Neutral', + 'highlight' => 'Hervorgehoben', + ], 'info'), + Field::text('title', 'Überschrift', 150), + Field::toggle('show_icon', 'Symbol anzeigen', true), + ])); + } + + private function registerContent(): void + { + $this->add(BlockType::make('heading', 'Überschrift', 'heading', 'content') + ->fields([ + Field::text('text', 'Text', 200, placeholder: 'Überschrift'), + Field::select('level', 'Größe', ['2' => 'Groß (H2)', '3' => 'Mittel (H3)', '4' => 'Klein (H4)'], '2'), + Field::select('align', 'Ausrichtung', ['left' => 'Links', 'center' => 'Zentriert'], 'left'), + ])); + + $this->add(BlockType::make('text', 'Text', 'text', 'content') + ->description('Absätze, Listen, Links und Hervorhebungen.') + ->fields([Field::html('html', 'Text')])); + + $this->add(BlockType::make('quote', 'Zitat', 'quote', 'content') + ->fields([ + Field::textarea('text', 'Zitat', 1000), + Field::text('source', 'Quelle', 150), + ])); + + $this->add(BlockType::make('buttons', 'Schaltflächen', 'mouse-pointer-click', 'content') + ->fields([ + Field::repeater('buttons', 'Schaltflächen', [ + Field::text('label', 'Beschriftung', 80), + Field::url('url', 'Link'), + Field::select('variant', 'Darstellung', ['primary' => 'Markenfarbe', 'outline' => 'Umrandet', 'link' => 'Als Link'], 'primary'), + Field::toggle('new_tab', 'In neuem Tab öffnen'), + ], 6, 'Schaltfläche'), + Field::select('align', 'Ausrichtung', ['left' => 'Links', 'center' => 'Zentriert'], 'left'), + ])); + + $this->add(BlockType::make('icon-list', 'Symbolliste', 'list-checks', 'content') + ->fields([ + Field::repeater('items', 'Einträge', [ + Field::icon('icon', 'Symbol'), + Field::text('title', 'Titel', 120), + Field::textarea('text', 'Text', 500), + Field::url('url', 'Link'), + ], 30, 'Eintrag'), + Field::select('layout', 'Darstellung', ['list' => 'Liste', 'grid' => 'Kacheln'], 'list'), + ])); + + $this->add(BlockType::make('table', 'Tabelle', 'table', 'content') + ->fields([ + Field::table('rows', 'Tabelle'), + Field::toggle('header', 'Erste Zeile als Kopfzeile', true), + Field::text('caption', 'Beschriftung', 200), + ])); + + $this->add(BlockType::make('divider', 'Trennlinie', 'minus', 'content')); + + $this->add(BlockType::make('spacer', 'Abstand', 'move-vertical', 'content') + ->fields([Field::select('size', 'Höhe', ['small' => 'Klein', 'medium' => 'Mittel', 'large' => 'Groß'], 'medium')])); + + $this->add(BlockType::make('image', 'Bild', 'image', 'media') + ->fields([ + Field::image('path', 'Bild'), + Field::text('alt', 'Alternativtext', 200)->help('Beschreibt das Bild für Screenreader.'), + Field::text('caption', 'Bildunterschrift', 300), + Field::select('size', 'Breite', ['full' => 'Volle Breite', 'medium' => 'Mittel', 'small' => 'Klein'], 'full'), + Field::url('url', 'Link beim Anklicken'), + ]) + ->resolveUsing(fn (array $data) => ['url' => self::imageUrl($data['path'])])); + + $this->add(BlockType::make('gallery', 'Galerie', 'images', 'media') + ->fields([ + Field::repeater('images', 'Bilder', [ + Field::image('path', 'Bild'), + Field::text('alt', 'Alternativtext', 200), + Field::text('caption', 'Bildunterschrift', 300), + ], 60, 'Bild'), + Field::select('columns', 'Spalten', ['2' => '2', '3' => '3', '4' => '4'], '3'), + ]) + ->resolveUsing(fn (array $data) => ['urls' => array_map(fn ($image) => self::imageUrl($image['path'] ?? null), $data['images'])])); + + $this->add(BlockType::make('video', 'Video', 'play', 'media') + ->description('YouTube, Vimeo oder MP4-Datei. Externe Videos laden erst nach Klick.') + ->fields([ + Field::url('url', 'Adresse des Videos'), + Field::text('title', 'Titel', 200), + ]) + ->resolveUsing(fn (array $data) => ['embed' => VideoEmbed::from($data['url'])])); + + $this->add(BlockType::make('hero', 'Titelbild mit Text', 'panorama', 'media') + ->fields([ + Field::image('path', 'Hintergrundbild'), + Field::text('title', 'Titel', 150), + Field::textarea('text', 'Text', 400), + Field::text('button_label', 'Beschriftung der Schaltfläche', 80), + Field::url('button_url', 'Link der Schaltfläche'), + Field::select('height', 'Höhe', ['small' => 'Niedrig', 'medium' => 'Mittel', 'large' => 'Hoch'], 'medium'), + ]) + ->resolveUsing(fn (array $data) => ['url' => self::imageUrl($data['path'])])); + + $this->add(BlockType::make('contacts', 'Ansprechpartner', 'contact', 'dynamic') + ->description('Personen aus dem Verzeichnis – immer mit aktuellen Kontaktdaten.') + ->fields([ + Field::text('title', 'Überschrift', 150), + Field::people('people', 'Personen'), + Field::select('layout', 'Darstellung', ['cards' => 'Karten', 'list' => 'Liste'], 'cards'), + ]) + ->resolveUsing(function (array $data) { + $people = User::query()->active()->whereIn('id', $data['people'])->get() + ->sortBy(fn (User $user) => array_search($user->id, $data['people'], true))->values(); + + return ['people' => PersonResource::collection($people)->resolve()]; + })); + } +} diff --git a/app/Pagebuilder/Content.php b/app/Pagebuilder/Content.php new file mode 100644 index 00000000..4bbc50f1 --- /dev/null +++ b/app/Pagebuilder/Content.php @@ -0,0 +1,292 @@ +>} + */ + public static function empty(): array + { + return ['blocks' => []]; + } + + /** + * @param array|null $content + * @return array{blocks: list>} + */ + public function sanitize(?array $content): array + { + $this->count = 0; + + return ['blocks' => $this->sanitizeList($content['blocks'] ?? [], 1)]; + } + + /** + * Anzeigefertiger Inhalt für eine Person. + * + * @param array|null $content bereits bereinigter Inhalt + * @return array{blocks: list>} + */ + public function render(?array $content, ?User $user, array $context = []): array + { + return ['blocks' => $this->renderList($content['blocks'] ?? [], $user, $context)]; + } + + /** + * Ein einzelner Block (Editor-Vorschau dynamischer Blöcke). + * + * @param array $block + * @return array|null + */ + public function preview(array $block, ?User $user, array $context = []): ?array + { + $this->count = 0; + $clean = $this->sanitizeList([$block], 1)[0] ?? null; + + if (! $clean) { + return null; + } + + $type = $this->blocks->get($clean['type']); + + return $type?->resolve ? $this->resolve($type, $clean, $user, $context) : []; + } + + /** + * Alle Werte eines Feldtyps im Baum, z. B. alle Bildpfade (für Aufräumarbeiten). + * + * @param array|null $content + * @return list + */ + public function collect(?array $content, callable $picker): array + { + $result = []; + $walk = function (array $blocks) use (&$walk, &$result, $picker) { + foreach ($blocks as $block) { + array_push($result, ...(array) $picker($block)); + + foreach ($block['items'] ?? [] as $item) { + $walk($item['blocks'] ?? []); + } + } + }; + $walk($content['blocks'] ?? []); + + return $result; + } + + /** + * Reiner Text des Inhalts, z. B. für die Suche. + * + * @param array|null $content + */ + public function plainText(?array $content): string + { + $parts = $this->collect($content, function (array $block) { + $texts = []; + + array_walk_recursive($block['data'], function ($value) use (&$texts) { + if (is_string($value) && ! str_starts_with($value, 'pagebuilder/')) { + $texts[] = strip_tags($value); + } + }); + + foreach ($block['items'] ?? [] as $item) { + $texts[] = $item['title'] ?? ''; + } + + return [implode(' ', $texts)]; + }); + + return trim(preg_replace('/\s+/u', ' ', html_entity_decode(implode(' ', $parts))) ?? ''); + } + + /** + * @return list> + */ + private function sanitizeList(mixed $blocks, int $depth): array + { + if (! is_array($blocks) || $depth > self::MAX_DEPTH) { + return []; + } + + $result = []; + + foreach (array_values($blocks) as $block) { + if (! is_array($block) || ++$this->count > self::MAX_BLOCKS) { + continue; + } + + $type = $this->blocks->get((string) ($block['type'] ?? '')); + + if (! $type) { + continue; + } + + $data = is_array($block['data'] ?? null) ? $block['data'] : []; + $clean = [ + 'id' => self::id($block['id'] ?? null), + 'type' => $type->key, + 'data' => [], + ]; + + foreach ($type->fields as $field) { + $clean['data'][$field->name] = $field->sanitize(array_key_exists($field->name, $data) ? $data[$field->name] : $field->default()); + } + + $visibility = $this->sanitizeVisibility($block['visibility'] ?? null); + + if ($visibility !== null) { + $clean['visibility'] = $visibility; + } + + if ($type->container) { + $clean['items'] = $this->sanitizeItems($type, $clean['data'], $block['items'] ?? [], $depth); + } + + $result[] = $clean; + } + + return $result; + } + + /** + * @param array $data + * @return list> + */ + private function sanitizeItems(BlockType $type, array $data, mixed $items, int $depth): array + { + $items = is_array($items) ? array_values(array_filter($items, 'is_array')) : []; + $container = $type->container; + + // Spalten: Anzahl folgt der Aufteilung. Überzählige Spalten werden an die letzte angehängt, nichts geht verloren. + $count = $type->key === 'columns' + ? count(explode('-', (string) ($data['layout'] ?? '1-1'))) + : max($container['min'], min($container['max'], count($items))); + + if (count($items) > $count && $count > 0) { + $overflow = array_merge(...array_map(fn ($item) => (array) ($item['blocks'] ?? []), array_slice($items, $count))); + $items = array_slice($items, 0, $count); + $items[$count - 1]['blocks'] = array_merge((array) ($items[$count - 1]['blocks'] ?? []), $overflow); + } + + $items = array_pad($items, $count, []); + + return array_map(fn (array $item) => array_filter([ + 'id' => self::id($item['id'] ?? null), + 'title' => $container['titled'] ? mb_substr(trim((string) ($item['title'] ?? '')), 0, 120) : null, + 'blocks' => $this->sanitizeList($item['blocks'] ?? [], $depth + 1), + ], fn ($value) => $value !== null), $items); + } + + /** + * @return array{role?: list, department?: list, location?: list}|null + */ + private function sanitizeVisibility(mixed $visibility): ?array + { + if (! is_array($visibility)) { + return null; + } + + $clean = []; + + foreach (['role', 'department', 'location'] as $rule) { + $values = array_values(array_unique(array_filter(array_map( + fn ($value) => is_scalar($value) ? mb_substr(trim((string) $value), 0, 150) : '', + (array) ($visibility[$rule] ?? []), + )))); + + if ($values !== []) { + $clean[$rule] = array_slice($values, 0, 50); + } + } + + return $clean === [] ? null : $clean; + } + + /** + * @param list> $blocks + * @return list> + */ + private function renderList(array $blocks, ?User $user, array $context): array + { + $result = []; + + foreach ($blocks as $block) { + $type = $this->blocks->get($block['type'] ?? ''); + + // Blöcke deaktivierter Plugins und fremde Zielgruppen einfach auslassen. + if (! $type || ! Audiences::matches($block['visibility'] ?? null, $user)) { + continue; + } + + if ($type->resolve) { + $props = $this->resolve($type, $block, $user, $context); + + if ($props === null) { + continue; + } + + $block['props'] = $props; + } + + unset($block['visibility']); + $block['component'] = $type->component; + + if (isset($block['items'])) { + $block['items'] = array_map(fn (array $item) => [...$item, 'blocks' => $this->renderList($item['blocks'] ?? [], $user, $context)], $block['items']); + } + + $result[] = $block; + } + + return $result; + } + + /** + * @param array $block + * @return array|null + */ + private function resolve(BlockType $type, array $block, ?User $user, array $context): ?array + { + try { + return ($type->resolve)($block['data'], $user, $context); + } catch (Throwable $e) { + // Ein fehlerhafter Plugin-Block darf die Seite nicht mitreißen. + Log::warning("Pagebuilder-Block {$type->key} konnte nicht geladen werden: ".$e->getMessage()); + + return null; + } + } + + private static function id(mixed $id): string + { + return is_string($id) && preg_match('/^[A-Za-z0-9_-]{4,40}$/', $id) ? $id : Str::random(12); + } +} diff --git a/app/Pagebuilder/Field.php b/app/Pagebuilder/Field.php new file mode 100644 index 00000000..a3b342e2 --- /dev/null +++ b/app/Pagebuilder/Field.php @@ -0,0 +1,209 @@ + $options + */ + private function __construct( + public readonly string $name, + public readonly string $type, + public readonly string $label, + private readonly array $options = [], + ) {} + + public static function text(string $name, string $label, int $max = 200, string $default = '', ?string $placeholder = null): self + { + return new self($name, 'text', $label, ['max' => $max, 'default' => $default, 'placeholder' => $placeholder]); + } + + public static function textarea(string $name, string $label, int $max = 2000, string $default = ''): self + { + return new self($name, 'textarea', $label, ['max' => $max, 'default' => $default]); + } + + /** Formatierter Text – im Editor direkt im Block bearbeitet (TipTap). */ + public static function html(string $name, string $label): self + { + return new self($name, 'html', $label, ['default' => '']); + } + + /** + * @param array|Closure(): array $choices + */ + public static function select(string $name, string $label, array|Closure $choices, ?string $default = null): self + { + return new self($name, 'select', $label, ['choices' => $choices, 'default' => $default]); + } + + public static function toggle(string $name, string $label, bool $default = false): self + { + return new self($name, 'toggle', $label, ['default' => $default]); + } + + public static function number(string $name, string $label, int $min, int $max, int $default): self + { + return new self($name, 'number', $label, ['min' => $min, 'max' => $max, 'default' => $default]); + } + + public static function url(string $name, string $label, string $default = ''): self + { + return new self($name, 'url', $label, ['default' => $default]); + } + + /** Hochgeladenes Bild (Pfad im Upload-Speicher). */ + public static function image(string $name, string $label): self + { + return new self($name, 'image', $label, ['default' => null]); + } + + /** Personen aus dem Verzeichnis (IDs). */ + public static function people(string $name, string $label, int $max = 24): self + { + return new self($name, 'people', $label, ['max' => $max, 'default' => []]); + } + + /** Einfache Tabelle: Zeilen aus Textzellen. */ + public static function table(string $name, string $label): self + { + return new self($name, 'table', $label, ['default' => [['', ''], ['', '']]]); + } + + /** Symbol aus dem Symbolsatz der Schnellzugriffe. */ + public static function icon(string $name, string $label, string $default = 'link'): self + { + return new self($name, 'icon', $label, ['default' => $default, 'choices' => QuickLinks::ICONS]); + } + + /** Liste gleichartiger Einträge, z. B. Schaltflächen oder Galeriebilder. */ + public static function repeater(string $name, string $label, array $fields, int $max = 20, string $itemLabel = 'Eintrag'): self + { + return new self($name, 'repeater', $label, ['fields' => $fields, 'max' => $max, 'default' => [], 'itemLabel' => $itemLabel]); + } + + /** Beliebige Liste von IDs, deren Einträge der Block selbst verwaltet (z. B. Dateien). */ + public static function ids(string $name, string $label, string $kind, int $max = 50): self + { + return new self($name, 'ids', $label, ['kind' => $kind, 'max' => $max, 'default' => []]); + } + + public function default(): mixed + { + if ($this->type === 'repeater') { + return []; + } + + return $this->options['default'] ?? null; + } + + public function help(string $help): self + { + return new self($this->name, $this->type, $this->label, [...$this->options, 'help' => $help]); + } + + /** + * @return array Beschreibung für das Editor-Formular + */ + public function toArray(): array + { + $options = $this->options; + + if (isset($options['choices'])) { + $choices = $options['choices'] instanceof Closure ? ($options['choices'])() : $options['choices']; + $options['choices'] = collect($choices)->map(fn ($label, $value) => ['value' => (string) $value, 'label' => $label])->values()->all(); + } + + if (isset($options['fields'])) { + $options['fields'] = array_map(fn (Field $field) => $field->toArray(), $options['fields']); + } + + return ['name' => $this->name, 'type' => $this->type, 'label' => $this->label, ...$options]; + } + + public function sanitize(mixed $value): mixed + { + return match ($this->type) { + 'text', 'textarea' => mb_substr(trim(is_scalar($value) ? (string) $value : ''), 0, $this->options['max']), + 'html' => app(RichText::class)->sanitize(is_string($value) ? mb_substr($value, 0, 200_000) : ''), + 'select' => $this->sanitizeChoice($value), + 'toggle' => (bool) $value, + 'number' => max($this->options['min'], min($this->options['max'], is_numeric($value) ? (int) $value : $this->options['default'])), + 'url' => self::safeUrl($value), + 'image' => is_string($value) && preg_match('#^pagebuilder/[A-Za-z0-9/_.-]+$#', $value) && ! str_contains($value, '..') ? $value : null, + 'people', 'ids' => array_values(array_slice(array_unique(array_filter(array_map('intval', is_array($value) ? $value : []))), 0, $this->options['max'])), + 'table' => $this->sanitizeTable($value), + 'icon' => is_string($value) && array_key_exists($value, QuickLinks::ICONS) ? $value : $this->options['default'], + 'repeater' => $this->sanitizeRepeater($value), + default => null, + }; + } + + public static function safeUrl(mixed $value): string + { + $url = trim(is_string($value) ? $value : ''); + + if ($url === '' || mb_strlen($url) > 2000) { + return ''; + } + + // Relative Adressen im Portal, Anker oder http(s)/mailto/tel – nichts anderes (kein javascript:). + if (preg_match('#^(/(?!/)|\#)#', $url) || preg_match('#^(https?://|mailto:|tel:)#i', $url)) { + return $url; + } + + return preg_match('#^[a-z0-9.-]+\.[a-z]{2,}(/|$)#i', $url) ? 'https://'.$url : ''; + } + + private function sanitizeChoice(mixed $value): ?string + { + $choices = $this->options['choices'] instanceof Closure ? ($this->options['choices'])() : $this->options['choices']; + $value = is_scalar($value) ? (string) $value : null; + + return $value !== null && array_key_exists($value, $choices) ? $value : $this->options['default']; + } + + /** + * @return list> + */ + private function sanitizeTable(mixed $value): array + { + $rows = array_slice(is_array($value) ? array_values($value) : [], 0, 100); + $width = min(10, max(1, ...array_map(fn ($row) => is_array($row) ? count($row) : 1, $rows ?: [[]]))); + + return array_map(function ($row) use ($width) { + $cells = array_slice(is_array($row) ? array_values($row) : [], 0, $width); + + return array_pad(array_map(fn ($cell) => mb_substr(is_scalar($cell) ? (string) $cell : '', 0, 1000), $cells), $width, ''); + }, $rows); + } + + /** + * @return list> + */ + private function sanitizeRepeater(mixed $value): array + { + $items = array_slice(is_array($value) ? array_values($value) : [], 0, $this->options['max']); + + return array_map(function ($item) { + $item = is_array($item) ? $item : []; + $clean = []; + + foreach ($this->options['fields'] as $field) { + $clean[$field->name] = $field->sanitize($item[$field->name] ?? $field->default()); + } + + return $clean; + }, $items); + } +} diff --git a/app/Pagebuilder/VideoEmbed.php b/app/Pagebuilder/VideoEmbed.php new file mode 100644 index 00000000..9abe41c0 --- /dev/null +++ b/app/Pagebuilder/VideoEmbed.php @@ -0,0 +1,34 @@ + 'YouTube', 'src' => 'https://www.youtube-nocookie.com/embed/'.$m[1].'?rel=0']; + } + + if (preg_match('~vimeo\.com/(?:video/)?(\d+)~', $url, $m)) { + return ['provider' => 'Vimeo', 'src' => 'https://player.vimeo.com/video/'.$m[1].'?dnt=1']; + } + + if (preg_match('~\.(mp4|webm)(\?.*)?$~i', $url)) { + return ['provider' => 'file', 'src' => $url]; + } + + return null; + } +} diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 312fc51f..254192fc 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -4,13 +4,16 @@ namespace App\Providers; use App\Dashboard\CoreWidgets; use App\Dashboard\Widgets; +use App\Editorial\Editorial; use App\Models\User; +use App\Pagebuilder\Blocks; use App\Support\Abilities; use App\Support\Avatars; use App\Support\BackgroundTasks; use App\Support\Branding; use App\Support\Installation; use App\Support\License\LicenseStore; +use App\Support\Navigation; use App\Support\Permissions\PermissionResource; use App\Support\Permissions\Permissions; use App\Support\ProfileFields; @@ -45,6 +48,8 @@ class AppServiceProvider extends ServiceProvider $this->app->singleton(LicenseStore::class); $this->app->singleton(Permissions::class); $this->app->singleton(ProfileFields::class); + $this->app->singleton(Blocks::class); + $this->app->singleton(Editorial::class); $this->app->singleton(BackgroundTasks::class); $this->app->singleton(InstalledVersion::class); $this->app->singleton(UpdateProgress::class); @@ -55,6 +60,9 @@ class AppServiceProvider extends ServiceProvider { CoreWidgets::register($this->app->make(Widgets::class)); + $this->app->make(Navigation::class)->add('editorial', 'Redaktion', '/redaktion', active: ['editorial', 'pages.editor', 'news.editor.*'], sort: 85, + visible: fn (User $user) => $this->app->make(Editorial::class)->visibleFor($user)); + // N+1-Abfragen in Entwicklung und Tests sofort sichtbar machen (docs/PLAN.md, Performance). Model::preventLazyLoading(! $this->app->isProduction()); diff --git a/app/Support/Abilities.php b/app/Support/Abilities.php index 725d43b6..d6685b32 100644 --- a/app/Support/Abilities.php +++ b/app/Support/Abilities.php @@ -14,7 +14,7 @@ class Abilities /** @var array */ private array $abilities = []; - /** @var array */ + /** @var array */ private array $resourceTypes = []; public function __construct() @@ -36,11 +36,20 @@ class Abilities /** * Objekttyp, auf den sich Rechte beziehen können (z. B. „news_category“). * + * Hierarchische Typen (z. B. Seiten) geben $descendants an: Rechte mit + * „inkl. Unterobjekten“ gelten dann auch für alle Nachfahren. + * * @param callable(): array $options ID => Bezeichnung + * @param (callable(list): list)|null $descendants IDs => IDs aller Nachfahren */ - public function resourceType(string $type, string $label, callable $options): void + public function resourceType(string $type, string $label, callable $options, ?callable $descendants = null): void { - $this->resourceTypes[$type] = ['label' => $label, 'options' => $options]; + $this->resourceTypes[$type] = ['label' => $label, 'options' => $options, 'descendants' => $descendants]; + } + + public function isHierarchical(?string $type): bool + { + return $type !== null && isset($this->resourceTypes[$type]['descendants']); } /** @@ -68,7 +77,7 @@ class Abilities } /** - * @return array + * @return array */ public function resourceTypes(): array { diff --git a/app/Support/Images.php b/app/Support/Images.php index f7a07310..ce33c6c2 100644 --- a/app/Support/Images.php +++ b/app/Support/Images.php @@ -2,7 +2,9 @@ namespace App\Support; +use Illuminate\Http\UploadedFile; use Illuminate\Support\Facades\Storage; +use Illuminate\Support\Str; use Intervention\Image\Drivers\Gd\Driver; use Intervention\Image\Encoders\WebpEncoder; use Intervention\Image\ImageManager; @@ -46,6 +48,31 @@ class Images } } + /** + * Bild für Inhalte (Pagebuilder, Beiträge): Seitenverhältnis bleibt, höchstens + * 2000 Pixel breit, als WebP. GIFs bleiben unverändert (Animationen). + * + * @return string Pfad im Speicher „uploads“ + */ + public function storeContentImage(UploadedFile $file, string $directory): string + { + $disk = Storage::disk('uploads'); + $name = $directory.'/'.now()->format('Y/m').'/'.Str::random(24); + + if ($file->getMimeType() === 'image/gif') { + $disk->putFileAs(dirname($name), $file, basename($name).'.gif'); + + return $name.'.gif'; + } + + self::raiseMemoryLimitFor($file->getRealPath()); + $image = ImageManager::usingDriver(Driver::class)->decodePath($file->getRealPath()); + $image->scaleDown(width: 2000); + $disk->put($name.'.webp', $image->encode(new WebpEncoder(quality: 84))->toString()); + + return $name.'.webp'; + } + public function deleteWithVariants(?string $path): void { if (! $path) { diff --git a/app/Support/Navigation.php b/app/Support/Navigation.php index 5516d17c..f3de7f41 100644 --- a/app/Support/Navigation.php +++ b/app/Support/Navigation.php @@ -4,18 +4,28 @@ namespace App\Support; use App\Models\User; use App\Plugins\Hooks; +use Closure; use Illuminate\Http\Request; /** * Hauptnavigation des Portals als Registry: Kern und Plugins tragen Einträge ein. * * app(Navigation::class)->add('news', 'Neuigkeiten', '/neuigkeiten', active: 'news.*', sort: 20); + * + * Dynamische Einträge (z. B. Seiten aus dem Seitenbaum) liefert ein Provider: + * + * app(Navigation::class)->provider('pages', fn (Request $request, ?User $user) => [ + * ['key' => 'page-3', 'label' => 'MAV', 'href' => '/seiten/mav', 'active' => true, 'sort' => 40], + * ]); */ class Navigation { - /** @var array, sort: int, ability: string|null}> */ + /** @var array, sort: int, ability: string|null, visible: Closure|null}> */ private array $items = []; + /** @var array */ + private array $providers = []; + public function __construct() { $this->add('home', 'Startseite', '/', active: 'dashboard', sort: 0); @@ -24,15 +34,24 @@ class Navigation /** * @param string|list $active Routennamen (mit *), bei denen der Eintrag aktiv ist + * @param (Closure(User): bool)|null $visible zusätzliche Bedingung je Person */ - public function add(string $key, string $label, string $href, string|array $active = [], int $sort = 50, ?string $ability = null): void + public function add(string $key, string $label, string $href, string|array $active = [], int $sort = 50, ?string $ability = null, ?Closure $visible = null): void { - $this->items[$key] = ['label' => $label, 'href' => $href, 'active' => (array) $active, 'sort' => $sort, 'ability' => $ability]; + $this->items[$key] = ['label' => $label, 'href' => $href, 'active' => (array) $active, 'sort' => $sort, 'ability' => $ability, 'visible' => $visible]; } public function remove(string $key): void { - unset($this->items[$key]); + unset($this->items[$key], $this->providers[$key]); + } + + /** + * @param Closure(Request, User|null): list $items + */ + public function provider(string $key, Closure $items): void + { + $this->providers[$key] = $items; } /** @@ -42,13 +61,21 @@ class Navigation { $items = collect($this->items) ->filter(fn (array $item) => $item['ability'] === null || ($user?->can($item['ability']) ?? false)) - ->sortBy('sort') + ->filter(fn (array $item) => $item['visible'] === null || ($user !== null && ($item['visible'])($user))) ->map(fn (array $item, string $key) => [ 'key' => $key, 'label' => $item['label'], 'href' => $item['href'], 'active' => $item['active'] !== [] && $request->routeIs(...$item['active']), - ]) + 'sort' => $item['sort'], + ]); + + foreach ($this->providers as $provider) { + $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']]) ->values() ->all(); diff --git a/app/Support/Permissions/Audiences.php b/app/Support/Permissions/Audiences.php index ebbdf5cc..9f4649af 100644 --- a/app/Support/Permissions/Audiences.php +++ b/app/Support/Permissions/Audiences.php @@ -76,6 +76,47 @@ class Audiences return $rules; } + /** + * Alle Regeln eines Typs auf einmal – für gecachte Strukturen wie den Seitenbaum. + * + * @return array, department: list, location: list}> ID => Regeln + */ + public static function allOfType(string $type): array + { + $result = []; + + foreach (Audience::query()->where('resource_type', $type)->get(['resource_id', 'rule_type', 'rule_value']) as $audience) { + $result[$audience->resource_id] ??= ['role' => [], 'department' => [], 'location' => []]; + $result[$audience->resource_id][$audience->rule_type][] = $audience->rule_value; + } + + return $result; + } + + /** + * Dieselbe Prüfung wie constrain()/allows(), aber in PHP auf bereits geladenen Regeln. + * + * @param array{role?: list, department?: list, location?: list}|null $rules + */ + public static function matches(?array $rules, ?User $user): bool + { + $rules = array_filter((array) $rules); + + if ($rules === []) { + return true; + } + + if ($user === null) { + return false; + } + + $roleIds = array_map('strval', $user->permissions()->roleIds); + + return array_intersect(array_map('strval', $rules['role'] ?? []), $roleIds) !== [] + || (filled($user->department) && in_array($user->department, $rules['department'] ?? [], true)) + || (filled($user->location) && in_array($user->location, $rules['location'] ?? [], true)); + } + private static function matching(QueryBuilder $rules, User $user): void { $roleIds = array_map('strval', $user->permissions()->roleIds); diff --git a/app/Support/Permissions/Permissions.php b/app/Support/Permissions/Permissions.php index 835b0721..61bcf88b 100644 --- a/app/Support/Permissions/Permissions.php +++ b/app/Support/Permissions/Permissions.php @@ -4,6 +4,7 @@ namespace App\Support\Permissions; use App\Models\Grant; use App\Models\User; +use App\Support\Abilities; use Illuminate\Support\Facades\Cache; use Illuminate\Support\Facades\DB; @@ -48,14 +49,33 @@ class Permissions $roleIds = DB::table('role_user')->where('user_id', $user->id)->distinct()->pluck('role_id')->map(fn ($id) => (int) $id)->all(); $global = []; $objects = []; + $inherited = []; - foreach (Grant::query()->whereIn('role_id', $roleIds)->get(['ability', 'resource_type', 'resource_id']) as $grant) { + foreach (Grant::query()->whereIn('role_id', $roleIds)->get(['ability', 'resource_type', 'resource_id', 'include_children']) as $grant) { if ($grant->resource_type === null) { $global[$grant->ability] = true; } elseif ($grant->resource_id === null) { $objects[$grant->ability][$grant->resource_type] = true; } elseif (($objects[$grant->ability][$grant->resource_type] ?? null) !== true) { $objects[$grant->ability][$grant->resource_type][] = $grant->resource_id; + + if ($grant->include_children) { + $inherited[$grant->resource_type][$grant->ability][] = $grant->resource_id; + } + } + } + + // „Inkl. Unterobjekten“: Nachfahren einmalig auflösen – die Prüfung bleibt ein Array-Zugriff. + // Hierarchische Typen leeren den Rechte-Cache, wenn sich ihr Baum ändert. + $types = app(Abilities::class)->resourceTypes(); + + foreach ($inherited as $type => $byAbility) { + $descendants = $types[$type]['descendants'] ?? null; + + foreach ($descendants ? $byAbility : [] as $ability => $ids) { + if (is_array($objects[$ability][$type] ?? null)) { + $objects[$ability][$type] = array_merge($objects[$ability][$type], array_map('intval', $descendants($ids))); + } } } diff --git a/app/Support/RichText.php b/app/Support/RichText.php index 96442a04..4364832b 100644 --- a/app/Support/RichText.php +++ b/app/Support/RichText.php @@ -25,6 +25,14 @@ class RichText return $this->sanitizer()->sanitize($html); } + /** + * HTML aus dem Portal-Editor (TipTap) bereinigen. + */ + public function sanitize(?string $html): string + { + return blank($html) ? '' : $this->sanitizer()->sanitize((string) $html); + } + public function readingMinutes(?string $html): int { $words = str_word_count(strip_tags((string) $html), 0, 'ÄÖÜäöüß'); diff --git a/app/Version.php b/app/Version.php index 8f03fa0e..c7787881 100644 --- a/app/Version.php +++ b/app/Version.php @@ -9,5 +9,5 @@ namespace App; */ final class Version { - public const VERSION = '0.4.0'; + public const VERSION = '0.5.0'; } diff --git a/docs/PLAN.md b/docs/PLAN.md index 1aeecc14..819ac9ea 100644 --- a/docs/PLAN.md +++ b/docs/PLAN.md @@ -481,7 +481,7 @@ Kantinenplan, Ideenbox, Urlaubsanträge. | **1 – Betrieb & Lizenz** ✅ | **Self-Updater** (inkl. Wartungsmodus, Auto-Migration, Kanäle), **Lizenz-Speicher & -Client** (rotierendes Token), Seite „Aktualisierung“, **Rückmeldungen**, Web-Installer, Site Health, Cron-Varianten | | **2 – Plugin-System & Rechte** ✅ | Plugin-Loader, Hooks/Filter, Registries, Recovery-Modus, Import-Map-Frontend; Rollen, Grants, Zielgruppen, Rechte-Cache, Rechte-Prüfer | | **3 – Entra ID** ✅ | OIDC-Login, JIT, Gruppen-/App-Rollen-Mapping (additiv), Graph-Profil- & Foto-Sync mit frei zuordenbaren Attributen (inkl. Erweiterungsattributen) und eigenen Profilfeldern, Delta-Sync | -| **4 – CMS** | Seitenbaum, Pagebuilder, Versionen; News-Freigabe-Workflow und Redaktion im Portal | +| **4 – CMS** ✅ | Seitenbaum, Pagebuilder (Layout-, Inhalts-, Medien- und dynamische Blöcke, Sichtbarkeit je Block), Entwürfe, Versionen, Zeitsteuerung, Bearbeitungssperre, Freigaben; News-Freigabe-Workflow und Redaktion im Portal; Benachrichtigungen. Offen: Vorlagen und wiederverwendbare Blöcke | | **5 – Branding & Theming** | Vollständige Seite „Erscheinungsbild“: Logo-Varianten, Farben inkl. Farbtreue & Kontrastprüfung, Schriften, Form, Login-Seite, E-Mails, Live-Vorschau, Entwurf/Veröffentlichen, Export/Import | | **6 – Weitere Plugins & IdPs** | Verzeichnis/Organigramm, Dokumente, Events …; OIDC generisch, LDAP, SAML; Lasttests 5.000 User | | **7 – Plugin-SDK öffentlich** | Doku, Generator, Beispiel-Plugins (kein Plugin-Verzeichnis) | diff --git a/docs/PLUGINS.md b/docs/PLUGINS.md index bb269368..f9bab006 100644 --- a/docs/PLUGINS.md +++ b/docs/PLUGINS.md @@ -84,9 +84,45 @@ class Plugin extends BasePlugin `permissionResource()`. - Zielgruppen: `App\Support\Permissions\Audiences::constrain($query, 'mein_typ', 'tabelle.id', $user)` und im Admin-Formular `App\Filament\Components\AudienceSection::make('mein_typ')`. +- Hierarchische Objekttypen (z. B. Seiten): `resourceType(..., descendants: fn (array $ids) => [...])`. + Rechte mit „inkl. Unterobjekten“ gelten dann auch für alle Nachfahren; ändert sich + der Baum, `App\Support\Permissions\Permissions::flush()` aufrufen. - Admin-Seiten: Policies registrieren (`Gate::policy(Model::class, Policy::class)`) bzw. `canAccess()` an Filament-Seiten. +## Pagebuilder-Blöcke + +Eigene Blöcke erscheinen im Pagebuilder mit Formular und Absicherung – aus der +Feldbeschreibung erzeugt: + +```php +use App\Pagebuilder\{Blocks, BlockType, Field}; + +$this->app->make(Blocks::class)->add(BlockType::make('mein-plugin.liste', 'Meine Liste', 'list-checks', 'dynamic', 'mein-plugin::Liste') + ->fields([ + Field::text('title', 'Überschrift', 150), + Field::number('count', 'Anzahl', 1, 20, 5), + Field::select('layout', 'Darstellung', ['list' => 'Liste', 'cards' => 'Kacheln'], 'list'), + ]) + ->resolveUsing(fn (array $data, ?User $user, array $context) => ['items' => /* für $user sichtbare Einträge */ []])); +``` + +- Feldtypen: `text`, `textarea`, `html`, `select`, `toggle`, `number`, `url`, + `image`, `people`, `table`, `icon`, `repeater`, `ids`. Unbekannte Felder und + Blöcke verwirft der Kern beim Speichern; HTML und Adressen werden bereinigt. +- `resolveUsing` liefert die Daten zur Anzeige (bei jedem Aufruf, je Person). + `null` blendet den Block aus; Fehler blenden nur diesen Block aus. +- Container-Blöcke: `->container(min, max, titled: true, label: 'Tab')`. +- Die Vue-Komponente erhält `block` (`data`, `items`, `props`) – Kinder werden mit + `inject('pagebuilder:list')` gerendert. `inject('pagebuilder:editing')` ist im Editor wahr. + +## Redaktion, Navigation und Benachrichtigungen + +- Arbeitslisten im Bereich „Redaktion“: `app(App\Editorial\Editorial::class)->add($key, $label, 'mein-plugin::Liste', $sort, $sichtbar, $props)`. +- 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))`. + ## Installation und Betrieb - Als ZIP unter **Administration → Plugins** hochladen (ein gemeinsamer diff --git a/package-lock.json b/package-lock.json index bd9d08d5..450b85e3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,6 +10,11 @@ "@lucide/vue": "^1.48.0", "@tailwindcss/typography": "^0.5.20", "@tailwindcss/vite": "^4.3.3", + "@tiptap/extension-image": "^3.31.3", + "@tiptap/extensions": "^3.31.3", + "@tiptap/pm": "^3.31.3", + "@tiptap/starter-kit": "^3.31.3", + "@tiptap/vue-3": "^3.31.3", "@vitejs/plugin-vue": "^6.0.9", "@vueuse/core": "^15.0.0", "class-variance-authority": "^0.7.1", @@ -22,6 +27,7 @@ "typescript": "^5.9.3", "vite": "^8.3.1", "vue": "^3.5.43", + "vue-draggable-plus": "^0.6.1", "vue-sonner": "^2.0.9" } }, @@ -1165,6 +1171,478 @@ "vue": "^2.7.0 || ^3.0.0" } }, + "node_modules/@tiptap/core": { + "version": "3.31.3", + "resolved": "https://registry.npmjs.org/@tiptap/core/-/core-3.31.3.tgz", + "integrity": "sha512-Cz50pvciQrxdSxgTkHOVz0uD0Yl/8Xt0QatGD6ILm47jW8EzyHR9RkUGs/D5IqzXKuVPntfw1ttaT926vXfiRg==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/pm": "3.31.3" + } + }, + "node_modules/@tiptap/extension-blockquote": { + "version": "3.31.3", + "resolved": "https://registry.npmjs.org/@tiptap/extension-blockquote/-/extension-blockquote-3.31.3.tgz", + "integrity": "sha512-fyY2XMbyDDDfOTQ1Qdrnqa1qwC9DWE4n7AfE0EKQI0G8MfLV8RaDlLDcOZDJ9JbMPY7/Gx7EjyK4NKxSW9n2hQ==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "3.31.3", + "@tiptap/pm": "3.31.3" + } + }, + "node_modules/@tiptap/extension-bold": { + "version": "3.31.3", + "resolved": "https://registry.npmjs.org/@tiptap/extension-bold/-/extension-bold-3.31.3.tgz", + "integrity": "sha512-dIuYhKk8TitKU/FeDpoTeWZhU42YgDN5npgWNjAmMmRktPdoxnH3/wGSiwXlqZgJWjehN7kPWDePWpJeAImGpQ==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "3.31.3" + } + }, + "node_modules/@tiptap/extension-bubble-menu": { + "version": "3.31.3", + "resolved": "https://registry.npmjs.org/@tiptap/extension-bubble-menu/-/extension-bubble-menu-3.31.3.tgz", + "integrity": "sha512-EV6ZnwKc++2OM/OcD54n8s1B7C9LP7GKAtdEPwu0t3BYJf3sG8Ueoinf7SgGPO9oMPg96GneOkDNm1urMV167g==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@floating-ui/dom": "^1.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "3.31.3", + "@tiptap/pm": "3.31.3" + } + }, + "node_modules/@tiptap/extension-bullet-list": { + "version": "3.31.3", + "resolved": "https://registry.npmjs.org/@tiptap/extension-bullet-list/-/extension-bullet-list-3.31.3.tgz", + "integrity": "sha512-qEyyoPapPef4LO8XKaN83bxtaNzkJ4kFn/IxLnEKd4BJ3Mvi4MH2yJYlyDqwFnMoev4pMA1zBHRAt/C0THRmZw==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/extension-list": "3.31.3" + } + }, + "node_modules/@tiptap/extension-code": { + "version": "3.31.3", + "resolved": "https://registry.npmjs.org/@tiptap/extension-code/-/extension-code-3.31.3.tgz", + "integrity": "sha512-SzxOqchrD2AcN3uT67PjKmRFEMOU3vNNiwNaamZJUbZrI6Hmy+bvdHJrc3jrIddyyCrAtsnAfRI0cmorW1jGfg==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "3.31.3" + } + }, + "node_modules/@tiptap/extension-code-block": { + "version": "3.31.3", + "resolved": "https://registry.npmjs.org/@tiptap/extension-code-block/-/extension-code-block-3.31.3.tgz", + "integrity": "sha512-nvknt4FhyJQjYcvxptmeUlFsIAc8ibua3E5BN4Pim374/9RWepH4cdE9X0/qUTtguHElLx0iKtSIY3rW2qGTFA==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "3.31.3", + "@tiptap/pm": "3.31.3" + } + }, + "node_modules/@tiptap/extension-document": { + "version": "3.31.3", + "resolved": "https://registry.npmjs.org/@tiptap/extension-document/-/extension-document-3.31.3.tgz", + "integrity": "sha512-EexgmqnyDNyGlISxo7SMrp5MygpJYmqD+0cY5jB6L1U6L4CpKKRWUt8OO1sWzEHDE1+TTvwt+WIFoIWAziOtEA==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "3.31.3" + } + }, + "node_modules/@tiptap/extension-dropcursor": { + "version": "3.31.3", + "resolved": "https://registry.npmjs.org/@tiptap/extension-dropcursor/-/extension-dropcursor-3.31.3.tgz", + "integrity": "sha512-NWomSfu5CSC7VacnMSDzKT8qm66SzMfZwVPEtwY5bPpRTJgTiT1rNK0neDrrzfMN27MfylGyKWWf7Q5Qf8w/fg==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/extensions": "3.31.3" + } + }, + "node_modules/@tiptap/extension-floating-menu": { + "version": "3.31.3", + "resolved": "https://registry.npmjs.org/@tiptap/extension-floating-menu/-/extension-floating-menu-3.31.3.tgz", + "integrity": "sha512-rd4VJ9PGSP9Eop8ZTEwaLZcMzMXLuJKe3hUNf58rq+zANpwM+9fI+vB7g9MAc3eXwUNDxNDVACFIL2oeBqpQ3A==", + "dev": true, + "license": "MIT", + "optional": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@floating-ui/dom": "^1.0.0", + "@tiptap/core": "3.31.3", + "@tiptap/pm": "3.31.3" + } + }, + "node_modules/@tiptap/extension-gapcursor": { + "version": "3.31.3", + "resolved": "https://registry.npmjs.org/@tiptap/extension-gapcursor/-/extension-gapcursor-3.31.3.tgz", + "integrity": "sha512-EBXKb1FrVStsNYCcRGtd9jmzveCvR+eqgg1rVqoONrqFK6U7bga6LN+1dMKroP1kliDVgveYkP3vRYxqw+rFqg==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/extensions": "3.31.3" + } + }, + "node_modules/@tiptap/extension-hard-break": { + "version": "3.31.3", + "resolved": "https://registry.npmjs.org/@tiptap/extension-hard-break/-/extension-hard-break-3.31.3.tgz", + "integrity": "sha512-QAdCvNO4+yW9ATwsrej11NTkDYFqPLIEQr3ARNrKOK1qaiS7A0fia2SEukb/hrkP3A6mbozhoQt2r2RGUf/DpQ==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "3.31.3" + } + }, + "node_modules/@tiptap/extension-heading": { + "version": "3.31.3", + "resolved": "https://registry.npmjs.org/@tiptap/extension-heading/-/extension-heading-3.31.3.tgz", + "integrity": "sha512-rk5VHMAeQcg06SLauN6EGdD2jc0O2qY8QkZYPd0LxNvLblw2BxBx+lxUQSYwLAT9Ie5914gKIK2YbRyO2Ts3ig==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "3.31.3" + } + }, + "node_modules/@tiptap/extension-horizontal-rule": { + "version": "3.31.3", + "resolved": "https://registry.npmjs.org/@tiptap/extension-horizontal-rule/-/extension-horizontal-rule-3.31.3.tgz", + "integrity": "sha512-YnHGy2KShRwvCseAmmxl9VP7R0qaj8QMp3DA6DJWZqp7r5gLGvDkAqhedxqqefqsE4Y43hjkBdjtB9Ce78LkIw==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "3.31.3", + "@tiptap/pm": "3.31.3" + } + }, + "node_modules/@tiptap/extension-image": { + "version": "3.31.3", + "resolved": "https://registry.npmjs.org/@tiptap/extension-image/-/extension-image-3.31.3.tgz", + "integrity": "sha512-wWNG9BOtx2Cg4vwxPVGDIJ5DGX+ETkldeoaFJLB1NXUL4OPUiVTf8cHZ+hdYgJWP704BEB7jQgjlpvdi6VigTg==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "3.31.3" + } + }, + "node_modules/@tiptap/extension-italic": { + "version": "3.31.3", + "resolved": "https://registry.npmjs.org/@tiptap/extension-italic/-/extension-italic-3.31.3.tgz", + "integrity": "sha512-ibGvdvAPyfxBMUVNRI43eb9h2/Jka1MRG5GtnGqbcCX/2+Y/y0EOfFrPQPkuYphiWQYyu9+FzPKMB/pjuaLuKQ==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "3.31.3" + } + }, + "node_modules/@tiptap/extension-link": { + "version": "3.31.3", + "resolved": "https://registry.npmjs.org/@tiptap/extension-link/-/extension-link-3.31.3.tgz", + "integrity": "sha512-986wOQzTL9Zr5lf84LCLpm+YOms8A0K39/8DVoqRfebqcOe0/eq4bnztmAlfabOd+kJY92g3AgZERFUx/w+dcw==", + "dev": true, + "license": "MIT", + "dependencies": { + "linkifyjs": "^4.3.3" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "3.31.3", + "@tiptap/pm": "3.31.3" + } + }, + "node_modules/@tiptap/extension-list": { + "version": "3.31.3", + "resolved": "https://registry.npmjs.org/@tiptap/extension-list/-/extension-list-3.31.3.tgz", + "integrity": "sha512-LoveGnC0FVdCV4jUNBaG1ZA+KWE07+adzV3kGy6uUYFcJEjbVUHTnPDrBOob3IwOSO3sCwIkvQb6EVYeXn/4yg==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "3.31.3", + "@tiptap/pm": "3.31.3" + } + }, + "node_modules/@tiptap/extension-list-item": { + "version": "3.31.3", + "resolved": "https://registry.npmjs.org/@tiptap/extension-list-item/-/extension-list-item-3.31.3.tgz", + "integrity": "sha512-4QlKOriJJMvg95QJTEsy9BUYPBQ6UvJyb8WURRwdUtQUkkqb8h32lg/eyQUv2FzW9IT1AdUyNZfVaxH64kRfQA==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/extension-list": "3.31.3" + } + }, + "node_modules/@tiptap/extension-list-keymap": { + "version": "3.31.3", + "resolved": "https://registry.npmjs.org/@tiptap/extension-list-keymap/-/extension-list-keymap-3.31.3.tgz", + "integrity": "sha512-If8UOEdDZbPJU6iYTvLtH6DOp2KBy6BKxg9UELL1AevVetGHEF/7lW8hP50Gn1tHMVpPRqmhSzVrJRpEJJgb/Q==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/extension-list": "3.31.3" + } + }, + "node_modules/@tiptap/extension-ordered-list": { + "version": "3.31.3", + "resolved": "https://registry.npmjs.org/@tiptap/extension-ordered-list/-/extension-ordered-list-3.31.3.tgz", + "integrity": "sha512-mp3g11NgA/PYu8rj7J7Ez3l4qBy6WfTSmHIG4PZvEGG5w2oUAIkgb9DU7nPPzjmeme27oazFYZw+AtZA0+u4tw==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/extension-list": "3.31.3" + } + }, + "node_modules/@tiptap/extension-paragraph": { + "version": "3.31.3", + "resolved": "https://registry.npmjs.org/@tiptap/extension-paragraph/-/extension-paragraph-3.31.3.tgz", + "integrity": "sha512-+iPku7wJfy5hbNDNLX8dveFtYVsZMmh7vztjuq8hT3mipSC4IByDehDbU8fzUCjfXiEzmI7mQn7c8LGmHULuzA==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "3.31.3" + } + }, + "node_modules/@tiptap/extension-strike": { + "version": "3.31.3", + "resolved": "https://registry.npmjs.org/@tiptap/extension-strike/-/extension-strike-3.31.3.tgz", + "integrity": "sha512-G29bhKttYwcKHT+BI6emWVFol3RO/gUXxQVcmr/iT8LXXy7j8J6HFUnsKM+Kg5YlP1rxMRgsa65dbrQVahZi0A==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "3.31.3" + } + }, + "node_modules/@tiptap/extension-text": { + "version": "3.31.3", + "resolved": "https://registry.npmjs.org/@tiptap/extension-text/-/extension-text-3.31.3.tgz", + "integrity": "sha512-gdsWtF+taeaCu6V+5Ct10fGo0ACUy1GnYtbb+mcathBt8OqbT+Ws60p/yEmKesBDz2Hn+B5IcWy6+2BBZl5ZTg==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "3.31.3" + } + }, + "node_modules/@tiptap/extension-underline": { + "version": "3.31.3", + "resolved": "https://registry.npmjs.org/@tiptap/extension-underline/-/extension-underline-3.31.3.tgz", + "integrity": "sha512-HghdJaOwRqYzsAxqSyNyb+IWyOMcdCl8IoiBETA9BZCJAqdXzFLcuWp7CqCqJPam9dgkWosSoHqTCAO4nTBfpw==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "3.31.3" + } + }, + "node_modules/@tiptap/extensions": { + "version": "3.31.3", + "resolved": "https://registry.npmjs.org/@tiptap/extensions/-/extensions-3.31.3.tgz", + "integrity": "sha512-8sJNPGGUe8f3aDojcOW5cfVL7I5NrBbE0UWxG08qoi9Tea6qWbvQJsCR9tsrOapr/DaLr3kpbGZ9s1gEEfcNcA==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "3.31.3", + "@tiptap/pm": "3.31.3" + } + }, + "node_modules/@tiptap/pm": { + "version": "3.31.3", + "resolved": "https://registry.npmjs.org/@tiptap/pm/-/pm-3.31.3.tgz", + "integrity": "sha512-sZime0SWsz/k62W2WvHx5Ig7G2h7kVhrrmnqy+wEgIHfDwEfOlelRjaWCiBCFlF7dxGUntJusCh9FxlLhni0Ag==", + "dev": true, + "license": "MIT", + "dependencies": { + "prosemirror-changeset": "^2.4.1", + "prosemirror-commands": "^1.7.1", + "prosemirror-dropcursor": "^1.8.2", + "prosemirror-gapcursor": "^1.4.1", + "prosemirror-history": "^1.5.0", + "prosemirror-inputrules": "^1.5.1", + "prosemirror-keymap": "^1.2.3", + "prosemirror-model": "^1.25.11", + "prosemirror-schema-list": "^1.5.1", + "prosemirror-state": "^1.4.4", + "prosemirror-tables": "^1.8.5", + "prosemirror-transform": "^1.12.0", + "prosemirror-view": "^1.42.3" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + } + }, + "node_modules/@tiptap/starter-kit": { + "version": "3.31.3", + "resolved": "https://registry.npmjs.org/@tiptap/starter-kit/-/starter-kit-3.31.3.tgz", + "integrity": "sha512-WKof9RewdmGHvWJ1wn0/HVNG2mV+HOgVRyJkKekuM9fgr6BZAAH/xZsWE1eon+94JnQ+KtK2ThydXQM/qc6b2A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@tiptap/core": "3.31.3", + "@tiptap/extension-blockquote": "3.31.3", + "@tiptap/extension-bold": "3.31.3", + "@tiptap/extension-bullet-list": "3.31.3", + "@tiptap/extension-code": "3.31.3", + "@tiptap/extension-code-block": "3.31.3", + "@tiptap/extension-document": "3.31.3", + "@tiptap/extension-dropcursor": "3.31.3", + "@tiptap/extension-gapcursor": "3.31.3", + "@tiptap/extension-hard-break": "3.31.3", + "@tiptap/extension-heading": "3.31.3", + "@tiptap/extension-horizontal-rule": "3.31.3", + "@tiptap/extension-italic": "3.31.3", + "@tiptap/extension-link": "3.31.3", + "@tiptap/extension-list": "3.31.3", + "@tiptap/extension-list-item": "3.31.3", + "@tiptap/extension-list-keymap": "3.31.3", + "@tiptap/extension-ordered-list": "3.31.3", + "@tiptap/extension-paragraph": "3.31.3", + "@tiptap/extension-strike": "3.31.3", + "@tiptap/extension-text": "3.31.3", + "@tiptap/extension-underline": "3.31.3", + "@tiptap/extensions": "3.31.3", + "@tiptap/pm": "3.31.3" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + } + }, + "node_modules/@tiptap/vue-3": { + "version": "3.31.3", + "resolved": "https://registry.npmjs.org/@tiptap/vue-3/-/vue-3-3.31.3.tgz", + "integrity": "sha512-PNt0+rm7BXzhe/U+xlNnXBeJ6t9x2mE3902VXeIeEBxu5CrYLCJ0a5yHrof1jU3KwJrLOe/BtlGWjbq4qnTTfQ==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "optionalDependencies": { + "@tiptap/extension-bubble-menu": "^3.31.3", + "@tiptap/extension-floating-menu": "^3.31.3" + }, + "peerDependencies": { + "@floating-ui/dom": "^1.0.0", + "@tiptap/core": "3.31.3", + "@tiptap/pm": "3.31.3", + "vue": "^3.0.0" + } + }, + "node_modules/@types/sortablejs": { + "version": "1.15.9", + "resolved": "https://registry.npmjs.org/@types/sortablejs/-/sortablejs-1.15.9.tgz", + "integrity": "sha512-7HP+rZGE2p886PKV9c9OJzLBI6BBJu1O7lJGYnPyG3fS4/duUCcngkNCjsLwIMV+WMqANe3tt4irrXHSIe68OQ==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/web-bluetooth": { "version": "0.0.21", "resolved": "https://registry.npmjs.org/@types/web-bluetooth/-/web-bluetooth-0.0.21.tgz", @@ -1834,6 +2312,13 @@ "url": "https://opencollective.com/parcel" } }, + "node_modules/linkifyjs": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/linkifyjs/-/linkifyjs-4.3.3.tgz", + "integrity": "sha512-P8aEP5U/D1/IlTY2OeYsErdwh9bGuLE30NcXtKEjgdHcahveQoQwM2yZNsioQHsWFz0P7KKudisbrzCgR0sDHg==", + "dev": true, + "license": "MIT" + }, "node_modules/magic-string": { "version": "0.30.21", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", @@ -1870,6 +2355,13 @@ "dev": true, "license": "MIT" }, + "node_modules/orderedmap": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/orderedmap/-/orderedmap-2.1.1.tgz", + "integrity": "sha512-TvAWxi0nDe1j/rtMcWcIj94+Ffe6n7zhow33h40SKxmsmozs6dz/e+EajymfoFcHd7sxNn8yHM8839uixMOV6g==", + "dev": true, + "license": "MIT" + }, "node_modules/picocolors": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", @@ -1933,6 +2425,158 @@ "node": ">=4" } }, + "node_modules/prosemirror-changeset": { + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/prosemirror-changeset/-/prosemirror-changeset-2.4.4.tgz", + "integrity": "sha512-Gyuz9jYdrAeA9I7AholyOes9KUmv/lEwsC5O9s5xF5VB3EgTPsXMGUxz4+H1B+wKVPdZbvRcg1Cp3x8qX+8ofA==", + "dev": true, + "license": "MIT", + "dependencies": { + "prosemirror-transform": "^1.0.0" + } + }, + "node_modules/prosemirror-commands": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/prosemirror-commands/-/prosemirror-commands-1.7.2.tgz", + "integrity": "sha512-q6Q6szxqdu9Xd6EcdKsqXghu5nQdZTpB4Q9yd04WRc7/jt763e/rT60Owh0L1GYY+T46o5rD+9lEN36dZS43tw==", + "dev": true, + "license": "MIT", + "dependencies": { + "prosemirror-model": "^1.0.0", + "prosemirror-state": "^1.0.0", + "prosemirror-transform": "^1.10.2" + } + }, + "node_modules/prosemirror-dropcursor": { + "version": "1.8.4", + "resolved": "https://registry.npmjs.org/prosemirror-dropcursor/-/prosemirror-dropcursor-1.8.4.tgz", + "integrity": "sha512-VmKxhcA6a+h5oPSYmfF1ZNeQqPbyYaIxqZsKqeYCyTlPtrjUgNaHL3P8vVaO19oqAV0zuaM/axkowZHrB1P3Tg==", + "dev": true, + "license": "MIT", + "dependencies": { + "prosemirror-state": "^1.0.0", + "prosemirror-transform": "^1.1.0", + "prosemirror-view": "^1.1.0" + } + }, + "node_modules/prosemirror-gapcursor": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/prosemirror-gapcursor/-/prosemirror-gapcursor-1.4.1.tgz", + "integrity": "sha512-pMdYaEnjNMSwl11yjEGtgTmLkR08m/Vl+Jj443167p9eB3HVQKhYCc4gmHVDsLPODfZfjr/MmirsdyZziXbQKw==", + "dev": true, + "license": "MIT", + "dependencies": { + "prosemirror-keymap": "^1.0.0", + "prosemirror-model": "^1.0.0", + "prosemirror-state": "^1.0.0", + "prosemirror-view": "^1.0.0" + } + }, + "node_modules/prosemirror-history": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/prosemirror-history/-/prosemirror-history-1.5.0.tgz", + "integrity": "sha512-zlzTiH01eKA55UAf1MEjtssJeHnGxO0j4K4Dpx+gnmX9n+SHNlDqI2oO1Kv1iPN5B1dm5fsljCfqKF9nFL6HRg==", + "dev": true, + "license": "MIT", + "dependencies": { + "prosemirror-state": "^1.2.2", + "prosemirror-transform": "^1.0.0", + "prosemirror-view": "^1.31.0", + "rope-sequence": "^1.3.0" + } + }, + "node_modules/prosemirror-inputrules": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/prosemirror-inputrules/-/prosemirror-inputrules-1.5.1.tgz", + "integrity": "sha512-7wj4uMjKaXWAQ1CDgxNzNtR9AlsuwzHfdFH1ygEHA2KHF2DOEaXl1CJfNPAKCg9qNEh4rum975QLaCiQPyY6Fw==", + "dev": true, + "license": "MIT", + "dependencies": { + "prosemirror-state": "^1.0.0", + "prosemirror-transform": "^1.0.0" + } + }, + "node_modules/prosemirror-keymap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/prosemirror-keymap/-/prosemirror-keymap-1.2.3.tgz", + "integrity": "sha512-4HucRlpiLd1IPQQXNqeo81BGtkY8Ai5smHhKW9jjPKRc2wQIxksg7Hl1tTI2IfT2B/LgX6bfYvXxEpJl7aKYKw==", + "dev": true, + "license": "MIT", + "dependencies": { + "prosemirror-state": "^1.0.0", + "w3c-keyname": "^2.2.0" + } + }, + "node_modules/prosemirror-model": { + "version": "1.25.12", + "resolved": "https://registry.npmjs.org/prosemirror-model/-/prosemirror-model-1.25.12.tgz", + "integrity": "sha512-Ue2gTmXMa7EhpLNhC7J+h4+ykD8ha12K6rrZFFKKJHBForfIStw5gJ6Zrf1mqqAa9NmpmEB4wp9bKmA4eUVjWg==", + "dev": true, + "license": "MIT", + "dependencies": { + "orderedmap": "^2.0.0" + } + }, + "node_modules/prosemirror-schema-list": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/prosemirror-schema-list/-/prosemirror-schema-list-1.5.1.tgz", + "integrity": "sha512-927lFx/uwyQaGwJxLWCZRkjXG0p48KpMj6ueoYiu4JX05GGuGcgzAy62dfiV8eFZftgyBUvLx76RsMe20fJl+Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "prosemirror-model": "^1.0.0", + "prosemirror-state": "^1.0.0", + "prosemirror-transform": "^1.7.3" + } + }, + "node_modules/prosemirror-state": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/prosemirror-state/-/prosemirror-state-1.4.4.tgz", + "integrity": "sha512-6jiYHH2CIGbCfnxdHbXZ12gySFY/fz/ulZE333G6bPqIZ4F+TXo9ifiR86nAHpWnfoNjOb3o5ESi7J8Uz1jXHw==", + "dev": true, + "license": "MIT", + "dependencies": { + "prosemirror-model": "^1.0.0", + "prosemirror-transform": "^1.0.0", + "prosemirror-view": "^1.27.0" + } + }, + "node_modules/prosemirror-tables": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/prosemirror-tables/-/prosemirror-tables-1.8.5.tgz", + "integrity": "sha512-V/0cDCsHKHe/tfWkeCmthNUcEp1IVO3p6vwN8XtwE9PZQLAZJigbw3QoraAdfJPir4NKJtNvOB8oYGKRl+t0Dw==", + "dev": true, + "license": "MIT", + "dependencies": { + "prosemirror-keymap": "^1.2.3", + "prosemirror-model": "^1.25.4", + "prosemirror-state": "^1.4.4", + "prosemirror-transform": "^1.10.5", + "prosemirror-view": "^1.41.4" + } + }, + "node_modules/prosemirror-transform": { + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/prosemirror-transform/-/prosemirror-transform-1.12.2.tgz", + "integrity": "sha512-PE/aY0HEY4zczvmqrilgkUK/WautF0chvMqkmM/iN5/aPHvwrCWaQZjS6CIZp+K84YrvPFqrL+YArrfJX8xX7g==", + "dev": true, + "license": "MIT", + "dependencies": { + "prosemirror-model": "^1.21.0" + } + }, + "node_modules/prosemirror-view": { + "version": "1.42.6", + "resolved": "https://registry.npmjs.org/prosemirror-view/-/prosemirror-view-1.42.6.tgz", + "integrity": "sha512-3g25f6hKV2bBxo3puH3EcYWmmVNSH0iWmNsMVT7sugDSpA025jgpOLarcDWr39SdzPjYMaiYtRdNtXialPSjEQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "prosemirror-model": "^1.25.12", + "prosemirror-state": "^1.0.0", + "prosemirror-transform": "^1.1.0" + } + }, "node_modules/reka-ui": { "version": "2.10.5", "resolved": "https://registry.npmjs.org/reka-ui/-/reka-ui-2.10.5.tgz", @@ -2034,6 +2678,13 @@ "@rolldown/binding-win32-x64-msvc": "1.2.11" } }, + "node_modules/rope-sequence": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/rope-sequence/-/rope-sequence-1.3.4.tgz", + "integrity": "sha512-UT5EDe2cu2E/6O4igUr5PSFs23nvvukicWHx6GnOPlHAiiYbzNuCRQCuiUdHJQcqKalLKlrYJnjY0ySGsXNQXQ==", + "dev": true, + "license": "MIT" + }, "node_modules/source-map-js": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", @@ -2255,6 +2906,24 @@ } } }, + "node_modules/vue-draggable-plus": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/vue-draggable-plus/-/vue-draggable-plus-0.6.1.tgz", + "integrity": "sha512-FbtQ/fuoixiOfTZzG3yoPl4JAo9HJXRHmBQZFB9x2NYCh6pq0TomHf7g5MUmpaDYv+LU2n6BPq2YN9sBO+FbIg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/sortablejs": "^1.15.8" + }, + "peerDependencies": { + "@types/sortablejs": "^1.15.0" + }, + "peerDependenciesMeta": { + "@vue/composition-api": { + "optional": true + } + } + }, "node_modules/vue-sonner": { "version": "2.0.9", "resolved": "https://registry.npmjs.org/vue-sonner/-/vue-sonner-2.0.9.tgz", @@ -2277,6 +2946,13 @@ "optional": true } } + }, + "node_modules/w3c-keyname": { + "version": "2.2.8", + "resolved": "https://registry.npmjs.org/w3c-keyname/-/w3c-keyname-2.2.8.tgz", + "integrity": "sha512-dpojBhNsCNN7T82Tm7k26A6G9ML3NkhDsnw9n/eoxSRlVBB4CEtIQ/KTCLI2Fwf3ataSXRhYFkQi3SlnFwPvPQ==", + "dev": true, + "license": "MIT" } } } diff --git a/package.json b/package.json index bbc24154..e4a1ba24 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,11 @@ "@lucide/vue": "^1.48.0", "@tailwindcss/typography": "^0.5.20", "@tailwindcss/vite": "^4.3.3", + "@tiptap/extension-image": "^3.31.3", + "@tiptap/extensions": "^3.31.3", + "@tiptap/pm": "^3.31.3", + "@tiptap/starter-kit": "^3.31.3", + "@tiptap/vue-3": "^3.31.3", "@vitejs/plugin-vue": "^6.0.9", "@vueuse/core": "^15.0.0", "class-variance-authority": "^0.7.1", @@ -24,6 +29,7 @@ "typescript": "^5.9.3", "vite": "^8.3.1", "vue": "^3.5.43", + "vue-draggable-plus": "^0.6.1", "vue-sonner": "^2.0.9" } } diff --git a/plugins-core/events/plugin.json b/plugins-core/events/plugin.json index f0143fc1..6bd9211d 100644 --- a/plugins-core/events/plugin.json +++ b/plugins-core/events/plugin.json @@ -1,13 +1,13 @@ { "slug": "events", "name": "Termine", - "version": "1.0.0", + "version": "1.1.0", "description": "Veranstaltungen und Fortbildungen mit Kalender-Export.", "author": "Inhaus", "namespace": "Inhaus\\Plugins\\Events\\", "class": "Inhaus\\Plugins\\Events\\EventsPlugin", "requires": { - "core": ">=0.3.0", + "core": ">=0.5.0", "php": ">=8.3" } } diff --git a/plugins-core/events/resources/js/blocks/UpcomingEvents.vue b/plugins-core/events/resources/js/blocks/UpcomingEvents.vue new file mode 100644 index 00000000..9bafd54c --- /dev/null +++ b/plugins-core/events/resources/js/blocks/UpcomingEvents.vue @@ -0,0 +1,20 @@ + + + diff --git a/plugins-core/events/src/EventsPlugin.php b/plugins-core/events/src/EventsPlugin.php index 27e9a81e..87dd9343 100644 --- a/plugins-core/events/src/EventsPlugin.php +++ b/plugins-core/events/src/EventsPlugin.php @@ -4,6 +4,9 @@ namespace Inhaus\Plugins\Events; use App\Dashboard\Widgets; use App\Models\User; +use App\Pagebuilder\Blocks; +use App\Pagebuilder\BlockType; +use App\Pagebuilder\Field; use App\Plugins\Plugin; use App\Support\Abilities; use App\Support\Navigation; @@ -23,5 +26,15 @@ class EventsPlugin extends Plugin $this->app->make(Widgets::class)->add('events.upcoming', 'events::Upcoming', 'aside', sort: 20, props: fn (User $user) => [ 'events' => EventResource::collection(Event::query()->upcoming()->visibleTo($user)->limit(4)->get())->resolve(), ], mobileSort: 30); + + $this->app->make(Blocks::class)->add(BlockType::make('events.upcoming', 'Termine', 'calendar-days', 'dynamic', 'events::UpcomingEvents') + ->description('Die nächsten Termine.') + ->fields([ + Field::text('title', 'Überschrift', 150, 'Termine'), + Field::number('count', 'Anzahl', 1, 12, 4), + ]) + ->resolveUsing(fn (array $data, ?User $user) => [ + 'events' => EventResource::collection(Event::query()->upcoming()->visibleTo($user)->limit($data['count'])->get())->resolve(), + ])); } } diff --git a/plugins-core/news/database/migrations/2026_09_27_000002_add_review_workflow_to_news_posts.php b/plugins-core/news/database/migrations/2026_09_27_000002_add_review_workflow_to_news_posts.php new file mode 100644 index 00000000..31c34d8c --- /dev/null +++ b/plugins-core/news/database/migrations/2026_09_27_000002_add_review_workflow_to_news_posts.php @@ -0,0 +1,35 @@ +string('status', 20)->default('draft')->after('is_featured'); + $table->timestamp('submitted_at')->nullable()->after('status'); + $table->foreignId('reviewed_by')->nullable()->after('submitted_at')->constrained('users')->nullOnDelete(); + $table->text('review_note')->nullable()->after('reviewed_by'); + + $table->index(['status', 'category_id']); + }); + + DB::table('news_posts')->whereNotNull('published_at')->update(['status' => 'published']); + } + + public function down(): void + { + Schema::table('news_posts', function (Blueprint $table) { + $table->dropIndex(['status', 'category_id']); + $table->dropConstrainedForeignId('reviewed_by'); + $table->dropColumn(['status', 'submitted_at', 'review_note']); + }); + } +}; diff --git a/plugins-core/news/plugin.json b/plugins-core/news/plugin.json index 0d14e137..4b06d245 100644 --- a/plugins-core/news/plugin.json +++ b/plugins-core/news/plugin.json @@ -1,13 +1,13 @@ { "slug": "news", "name": "Neuigkeiten", - "version": "1.0.0", + "version": "1.1.0", "description": "Beiträge mit Kategorien, Titelbildern und Hervorhebung auf der Startseite.", "author": "Inhaus", "namespace": "Inhaus\\Plugins\\News\\", "class": "Inhaus\\Plugins\\News\\NewsPlugin", "requires": { - "core": ">=0.3.0", + "core": ">=0.5.0", "php": ">=8.3" } } diff --git a/plugins-core/news/resources/js/blocks/LatestNews.vue b/plugins-core/news/resources/js/blocks/LatestNews.vue new file mode 100644 index 00000000..d1ea78df --- /dev/null +++ b/plugins-core/news/resources/js/blocks/LatestNews.vue @@ -0,0 +1,26 @@ + + + diff --git a/plugins-core/news/resources/js/editorial/EditorialNews.vue b/plugins-core/news/resources/js/editorial/EditorialNews.vue new file mode 100644 index 00000000..ba6f8efe --- /dev/null +++ b/plugins-core/news/resources/js/editorial/EditorialNews.vue @@ -0,0 +1,55 @@ + + + diff --git a/plugins-core/news/resources/js/pages/Editor.vue b/plugins-core/news/resources/js/pages/Editor.vue new file mode 100644 index 00000000..8cf4cdff --- /dev/null +++ b/plugins-core/news/resources/js/pages/Editor.vue @@ -0,0 +1,239 @@ + + +