Merge pull request 'Design-Überarbeitung und Menü-Editor' (#12) from phase-6-design into main
Some checks are pending
CI / PHP 8.3 / mariadb:10.6 (push) Waiting to run
CI / PHP 8.4 / mariadb:10.6 (push) Waiting to run
CI / PHP 8.3 / mariadb:11.4 (push) Waiting to run
CI / PHP 8.4 / mariadb:11.4 (push) Waiting to run
CI / PHP 8.3 / mysql:8.0 (push) Waiting to run
CI / PHP 8.4 / mysql:8.0 (push) Waiting to run
CI / PHP 8.3 / mysql:8.4 (push) Waiting to run
CI / PHP 8.4 / mysql:8.4 (push) Waiting to run
CI / Build-Artefakte aktuell (push) Waiting to run

This commit is contained in:
Friederich Loheide 2026-09-26 18:34:10 +00:00
commit 328f37acf8
264 changed files with 8931 additions and 1871 deletions

View file

@ -4,6 +4,26 @@ 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
- **„Dokumente“ heißt jetzt „Downloads“** (Adresse /downloads, alte Links leiten weiter). Der Name „Dokumente“ ist für das kommende QM-Modul mit QM-Dokumenten und Formularen vorgesehen. Ordner, Dateien, Rechte, Sichtbarkeiten, Favoriten, Menüpunkte und eingebundene Blöcke werden beim Update automatisch übernommen
- **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, optional mit Symbol, einzelne Punkte nur für bestimmte Rollen. Ohne eigenes Menü gilt weiter das automatische
- Symbole: alle 1.854 Lucide-Symbole lokal verfügbar für Menü, Schnellzugriffe und Pagebuilder – 66 häufig gebrauchte mit deutscher Bezeichnung vorneweg, alle übrigen über die Suche (englische Namen); im Portal wird der vollständige Satz nur bei Bedarf geladen
- 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
- Downloads: mit dem Stern gemerkte Dateien unter „Meine Downloads“ – im Bereich und als Kachel auf der Startseite; „Häufig genutzt“ nach Anzahl der Downloads
- Downloads: 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
- Neue Fokus-Ansicht im Organigramm: eine Person groß mit Kontakt, darüber die Vorgesetzten, daneben das eigene Team, darunter die direkt unterstellten Personen; die gewählte Ansicht wird gemerkt
- Dokumente neu gestaltet: Übersicht mit Bereichen und „Zuletzt aktualisiert“, Dateiliste mit sortierbaren Spalten (Name, Geändert, Größe) und wer zuletzt geändert hat, alternativ Kachelansicht (wird gemerkt)
- Dateien lassen sich auf die ganze Ordneransicht ziehen; leere Ordner laden direkt zum Hochladen ein
- Kompakter: Organigramm zeigt gleich zwei Ebenen, Fokus-Ansicht mit Seitenspalte (Berichtet an, Im selben Team) und Team-Vorschau je Führungskraft; Dokumente mit dichteren Zeilen, Unterordnern in den Bereichen und Infospalte „Über diesen Ordner“ (u. a. wer den Ordner pflegt); ausgewogene Abstände auf allen Seiten
## 0.9.0
- Weitere Anmeldeverfahren (jeweils als Plugin): **OpenID Connect** (z. B. Keycloak, Authentik, Okta, Google Workspace), **LDAP / Active Directory** mit Benutzername und Passwort und **SAML 2** (z. B. ADFS, Shibboleth)

View file

@ -0,0 +1,241 @@
<?php
namespace App\Filament\Pages;
use App\Models\Role;
use App\Support\Audit;
use App\Support\Icons;
use App\Support\Navigation;
use App\Support\Settings;
use BackedEnum;
use Filament\Actions\Action;
use Filament\Forms\Components\Hidden;
use Filament\Forms\Components\Repeater;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Components\Toggle;
use Filament\Notifications\Notification;
use Filament\Pages\Page;
use Filament\Schemas\Components\Section;
use Filament\Schemas\Components\Utilities\Get;
use Filament\Schemas\Schema;
use Filament\Support\Icons\Heroicon;
use Illuminate\Support\HtmlString;
use Illuminate\Support\Str;
use UnitEnum;
/**
* Hauptmenü des Portals selbst gestalten: Bereiche, Seiten, Links und Gruppen,
* jeweils mit Unterpunkten, sortierbar und auf Rollen einschränkbar.
*/
class MenuSettings extends Page
{
protected string $view = 'filament.pages.settings-form';
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedBars3;
protected static string|UnitEnum|null $navigationGroup = 'Portal';
protected static ?int $navigationSort = 5;
protected static ?string $navigationLabel = 'Menü';
protected static ?string $title = 'Menü';
protected static ?string $slug = 'menue';
private const URL_PATTERN = '#^(/|https?://|mailto:|tel:)#i';
/** @var array<string, mixed>|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<mixed>
*/
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)),
Select::make('icon')->label('Symbol')->placeholder('Ohne')->native(false)
->options(Icons::options())->allowHtml()->searchable()
->getSearchResultsUsing(fn (string $search) => Icons::search($search))
->getOptionLabelUsing(fn (?string $value) => $value ? Icons::option($value) : null)
->helperText('Alle 1.800+ Symbole über die Suche (englische Namen, z. B. „calendar“).'),
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<string, mixed> $state
*/
private function itemLabel(array $state): HtmlString
{
$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'] ?? []));
$text = e($label).' · '.e($kind).($children ? " · {$children} Unterpunkte" : '').(! empty($state['roles']) ? ' · eingeschränkt' : '');
return new HtmlString('<span style="display:inline-flex;align-items:center;gap:8px">'
.(Icons::has($state['icon'] ?? null) ? Icons::svg($state['icon'], 16) : '').$text.'</span>');
}
/**
* Startpunkt für den Editor: das bisherige automatische Menü.
*
* @return list<array<string, mixed>>
*/
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,
'icon' => Icons::has($item['icon'] ?? null) ? $item['icon'] : 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(),
];
}
}

View file

@ -2,6 +2,7 @@
namespace App\Filament\Pages;
use App\Support\Icons;
use App\Support\QuickLinks;
use App\Support\Settings;
use BackedEnum;
@ -73,7 +74,12 @@ class QuickLinksSettings extends Page
->columnSpan(2),
Select::make('icon')
->label('Symbol')
->options(QuickLinks::ICONS)
->options(Icons::options())
->allowHtml()
->searchable()
->getSearchResultsUsing(fn (string $search) => Icons::search($search))
->getOptionLabelUsing(fn (?string $value) => $value ? Icons::option($value) : null)
->helperText('Alle 1.800+ Symbole über die Suche (englische Namen, z. B. „calendar“).')
->default('link')
->required(),
Toggle::make('new_tab')

View file

@ -19,6 +19,7 @@ class OrganigramController extends Controller
{
public function index(Request $request): Response
{
$view = in_array($request->query('ansicht'), ['baum', 'fokus'], true) ? $request->query('ansicht') : 'baum';
$focus = $request->integer('person') ? User::query()->active()->find($request->integer('person')) : null;
// Oberste Ebene: aktive Personen ohne (aktive) Vorgesetzte, die selbst ein Team haben.
@ -26,6 +27,11 @@ class OrganigramController extends Controller
->where(fn (Builder $q) => $q->whereNull('manager_id')->orWhereDoesntHave('manager', fn (Builder $m) => $m->where('is_active', true)))
->whereHas('reports', fn (Builder $r) => $r->where('is_active', true)));
// Die Fokus-Ansicht beginnt ohne Auswahl bei der Spitze.
if ($view === 'fokus' && ! $focus && $roots->isNotEmpty()) {
$focus = User::query()->find($roots[0]['id']);
}
// Weg von oben zur gewählten Person, samt Team jeder Ebene.
$path = [];
$teams = [];
@ -46,17 +52,65 @@ class OrganigramController extends Controller
if (! $roots->contains('id', $path[0])) {
$roots = $roots->push(...$this->nodes(User::query()->whereKey($path[0])))->values();
}
} elseif ($roots->count() === 1) {
// Nur eine Spitze (z. B. die Geschäftsführung): erste Ebene gleich zeigen.
$path = [$roots[0]['id']];
$teams[$path[0]] = $this->nodes(User::query()->active()->where('manager_id', $path[0]));
}
// Aufgeklappt: der Weg zur gesuchten Person – sonst die obersten zwei Ebenen,
// damit das Organigramm gleich etwas zeigt.
$open = array_values(array_filter($path, fn ($id) => $id !== $focus?->id));
if (! $focus && $roots->count() <= 3) {
foreach ($roots as $root) {
$teams[$root['id']] = $this->nodes(User::query()->active()->where('manager_id', $root['id']));
$open[] = $root['id'];
}
$leaders = collect($teams)->flatten(1)->where('reports', '>', 0)->pluck('id')->take(12)->all();
if ($leaders !== []) {
$this->nodes(User::query()->active()->whereIn('manager_id', $leaders))
->groupBy('manager_id')
->each(function ($team, $managerId) use (&$teams) {
$teams[$managerId] = $team->values();
});
$open = [...$open, ...$leaders];
}
}
// Fokus: auch die Teams der direkt Unterstellten – für die Vorschau im Fokus.
if ($focus && $view === 'fokus') {
$leads = collect($teams[$focus->id] ?? [])->where('reports', '>', 0)->pluck('id')->take(24)->all();
if ($leads !== []) {
$this->nodes(User::query()->active()->whereIn('manager_id', $leads))->groupBy('manager_id')
->each(function ($team, $managerId) use (&$teams) {
$teams[$managerId] = $team->values();
});
}
}
return Inertia::render('People/Organigram', [
'roots' => $roots,
'path' => $path,
'open' => array_values(array_unique($open)),
'teams' => (object) $teams,
'focus' => $focus?->id,
'details' => $focus ? [
'id' => $focus->id,
'name' => $focus->name,
'initials' => $focus->initials,
'job_title' => $focus->job_title,
'department' => $focus->department,
'location' => $focus->location,
'email' => $focus->email,
'phone' => $focus->phone,
'mobile' => $focus->mobile,
'avatar_url' => $focus->avatarUrl(192),
] : null,
'view' => $view,
'stats' => [
'people' => User::query()->active()->where(fn (Builder $q) => $q->whereNotNull('manager_id')->orWhereHas('reports', fn (Builder $r) => $r->where('is_active', true)))->count(),
'leaders' => User::query()->active()->whereHas('reports', fn (Builder $r) => $r->where('is_active', true))->count(),
],
'unassigned' => User::query()->active()->whereNull('manager_id')->whereDoesntHave('reports')->count(),
]);
}
@ -84,8 +138,10 @@ class OrganigramController extends Controller
'initials' => $u->initials,
'job_title' => $u->job_title,
'department' => $u->department,
'location' => $u->location,
'avatar_url' => $u->avatarUrl(96),
'reports' => $u->reports_count,
'manager_id' => $u->manager_id,
]);
}
}

View file

@ -2,7 +2,7 @@
namespace App\Pagebuilder;
use App\Support\QuickLinks;
use App\Support\Icons;
use App\Support\RichText;
use Closure;
@ -83,7 +83,7 @@ final class Field
/** 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]);
return new self($name, 'icon', $label, ['default' => $default, 'choices' => Icons::choices()]);
}
/** Liste gleichartiger Einträge, z. B. Schaltflächen oder Galeriebilder. */
@ -143,7 +143,7 @@ final class Field
'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'],
'icon' => Icons::has($value) ? $value : $this->options['default'],
'repeater' => $this->sanitizeRepeater($value),
default => null,
};

138
app/Support/Icons.php Normal file
View file

@ -0,0 +1,138 @@
<?php
namespace App\Support;
/**
* Symbole (Lucide, alle lokal) für Menü, Schnellzugriffe und Pagebuilder.
*
* - Alle Symbole: resources/icons/svg.php (englische Namen, dazu Aliase älterer Namen)
* - Kuratierte Auswahl mit deutschen Bezeichnungen: resources/icons/icons.json –
* erscheint zuerst in Auswahlfeldern und ist im Portal ohne Nachladen verfügbar.
*
* Nach Änderungen an der Liste oder einem Lucide-Update: npm run icons.
*/
final class Icons
{
/** @var array<string, string>|null */
private static ?array $choices = null;
/** @var array{icons: array<string, string>, aliases: array<string, string>}|null */
private static ?array $set = null;
/**
* Kuratierte Auswahl.
*
* @return array<string, string> Name => deutsche Bezeichnung
*/
public static function choices(): array
{
return self::$choices ??= json_decode((string) file_get_contents(resource_path('icons/icons.json')), true);
}
/**
* @return list<string> alle Namen
*/
public static function names(): array
{
return array_keys(self::set()['icons']);
}
public static function has(mixed $name): bool
{
return is_string($name) && self::resolve($name) !== null;
}
/**
* Name, wie er in der Symbolliste steht (Aliase älterer Lucide-Versionen aufgelöst).
*/
public static function resolve(string $name): ?string
{
$set = self::set();
return isset($set['icons'][$name]) ? $name : ($set['aliases'][$name] ?? null);
}
public static function label(string $name): string
{
return self::choices()[$name] ?? $name;
}
/**
* Vollständiges SVG, z. B. für Vorschauen im Admin-Bereich.
*/
public static function svg(string $name, int $size = 18): string
{
$inner = self::set()['icons'][self::resolve($name) ?? ''] ?? '';
return '<svg xmlns="http://www.w3.org/2000/svg" width="'.$size.'" height="'.$size.'" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" style="flex-shrink:0">'.$inner.'</svg>';
}
/**
* Auswahl für Filament-Select mit ->allowHtml(): die kuratierten Symbole.
* Alle weiteren findet die Suche (search()).
*
* @return array<string, string>
*/
public static function options(): array
{
return array_combine(array_keys(self::choices()), array_map(fn (string $name) => self::option($name), array_keys(self::choices())));
}
/**
* Ein Eintrag für Filament-Select (Symbol + Bezeichnung) – auch für gespeicherte
* Werte außerhalb der kuratierten Auswahl.
*/
public static function option(string $name): string
{
$label = self::label($name);
return '<span style="display:inline-flex;align-items:center;gap:8px">'.self::svg($name).e($label).'</span>';
}
/**
* Suche über alle Symbole: kuratierte (deutsche Bezeichnung oder Name) zuerst, dann
* alle übrigen nach englischem Namen. Nie im SVG-Markup.
*
* @return array<string, string> Name => HTML für Filament-Select
*/
public static function search(string $query, int $limit = 60): array
{
$query = mb_strtolower(trim($query));
if ($query === '') {
return self::options();
}
$matches = [];
foreach (self::choices() as $name => $label) {
if (str_contains(mb_strtolower($label), $query) || str_contains($name, $query)) {
$matches[] = $name;
}
}
foreach ([...self::names(), ...array_keys(self::set()['aliases'])] as $name) {
if (count($matches) >= $limit) {
break;
}
$real = self::resolve($name);
if (str_contains($name, $query) && ! in_array($real, $matches, true) && ! in_array($name, $matches, true)) {
$matches[] = $real;
}
}
$matches = array_slice(array_values(array_unique($matches)), 0, $limit);
return array_combine($matches, array_map(fn (string $name) => self::option($name), $matches));
}
/**
* @return array{icons: array<string, string>, aliases: array<string, string>}
*/
private static function set(): array
{
return self::$set ??= require resource_path('icons/svg.php');
}
}

View file

@ -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<string, Closure> */
private array $providers = [];
public const MENU_SETTING = 'navigation.menu';
/** @var array<string, array{label: string, options: Closure, resolve: Closure}> */
private array $sources = [];
/** @var list<int>|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<array{key: string, label: string, href: string, active: bool}>
* Weitere Art von Menüpunkten für den Menü-Editor, z. B. „Seite“.
*
* @param Closure(): array<int|string, string> $options Auswahl im Editor
* @param Closure(string, array<string, mixed>, Request, User|null): (array{label: string, href: string, active: bool, children?: list<array{label: string, href: string, active: bool}>}|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<string, string> Art => Bezeichnung
*/
public function sourceTypes(): array
{
return array_map(fn (array $source) => $source['label'], $this->sources);
}
/**
* @return array<int|string, string>
*/
public function sourceOptions(string $type): array
{
return isset($this->sources[$type]) ? ($this->sources[$type]['options'])() : [];
}
/**
* Bereiche für den Menü-Editor.
*
* @return array<string, string> 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<array{key: string, label: string, href: string|null, active: bool, icon: string|null, new_tab: bool, children: list<array<string, mixed>>}>
*/
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<array<string, mixed>>
*/
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,116 @@ 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'], 'icon' => null, 'new_tab' => false, 'children' => []])
->values()
->all();
}
return Hooks::apply('navigation.items', $items, $request, $user);
/**
* @param list<array<string, mixed>> $menu
* @return list<array<string, mixed>>
*/
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<string, mixed> $item
* @return array<string, mixed>|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'], 'icon' => null, '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),
'icon' => Icons::has($item['icon'] ?? null) ? $item['icon'] : null,
'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<int>
*/
private function roleIds(?User $user): array
{
return $this->roleIds ??= $user ? $user->roles()->pluck('roles.id')->map(fn ($id) => (int) $id)->all() : [];
}
}

View file

@ -7,37 +7,6 @@ namespace App\Support;
*/
class QuickLinks
{
/**
* Auswahl an Symbolen (Lucide-Namen). Das Portal bündelt genau diese Symbole,
* deshalb ist die Liste bewusst begrenzt.
*/
public const ICONS = [
'link' => 'Link',
'clock' => 'Uhr / Zeiterfassung',
'calendar-days' => 'Kalender / Dienstplan',
'plane' => 'Urlaub',
'receipt' => 'Reisekosten / Belege',
'graduation-cap' => 'Fortbildung',
'headset' => 'IT-Support',
'utensils' => 'Speiseplan',
'car' => 'Fahrdienst',
'file-text' => 'Formulare / Dokumente',
'book-open' => 'Handbuch / Richtlinien',
'users' => 'Personen / Teams',
'mail' => 'E-Mail',
'message-square' => 'Chat / Feedback',
'lightbulb' => 'Ideen',
'shield-check' => 'Datenschutz / Sicherheit',
'heart-handshake' => 'Soziales / MAV',
'building-2' => 'Standorte',
'wrench' => 'Technik / Hausmeister',
'monitor' => 'Anwendung',
'folder' => 'Ablage',
'phone' => 'Telefonbuch',
'megaphone' => 'Ankündigungen',
'briefcase' => 'Stellenangebote',
];
public function __construct(private readonly Settings $settings) {}
/**
@ -54,7 +23,7 @@ class QuickLinks
return array_values(array_map(fn (array $link) => [
'label' => (string) ($link['label'] ?? ''),
'url' => preg_match('#^(https?://|/)#i', (string) ($link['url'] ?? '')) ? (string) $link['url'] : '#',
'icon' => array_key_exists($link['icon'] ?? '', self::ICONS) ? $link['icon'] : 'link',
'icon' => Icons::has($link['icon'] ?? null) ? $link['icon'] : 'link',
'new_tab' => (bool) ($link['new_tab'] ?? false),
], $links));
}

View file

@ -9,5 +9,5 @@ namespace App;
*/
final class Version
{
public const VERSION = '0.9.0';
public const VERSION = '0.10.0';
}

View file

@ -454,7 +454,7 @@ Entwickler, ohne Build, direkt im Admin unter „Erscheinungsbild“.
## 13. Mitgelieferte Plugins
**Start:** Dashboard, News/Feed mit Kategorien, CMS-Seiten, Formulare,
WordPress-Import, Verzeichnis & Organigramm, Dokumente, App-Launcher.
WordPress-Import, Verzeichnis & Organigramm, Downloads, QM-Dokumente (eigenes Modul), App-Launcher.
**Später:** Events, Umfragen, Geburtstage/Jubiläen, Onboarding, Raumbuchung,
Kantinenplan, Ideenbox, Urlaubsanträge.
@ -485,7 +485,7 @@ Kantinenplan, Ideenbox, Urlaubsanträge.
| **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 |
| **4b – Formulare & Umstieg** ✅ | Formular-Plugin (visueller Baukasten im Portal, Bedingungen, Uploads, anonyme Formulare, Mail + Backend, Ergebnis-Rechte je Formular und Rolle, CSV, Löschfristen; eingebunden per Pagebuilder-Block und unter Beiträgen, kein eigener Menüpunkt); WordPress-Import (Beiträge, Kategorien, Bilder, Seiten); E-Mail-Versand im Admin; anpassbare Startseite mit eigenen Kacheln; Geburtstage (optionales Plugin) |
| **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** | ✅ Organigramm (aus Vorgesetzten, im Admin pflegbar), ✅ Dokumente (Ordner mit vererbten Rechten und Sichtbarkeit, Versionen, Suche, Pagebuilder-Block); ✅ OIDC generisch, LDAP/AD, SAML 2 (als Plugins auf gemeinsamem Treiber-Unterbau); offen: Lasttests 5.000 User |
| **6 – Weitere Plugins & IdPs** | ✅ Organigramm (aus Vorgesetzten, im Admin pflegbar), ✅ Downloads (Ordner mit vererbten Rechten und Sichtbarkeit, Versionen, Suche, Favoriten, Pagebuilder-Block – früher „Dokumente“); geplant: QM-Modul für QM-Dokumente und -Formulare; ✅ OIDC generisch, LDAP/AD, SAML 2 (als Plugins auf gemeinsamem Treiber-Unterbau); offen: Lasttests 5.000 User |
| **7 – Plugin-SDK öffentlich** | Doku, Generator, Beispiel-Plugins (kein Plugin-Verzeichnis) |
| **8 – Mobil** | REST-API (Sanctum), Web-Push, native App |

View file

@ -84,7 +84,7 @@ 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, Dokumentordner – Vorlage: `plugins-core/documents`):
- Hierarchische Objekttypen (z. B. Seiten, Download-Ordner – Vorlage: `plugins-core/downloads`):
`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.
@ -128,6 +128,10 @@ $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)`.
- Symbole: `App\Support\Icons` (alle Lucide-Symbole lokal; kuratierte Auswahl in `resources/icons/icons.json`, nach Änderungen `npm run icons`), im Portal `<AppIcon name="…" />` aus `@/components/AppIcon.vue`.
- 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))`.

280
package-lock.json generated
View file

@ -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",

View file

@ -4,7 +4,8 @@
"type": "module",
"scripts": {
"build": "vite build",
"dev": "vite"
"dev": "vite",
"icons": "node scripts/generate-icons.mjs"
},
"devDependencies": {
"@fontsource-variable/figtree": "^5.3.0",
@ -41,5 +42,8 @@
"vue": "^3.5.43",
"vue-draggable-plus": "^0.6.1",
"vue-sonner": "^2.0.9"
},
"dependencies": {
"pdfjs-dist": "^4.10.38"
}
}

View file

@ -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'
<template>
<AppLayout title="Geburtstage">
<div class="mx-auto max-w-3xl">
<h1 class="text-2xl font-semibold tracking-tight">Geburtstage</h1>
<p class="mt-1 text-sm text-muted-foreground">Die nächsten 30 Tage · {{ scope }}</p>
<PageHeader title="Geburtstage" :description="`Die nächsten 30 Tage · ${scope}`" />
<p v-if="!registered" class="mt-5 rounded-lg border bg-card px-4 py-3 text-sm">
<p v-if="!registered" class="mb-6 rounded-lg border bg-card px-4 py-3 text-sm">
Sie möchten auch in der Liste stehen? Tragen Sie Tag und Monat unter
<Link href="/profil/bearbeiten" class="font-medium text-brand-text hover:underline">Profil bearbeiten</Link> ein.
</p>
<div v-if="groups.length" class="mt-6 grid gap-5">
<div v-if="groups.length" class="grid gap-5">
<section v-for="group in groups" :key="group.date" class="rounded-lg border bg-card">
<h2 class="border-b px-5 py-3 text-sm font-semibold" :class="group.today ? 'text-brand-text' : ''">{{ label(group) }}</h2>
<div class="divide-y px-5">
@ -46,7 +46,7 @@ const label = (group) => group.today ? 'Heute' : new Intl.DateTimeFormat('de-DE'
</div>
</section>
</div>
<div v-else class="mt-6 rounded-lg border bg-card"><EmptyState :icon="Cake" title="Keine Geburtstage in den nächsten 30 Tagen" /></div>
<div v-else class="rounded-lg border bg-card"><EmptyState :icon="Cake" title="Keine Geburtstage in den nächsten 30 Tagen" /></div>
</div>
</AppLayout>
</template>

View file

@ -1,13 +0,0 @@
{
"slug": "documents",
"name": "Dokumente",
"version": "1.0.0",
"description": "Dokumentenablage mit Ordnern, Versionen, Suche und Rechten je Ordner – z. B. Formulare, Dienstanweisungen, Handbücher.",
"author": "Inhaus",
"namespace": "Inhaus\\Plugins\\Documents\\",
"class": "Inhaus\\Plugins\\Documents\\DocumentsPlugin",
"requires": {
"core": ">=0.8.0",
"php": ">=8.3"
}
}

View file

@ -1,37 +0,0 @@
<script setup>
import { computed } from 'vue';
import { File, FileArchive, FileImage, FileSpreadsheet, FileText, Presentation } from '@lucide/vue';
/**
* Symbol und Farbe nach Dateityp – so erkennt man Word, Excel, PDF auf einen Blick.
*/
const props = defineProps({
extension: { type: String, default: '' },
});
const kinds = {
PDF: { icon: FileText, class: 'bg-red-50 text-red-700 dark:bg-red-950/50 dark:text-red-300' },
DOC: { icon: FileText, class: 'bg-sky-50 text-sky-700 dark:bg-sky-950/50 dark:text-sky-300' },
DOCX: { icon: FileText, class: 'bg-sky-50 text-sky-700 dark:bg-sky-950/50 dark:text-sky-300' },
ODT: { icon: FileText, class: 'bg-sky-50 text-sky-700 dark:bg-sky-950/50 dark:text-sky-300' },
XLS: { icon: FileSpreadsheet, class: 'bg-emerald-50 text-emerald-700 dark:bg-emerald-950/50 dark:text-emerald-300' },
XLSX: { icon: FileSpreadsheet, class: 'bg-emerald-50 text-emerald-700 dark:bg-emerald-950/50 dark:text-emerald-300' },
CSV: { icon: FileSpreadsheet, class: 'bg-emerald-50 text-emerald-700 dark:bg-emerald-950/50 dark:text-emerald-300' },
ODS: { icon: FileSpreadsheet, class: 'bg-emerald-50 text-emerald-700 dark:bg-emerald-950/50 dark:text-emerald-300' },
PPT: { icon: Presentation, class: 'bg-orange-50 text-orange-700 dark:bg-orange-950/50 dark:text-orange-300' },
PPTX: { icon: Presentation, class: 'bg-orange-50 text-orange-700 dark:bg-orange-950/50 dark:text-orange-300' },
JPG: { icon: FileImage, class: 'bg-violet-50 text-violet-700 dark:bg-violet-950/50 dark:text-violet-300' },
JPEG: { icon: FileImage, class: 'bg-violet-50 text-violet-700 dark:bg-violet-950/50 dark:text-violet-300' },
PNG: { icon: FileImage, class: 'bg-violet-50 text-violet-700 dark:bg-violet-950/50 dark:text-violet-300' },
ZIP: { icon: FileArchive, class: 'bg-amber-50 text-amber-700 dark:bg-amber-950/50 dark:text-amber-300' },
};
const kind = computed(() => kinds[props.extension?.toUpperCase()] ?? { icon: File, class: 'bg-muted text-muted-foreground' });
</script>
<template>
<span class="relative grid size-10 shrink-0 place-items-center rounded-md" :class="kind.class">
<component :is="kind.icon" class="size-5" />
<span v-if="extension" class="absolute -bottom-1 rounded bg-card px-1 text-[9px] leading-tight font-bold text-current ring-1 ring-border">{{ extension }}</span>
</span>
</template>

View file

@ -1,327 +0,0 @@
<script setup>
import { computed, ref, watch } from 'vue';
import { Link, router, useForm, usePage } from '@inertiajs/vue3';
import { ChevronRight, Download, EllipsisVertical, FilePlus2, Folder, FolderPlus, History, LoaderCircle, PencilLine, Search, Trash2, Upload, X } from '@lucide/vue';
import { toast } from 'vue-sonner';
import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import { Textarea } from '@/components/ui/textarea';
import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle } from '@/components/ui/dialog';
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger } from '@/components/ui/dropdown-menu';
import EmptyState from '@/components/EmptyState.vue';
import FormField from '@/components/FormField.vue';
import NativeSelect from '@/components/NativeSelect.vue';
import AppLayout from '@/layouts/AppLayout.vue';
import { http } from '@/lib/http';
import { formatRelative, formatShortDate } from '@/lib/format';
import FileIcon from '../components/FileIcon.vue';
import FolderTreeNav from '../components/FolderTreeNav.vue';
const props = defineProps({
tree: { type: Array, required: true },
folder: { type: Object, default: null },
breadcrumbs: { type: Array, default: () => [] },
children: { type: Array, default: () => [] },
documents: { type: Array, default: () => [] },
search: { type: String, default: '' },
canCreateRoot: { type: Boolean, default: false },
folderOptions: { type: Array, default: () => [] },
maxUploadMb: { type: Number, default: 20 },
});
const page = usePage();
watch(() => page.props.flash.status, (status) => status && toast.success(status), { immediate: true });
const openIds = computed(() => props.breadcrumbs.map((b) => b.id));
const canEdit = computed(() => !!props.folder?.can_edit);
const title = computed(() => (props.search ? `Suche: ${props.search}` : props.folder?.name ?? 'Dokumente'));
const formatSize = (bytes) => (bytes >= 1024 * 1024 ? `${(bytes / 1024 / 1024).toFixed(1).replace('.', ',')} MB` : `${Math.max(1, Math.round(bytes / 1024))} KB`);
// Suche
const query = ref(props.search);
function submitSearch() {
router.get(props.folder ? `/dokumente/ordner/${props.folder.id}` : '/dokumente', query.value.trim() ? { q: query.value.trim() } : {}, { preserveState: true });
}
// Hochladen (auch per Ziehen und Ablegen)
const upload = useForm({ files: [] });
const dragging = ref(false);
const fileInput = ref(null);
function sendFiles(files) {
if (!canEdit.value || !files.length) return;
const tooLarge = files.find((f) => f.size > props.maxUploadMb * 1024 * 1024);
if (tooLarge) {
toast.error(`„${tooLarge.name}“ ist größer als ${props.maxUploadMb} MB.`);
return;
}
upload.files = files;
upload.post(`/dokumente/ordner/${props.folder.id}/dateien`, {
forceFormData: true,
preserveScroll: true,
onError: (errors) => toast.error(Object.values(errors)[0]),
onFinish: () => upload.reset(),
});
}
function onDrop(event) {
dragging.value = false;
sendFiles([...(event.dataTransfer?.files ?? [])]);
}
// Neue Fassung
const versionFor = ref(null);
const versionForm = useForm({ file: null, note: '' });
function submitVersion() {
versionForm.post(`/dokumente/${versionFor.value.id}/versionen`, {
forceFormData: true,
preserveScroll: true,
onSuccess: () => {
versionFor.value = null;
versionForm.reset();
},
});
}
// Bearbeiten
const editing = ref(null);
const editForm = useForm({ title: '', description: '', folder_id: null });
function edit(doc) {
editing.value = doc;
editForm.defaults({ title: doc.title, description: doc.description ?? '', folder_id: doc.folder_id });
editForm.reset();
editForm.clearErrors();
}
function submitEdit() {
editForm.put(`/dokumente/${editing.value.id}`, { preserveScroll: true, onSuccess: () => (editing.value = null) });
}
function remove(doc) {
if (window.confirm(`„${doc.title}“ mit allen Fassungen löschen?`)) {
router.delete(`/dokumente/${doc.id}`, { preserveScroll: true });
}
}
// Fassungen
const history = ref(null);
const versions = ref([]);
async function showVersions(doc) {
history.value = doc;
versions.value = [];
versions.value = (await http.get(`/dokumente/${doc.id}/versionen`)).versions;
}
// Ordner
const folderDialog = ref(null); // 'new' | 'rename'
const folderForm = useForm({ name: '', parent_id: null });
function openFolderDialog(mode) {
folderDialog.value = mode;
folderForm.clearErrors();
folderForm.name = mode === 'rename' ? props.folder.name : '';
folderForm.parent_id = mode === 'new' ? props.folder?.id ?? null : null;
}
function submitFolder() {
if (folderDialog.value === 'rename') {
folderForm.transform((data) => ({ name: data.name, description: props.folder.description })).put(`/dokumente/ordner/${props.folder.id}`, { onSuccess: () => (folderDialog.value = null) });
} else {
folderForm.transform((data) => data).post('/dokumente/ordner', { onSuccess: () => (folderDialog.value = null) });
}
}
function deleteFolder() {
if (window.confirm(`Ordner „${props.folder.name}“ löschen?`)) {
router.delete(`/dokumente/ordner/${props.folder.id}`, { onError: (errors) => toast.error(Object.values(errors)[0]) });
}
}
</script>
<template>
<AppLayout :title="title">
<div class="grid gap-6 lg:grid-cols-[260px_minmax(0,1fr)]">
<aside class="hidden lg:block">
<nav class="sticky top-24 rounded-lg border bg-card p-2" aria-label="Ordner">
<Link href="/dokumente" class="mb-1 block rounded-md px-2.5 py-1.5 text-sm font-semibold hover:bg-accent" :class="!folder && !search ? 'bg-brand-soft text-brand-soft-foreground' : ''">Alle Ordner</Link>
<FolderTreeNav :items="tree" :current-id="folder?.id ?? null" :open-ids="openIds" />
<p v-if="!tree.length" class="px-2.5 py-2 text-[13px] text-muted-foreground">Noch keine Ordner.</p>
</nav>
</aside>
<section
class="min-w-0"
@dragover.prevent="canEdit && (dragging = true)"
@dragleave.self="dragging = false"
@drop.prevent="onDrop"
>
<nav class="mb-2 flex flex-wrap items-center gap-1 text-[13px] text-muted-foreground" aria-label="Brotkrumen">
<Link href="/dokumente" class="hover:text-foreground hover:underline">Dokumente</Link>
<template v-for="crumb in breadcrumbs" :key="crumb.id">
<ChevronRight class="size-3.5" />
<Link :href="`/dokumente/ordner/${crumb.id}`" class="hover:text-foreground hover:underline">{{ crumb.name }}</Link>
</template>
</nav>
<div class="mb-5 flex flex-wrap items-start justify-between gap-4">
<div class="min-w-0">
<h1 class="text-2xl font-semibold tracking-tight">{{ title }}</h1>
<p v-if="folder?.description && !search" class="mt-1 text-sm text-muted-foreground">{{ folder.description }}</p>
</div>
<div class="flex flex-wrap items-center gap-2">
<form class="relative" role="search" @submit.prevent="submitSearch">
<Search class="pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2 text-muted-foreground" />
<Input v-model="query" type="search" class="w-56 pl-9" placeholder="Dokumente durchsuchen …" aria-label="Dokumente durchsuchen" />
</form>
<Button v-if="canEdit" :disabled="upload.processing" @click="fileInput?.click()">
<LoaderCircle v-if="upload.processing" class="animate-spin" />
<Upload v-else /> Hochladen
</Button>
<input ref="fileInput" type="file" multiple class="hidden" @change="sendFiles([...$event.target.files]); $event.target.value = ''" />
<DropdownMenu v-if="canEdit || (!folder && canCreateRoot)">
<DropdownMenuTrigger as-child><Button variant="outline" size="icon" aria-label="Ordner-Aktionen"><EllipsisVertical /></Button></DropdownMenuTrigger>
<DropdownMenuContent align="end">
<DropdownMenuItem @select="openFolderDialog('new')"><FolderPlus /> {{ folder ? 'Unterordner anlegen' : 'Ordner anlegen' }}</DropdownMenuItem>
<template v-if="folder && canEdit">
<DropdownMenuItem @select="openFolderDialog('rename')"><PencilLine /> Ordner umbenennen</DropdownMenuItem>
<DropdownMenuSeparator v-if="folder.can_delete" />
<DropdownMenuItem v-if="folder.can_delete" class="text-destructive" @select="deleteFolder"><Trash2 /> Ordner löschen</DropdownMenuItem>
</template>
</DropdownMenuContent>
</DropdownMenu>
</div>
</div>
<div v-if="upload.processing && upload.progress" class="mb-4 h-1.5 overflow-hidden rounded-full bg-muted" role="progressbar" :aria-valuenow="upload.progress.percentage">
<div class="h-full bg-brand transition-all" :style="{ width: `${upload.progress.percentage}%` }" />
</div>
<div v-if="dragging" class="mb-4 grid place-items-center rounded-lg border-2 border-dashed border-brand-400 bg-brand-soft/60 py-10 text-sm font-medium text-brand-soft-foreground">
Dateien hier ablegen, um sie in „{{ folder.name }}“ hochzuladen
</div>
<div v-if="children.length && !search" class="mb-5 grid gap-3 sm:grid-cols-2 xl:grid-cols-3">
<Link v-for="child in children" :key="child.id" :href="`/dokumente/ordner/${child.id}`" class="group flex items-center gap-3 rounded-lg border bg-card p-3.5 hover:border-brand-300">
<span class="grid size-10 place-items-center rounded-md bg-brand-soft text-brand-text"><Folder class="size-5" /></span>
<span class="min-w-0 flex-1">
<span class="block truncate text-sm font-medium group-hover:underline">{{ child.name }}</span>
<span class="text-xs text-muted-foreground">{{ child.count }} {{ child.count === 1 ? 'Eintrag' : 'Einträge' }}</span>
</span>
</Link>
</div>
<div v-if="documents.length" class="divide-y rounded-lg border bg-card">
<div v-for="doc in documents" :key="doc.id" class="flex items-center gap-3 px-4 py-3">
<FileIcon :extension="doc.extension" />
<div class="min-w-0 flex-1">
<a v-if="doc.download_url" :href="doc.download_url" class="block truncate text-sm font-medium hover:underline">{{ doc.title }}</a>
<span v-else class="block truncate text-sm font-medium">{{ doc.title }}</span>
<p v-if="doc.description" class="truncate text-[13px] text-muted-foreground">{{ doc.description }}</p>
<p class="text-xs text-muted-foreground">
{{ doc.extension }} · {{ formatSize(doc.size) }} · {{ formatShortDate(doc.updated_at) }}
<template v-if="doc.version > 1"> · Fassung {{ doc.version }}</template>
</p>
</div>
<Button v-if="doc.download_url" variant="ghost" size="icon" as-child :title="`${doc.title} herunterladen`"><a :href="doc.download_url"><Download /></a></Button>
<DropdownMenu>
<DropdownMenuTrigger as-child><Button variant="ghost" size="icon" :aria-label="`Aktionen für ${doc.title}`"><EllipsisVertical /></Button></DropdownMenuTrigger>
<DropdownMenuContent align="end">
<DropdownMenuItem @select="showVersions(doc)"><History /> Fassungen</DropdownMenuItem>
<template v-if="canEdit || search">
<DropdownMenuItem v-if="canEdit" @select="versionFor = doc; versionForm.reset()"><FilePlus2 /> Neue Fassung hochladen</DropdownMenuItem>
<DropdownMenuItem v-if="canEdit" @select="edit(doc)"><PencilLine /> Bearbeiten oder verschieben</DropdownMenuItem>
<DropdownMenuSeparator v-if="canEdit" />
<DropdownMenuItem v-if="canEdit" class="text-destructive" @select="remove(doc)"><Trash2 /> Löschen</DropdownMenuItem>
</template>
</DropdownMenuContent>
</DropdownMenu>
</div>
</div>
<div v-else-if="search" class="rounded-lg border bg-card"><EmptyState :icon="Search" title="Keine Treffer" :text="`Nichts gefunden zu „${search}“.`" /></div>
<div v-else-if="folder && !children.length" class="rounded-lg border border-dashed bg-card">
<EmptyState :icon="Folder" title="Dieser Ordner ist leer" :text="canEdit ? 'Dateien hierher ziehen oder „Hochladen“ wählen.' : ''" />
</div>
<div v-else-if="!folder && !tree.length" class="rounded-lg border bg-card"><EmptyState :icon="Folder" title="Noch keine Dokumente" /></div>
</section>
</div>
<!-- Neue Fassung -->
<Dialog :open="!!versionFor" @update:open="(v) => !v && (versionFor = null)">
<DialogContent class="sm:max-w-md">
<DialogHeader>
<DialogTitle>Neue Fassung</DialogTitle>
<DialogDescription>„{{ versionFor?.title }}“ – die bisherige Fassung bleibt unter „Fassungen“ abrufbar.</DialogDescription>
</DialogHeader>
<form class="grid gap-4" @submit.prevent="submitVersion">
<FormField id="version-file" label="Datei" :error="versionForm.errors.file">
<input id="version-file" type="file" class="text-sm" @change="versionForm.file = $event.target.files[0]" />
</FormField>
<FormField id="version-note" label="Was hat sich geändert? (optional)" :error="versionForm.errors.note">
<Input id="version-note" v-model="versionForm.note" maxlength="500" />
</FormField>
<DialogFooter>
<Button type="button" variant="outline" @click="versionFor = null">Abbrechen</Button>
<Button type="submit" :disabled="!versionForm.file || versionForm.processing">Hochladen</Button>
</DialogFooter>
</form>
</DialogContent>
</Dialog>
<!-- Bearbeiten -->
<Dialog :open="!!editing" @update:open="(v) => !v && (editing = null)">
<DialogContent class="sm:max-w-lg">
<DialogHeader><DialogTitle>Dokument bearbeiten</DialogTitle></DialogHeader>
<form class="grid gap-4" @submit.prevent="submitEdit">
<FormField id="doc-title" label="Titel" :error="editForm.errors.title"><Input id="doc-title" v-model="editForm.title" maxlength="250" /></FormField>
<FormField id="doc-description" label="Beschreibung" :error="editForm.errors.description"><Textarea id="doc-description" v-model="editForm.description" rows="3" maxlength="2000" /></FormField>
<FormField id="doc-folder" label="Ordner" :error="editForm.errors.folder_id"><NativeSelect id="doc-folder" v-model="editForm.folder_id" :options="folderOptions" /></FormField>
<DialogFooter>
<Button type="button" variant="outline" @click="editing = null">Abbrechen</Button>
<Button type="submit" :disabled="editForm.processing">Speichern</Button>
</DialogFooter>
</form>
</DialogContent>
</Dialog>
<!-- Fassungen -->
<Dialog :open="!!history" @update:open="(v) => !v && (history = null)">
<DialogContent class="sm:max-w-lg">
<DialogHeader><DialogTitle>Fassungen</DialogTitle><DialogDescription>{{ history?.title }}</DialogDescription></DialogHeader>
<div v-if="!versions.length" class="grid place-items-center py-6"><LoaderCircle class="size-5 animate-spin text-muted-foreground" /></div>
<ul v-else class="-mx-2 divide-y">
<li v-for="v in versions" :key="v.version" class="flex items-center gap-3 px-2 py-2.5">
<span class="grid size-8 place-items-center rounded-md bg-muted text-xs font-semibold">{{ v.version }}</span>
<div class="min-w-0 flex-1">
<p class="truncate text-sm">{{ v.name }} <span v-if="v.current" class="ml-1 rounded bg-brand-soft px-1.5 py-0.5 text-[11px] text-brand-soft-foreground">aktuell</span></p>
<p class="text-xs text-muted-foreground">{{ formatRelative(v.created_at) }}<template v-if="v.uploader"> · {{ v.uploader }}</template> · {{ formatSize(v.size) }}</p>
<p v-if="v.note" class="text-xs">{{ v.note }}</p>
</div>
<Button variant="ghost" size="icon" as-child :title="`Fassung ${v.version} herunterladen`"><a :href="v.download_url"><Download /></a></Button>
</li>
</ul>
</DialogContent>
</Dialog>
<!-- Ordner -->
<Dialog :open="!!folderDialog" @update:open="(v) => !v && (folderDialog = null)">
<DialogContent class="sm:max-w-md">
<DialogHeader><DialogTitle>{{ folderDialog === 'rename' ? 'Ordner umbenennen' : folder ? `Unterordner in „${folder.name}“` : 'Neuer Ordner' }}</DialogTitle></DialogHeader>
<form class="grid gap-4" @submit.prevent="submitFolder">
<FormField id="folder-name" label="Name" :error="folderForm.errors.name"><Input id="folder-name" v-model="folderForm.name" maxlength="120" autofocus /></FormField>
<DialogFooter>
<Button type="button" variant="outline" @click="folderDialog = null">Abbrechen</Button>
<Button type="submit" :disabled="folderForm.processing || !folderForm.name.trim()">Speichern</Button>
</DialogFooter>
</form>
</DialogContent>
</Dialog>
</AppLayout>
</template>

View file

@ -1,18 +0,0 @@
<?php
use Illuminate\Support\Facades\Route;
use Inhaus\Plugins\Documents\Http\Controllers\DocumentController;
Route::middleware('auth')->prefix('dokumente')->name('documents.')->controller(DocumentController::class)->where(['document' => '[0-9]+', 'folder' => '[0-9]+', 'version' => '[0-9]+'])->group(function () {
Route::get('/', 'index')->name('index');
Route::get('/ordner/{folder}', 'folder')->name('folder');
Route::post('/ordner', 'storeFolder')->name('folders.store');
Route::put('/ordner/{folder}', 'updateFolder')->name('folders.update');
Route::delete('/ordner/{folder}', 'destroyFolder')->name('folders.destroy');
Route::post('/ordner/{folder}/dateien', 'upload')->name('upload');
Route::put('/{document}', 'update')->name('update');
Route::delete('/{document}', 'destroy')->name('destroy');
Route::post('/{document}/versionen', 'newVersion')->name('versions.store');
Route::get('/{document}/versionen', 'versions')->name('versions');
Route::get('/{document}/herunterladen/{version}/{name}', 'download')->name('download');
});

View file

@ -1,29 +0,0 @@
<?php
namespace Inhaus\Plugins\Documents;
use Inhaus\Plugins\Documents\Models\Document;
final class DocumentPresenter
{
/**
* @return array<string, mixed>
*/
public static function row(Document $document): array
{
$version = $document->currentVersion;
return [
'id' => $document->id,
'title' => $document->title,
'description' => $document->description,
'folder_id' => $document->folder_id,
'version' => $version?->version,
'name' => $version?->name,
'extension' => $version?->extension(),
'size' => (int) ($version?->size ?? 0),
'updated_at' => ($version?->created_at ?? $document->updated_at)?->toIso8601String(),
'download_url' => $version ? $document->downloadUrl($version) : null,
];
}
}

View file

@ -1,60 +0,0 @@
<?php
namespace Inhaus\Plugins\Documents;
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;
use Illuminate\Support\Facades\Gate;
use Inhaus\Plugins\Documents\Models\Document;
use Inhaus\Plugins\Documents\Models\DocumentFolder;
use Inhaus\Plugins\Documents\Policies\DocumentFolderPolicy;
class DocumentsPlugin extends Plugin
{
public function register(): void
{
$this->app->singleton(FolderTree::class);
$this->app->make(Navigation::class)->add('documents', 'Dokumente', '/dokumente', active: 'documents.*', sort: 50);
$abilities = $this->app->make(Abilities::class);
$abilities->define('documents.manage', 'Dokumente: gesamte Ablage verwalten', 'Dokumente');
$abilities->define('documents.edit', 'Dokumente pflegen', 'Dokumente', resource: 'document_folder');
$abilities->resourceType(
'document_folder',
'Dokumentenordner',
fn () => $this->app->make(FolderTree::class)->options(),
fn (array $ids) => $this->app->make(FolderTree::class)->descendantIds($ids),
);
Gate::policy(DocumentFolder::class, DocumentFolderPolicy::class);
$this->app->make(Blocks::class)->add(BlockType::make('documents.folder', 'Dokumente', 'file-down', 'dynamic', 'documents::FolderBlock')
->description('Die Dokumente eines Ordners – immer in der aktuellen Fassung.')
->fields([
Field::text('title', 'Überschrift', 150),
Field::select('folder', 'Ordner', fn () => collect($this->app->make(FolderTree::class)->options())->mapWithKeys(fn ($name, $id) => [(string) $id => $name])->all()),
Field::toggle('show_description', 'Beschreibungen anzeigen', true),
])
->resolveUsing(function (array $data, ?User $user) {
$tree = $this->app->make(FolderTree::class);
$folderId = (int) $data['folder'];
if (! $folderId || ! $tree->isVisible($folderId, $user)) {
return null;
}
$documents = Document::query()->where('folder_id', $folderId)->with('currentVersion')->orderBy('title')->limit(100)->get();
return [
'folder_url' => route('documents.folder', $folderId),
'documents' => $documents->map(fn (Document $d) => DocumentPresenter::row($d))->all(),
];
}));
}
}

View file

@ -1,274 +0,0 @@
<?php
namespace Inhaus\Plugins\Documents\Http\Controllers;
use App\Http\Controllers\Controller;
use App\Support\Audit;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Http\UploadedFile;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Gate;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Str;
use Illuminate\Validation\Rule;
use Illuminate\Validation\ValidationException;
use Inertia\Inertia;
use Inertia\Response;
use Inhaus\Plugins\Documents\DocumentPresenter;
use Inhaus\Plugins\Documents\FolderTree;
use Inhaus\Plugins\Documents\Models\Document;
use Inhaus\Plugins\Documents\Models\DocumentFolder;
use Inhaus\Plugins\Documents\Models\DocumentVersion;
use Symfony\Component\HttpFoundation\StreamedResponse;
class DocumentController extends Controller
{
/** Nie als Datei annehmen: ausführbarer Code, Webseiten, Skripte. */
private const BLOCKED = ['php', 'phtml', 'phar', 'php3', 'php4', 'php5', 'php7', 'php8', 'pht', 'shtml', 'htaccess', 'exe', 'bat', 'cmd', 'com', 'sh', 'js', 'mjs', 'html', 'htm', 'svg', 'xhtml', 'jsp', 'asp', 'aspx', 'cgi', 'pl', 'py', 'msi', 'ps1', 'vbs', 'scr'];
public const MAX_KB = 100 * 1024;
public function __construct(private readonly FolderTree $tree) {}
public function index(Request $request): Response
{
return $this->render($request, null);
}
public function folder(Request $request, DocumentFolder $folder): Response
{
abort_unless($this->tree->isVisible($folder->id, $request->user()) || $request->user()->can('update', $folder), 404);
return $this->render($request, $folder);
}
public function upload(Request $request, DocumentFolder $folder): RedirectResponse
{
Gate::authorize('update', $folder);
$request->validate([
'files' => ['required', 'array', 'max:20'],
'files.*' => ['file', 'max:'.self::MAX_KB],
], [], ['files.*' => 'Datei']);
$count = 0;
foreach ($request->file('files') as $index => $file) {
$this->assertAllowed($file, "files.{$index}");
}
foreach ($request->file('files') as $file) {
DB::transaction(function () use ($folder, $file, $request) {
$document = $folder->documents()->create([
'title' => Str::limit(pathinfo($file->getClientOriginalName(), PATHINFO_FILENAME) ?: 'Dokument', 250, ''),
'created_by' => $request->user()->id,
'updated_by' => $request->user()->id,
]);
$this->storeVersion($document, $file, $request, null);
});
$count++;
}
Audit::log('documents.uploaded', ['folder' => $folder->id, 'count' => $count]);
return back()->with('status', $count === 1 ? 'Dokument hochgeladen.' : "{$count} Dokumente hochgeladen.");
}
public function newVersion(Request $request, Document $document): RedirectResponse
{
Gate::authorize('update', $document->folder);
$request->validate(['file' => ['required', 'file', 'max:'.self::MAX_KB], 'note' => ['nullable', 'string', 'max:500']], [], ['file' => 'Datei', 'note' => 'Hinweis']);
$this->assertAllowed($request->file('file'), 'file');
DB::transaction(fn () => $this->storeVersion($document, $request->file('file'), $request, $request->input('note')));
Audit::log('documents.version_added', ['document' => $document->id, 'title' => $document->title]);
return back()->with('status', 'Neue Fassung hochgeladen.');
}
public function update(Request $request, Document $document): RedirectResponse
{
Gate::authorize('update', $document->folder);
$data = $request->validate([
'title' => ['required', 'string', 'max:250'],
'description' => ['nullable', 'string', 'max:2000'],
'folder_id' => ['required', 'integer', Rule::exists('document_folders', 'id')],
], [], ['title' => 'Titel', 'folder_id' => 'Ordner']);
// Verschieben: im Zielordner muss man ebenfalls pflegen dürfen.
if ((int) $data['folder_id'] !== $document->folder_id) {
Gate::authorize('update', DocumentFolder::query()->findOrFail($data['folder_id']));
}
$document->update([...$data, 'updated_by' => $request->user()->id]);
return back()->with('status', 'Gespeichert.');
}
public function destroy(Request $request, Document $document): RedirectResponse
{
Gate::authorize('update', $document->folder);
$document->delete();
Audit::log('documents.deleted', ['document' => $document->id, 'title' => $document->title]);
return back()->with('status', 'Dokument gelöscht.');
}
public function versions(Request $request, Document $document): JsonResponse
{
abort_unless($this->tree->isVisible($document->folder_id, $request->user()) || $request->user()->can('update', $document->folder), 404);
return response()->json(['versions' => $document->versions()->with('uploader:id,name')->get()->map(fn (DocumentVersion $v) => [
'version' => $v->version,
'name' => $v->name,
'size' => (int) $v->size,
'note' => $v->note,
'uploader' => $v->uploader?->name,
'created_at' => $v->created_at?->toIso8601String(),
'current' => $v->id === $document->current_version_id,
'download_url' => $document->downloadUrl($v),
])]);
}
public function download(Request $request, Document $document, int $version): StreamedResponse
{
abort_unless($this->tree->isVisible($document->folder_id, $request->user()) || $request->user()->can('update', $document->folder), 404);
$file = $document->versions()->where('version', $version)->firstOrFail();
return Storage::disk(DocumentVersion::DISK)->download($file->path, $file->name, [
'Content-Type' => $file->mime ?: 'application/octet-stream',
'X-Content-Type-Options' => 'nosniff',
'Cache-Control' => 'private, max-age=300',
]);
}
public function storeFolder(Request $request): RedirectResponse
{
$data = $request->validate([
'name' => ['required', 'string', 'max:120'],
'parent_id' => ['nullable', 'integer', Rule::exists('document_folders', 'id')],
], [], ['name' => 'Name']);
$parent = isset($data['parent_id']) ? DocumentFolder::query()->findOrFail($data['parent_id']) : null;
Gate::authorize('create', [DocumentFolder::class, $parent]);
$folder = DocumentFolder::query()->create([
'name' => trim($data['name']),
'parent_id' => $parent?->id,
'sort' => (int) DocumentFolder::query()->where('parent_id', $parent?->id)->max('sort') + 1,
'created_by' => $request->user()->id,
]);
return to_route('documents.folder', $folder)->with('status', 'Ordner angelegt.');
}
public function updateFolder(Request $request, DocumentFolder $folder): RedirectResponse
{
Gate::authorize('update', $folder);
$folder->update($request->validate(['name' => ['required', 'string', 'max:120'], 'description' => ['nullable', 'string', 'max:500']], [], ['name' => 'Name']));
return back()->with('status', 'Ordner gespeichert.');
}
public function destroyFolder(Request $request, DocumentFolder $folder): RedirectResponse
{
Gate::authorize('delete', $folder);
if ($folder->children()->exists() || $folder->documents()->exists()) {
throw ValidationException::withMessages(['folder' => 'Der Ordner ist nicht leer. Bitte zuerst Dokumente und Unterordner entfernen oder verschieben.']);
}
$parent = $folder->parent_id;
$folder->delete();
return ($parent ? to_route('documents.folder', $parent) : to_route('documents.index'))->with('status', 'Ordner gelöscht.');
}
private function render(Request $request, ?DocumentFolder $folder): Response
{
$user = $request->user();
$search = trim((string) $request->query('q', ''));
if ($search !== '') {
$like = '%'.str_replace(['\\', '%', '_'], ['\\\\', '\\%', '\\_'], $search).'%';
$documents = Document::query()
->whereIn('folder_id', $this->tree->visibleIds($user) ?: [0])
->where(fn ($q) => $q->where('title', 'like', $like)->orWhere('description', 'like', $like)
->orWhereHas('versions', fn ($v) => $v->where('name', 'like', $like)))
->with('currentVersion')->orderBy('title')->limit(100)->get();
} else {
$documents = $folder
? $folder->documents()->with('currentVersion')->orderBy('title')->get()
: collect();
}
$childIds = array_values(array_filter($this->tree->childIds($folder?->id), fn ($id) => $this->tree->isVisible($id, $user)));
$counts = Document::query()->whereIn('folder_id', $childIds ?: [0])->selectRaw('folder_id, count(*) as c')->groupBy('folder_id')->pluck('c', 'folder_id');
$children = collect($childIds)->map(fn ($id) => [
'id' => $id,
'name' => $this->tree->get($id)['name'],
'count' => (int) ($counts[$id] ?? 0) + count($this->tree->childIds($id)),
]);
return Inertia::render('documents::Index', [
'tree' => $this->tree->visibleTree(null, $user),
'folder' => $folder ? [
'id' => $folder->id,
'name' => $folder->name,
'description' => $folder->description,
'parent_id' => $folder->parent_id,
'can_edit' => $user->can('update', $folder),
'can_delete' => $user->can('delete', $folder),
] : null,
'breadcrumbs' => $folder ? array_map(fn ($f) => ['id' => $f['id'], 'name' => $f['name']], $this->tree->ancestors($folder->id)) : [],
'children' => $children,
'documents' => $documents->map(fn (Document $d) => DocumentPresenter::row($d)),
'search' => $search,
'canCreateRoot' => $user->can('documents.manage'),
// Zielordner zum Verschieben: nur solche, in denen die Person pflegen darf.
'folderOptions' => collect($this->tree->options())->filter(fn ($name, $id) => $user->can('documents.edit', ['document_folder', $id]))
->map(fn ($name, $id) => ['value' => $id, 'label' => $name])->values(),
'maxUploadMb' => (int) floor(min(self::MAX_KB / 1024, self::phpUploadLimitMb())),
]);
}
private function storeVersion(Document $document, UploadedFile $file, Request $request, ?string $note): DocumentVersion
{
$name = Str::limit(preg_replace('/[^\pL\pN ._()\-]+/u', '_', $file->getClientOriginalName()) ?: 'datei', 200, '');
$extension = strtolower(pathinfo($name, PATHINFO_EXTENSION));
$version = $document->versions()->create([
'version' => (int) $document->versions()->max('version') + 1,
'name' => $name,
'path' => $file->storeAs('documents/'.$document->folder_id, Str::random(40).($extension ? '.'.$extension : ''), DocumentVersion::DISK),
'mime' => $file->getMimeType(),
'size' => $file->getSize(),
'note' => $note,
'uploaded_by' => $request->user()->id,
'created_at' => now(),
]);
$document->forceFill(['current_version_id' => $version->id, 'updated_by' => $request->user()->id])->save();
return $version;
}
private function assertAllowed(UploadedFile $file, string $field): void
{
$extensions = [strtolower(pathinfo($file->getClientOriginalName(), PATHINFO_EXTENSION)), strtolower((string) $file->getClientOriginalExtension())];
if (array_intersect($extensions, self::BLOCKED) !== []) {
throw ValidationException::withMessages([$field => '„'.$file->getClientOriginalName().'“: Dieser Dateityp ist aus Sicherheitsgründen nicht erlaubt.']);
}
}
private static function phpUploadLimitMb(): float
{
$bytes = fn (string $v) => (int) $v * (['g' => 1024 ** 3, 'm' => 1024 ** 2, 'k' => 1024][strtolower(substr(trim($v), -1))] ?? 1);
$limits = array_filter([$bytes((string) ini_get('upload_max_filesize')), $bytes((string) ini_get('post_max_size'))]);
return $limits === [] ? self::MAX_KB / 1024 : min($limits) / 1024 / 1024;
}
}

View file

@ -1,41 +0,0 @@
<?php
namespace Inhaus\Plugins\Documents\Policies;
use App\Models\User;
use Inhaus\Plugins\Documents\FolderTree;
use Inhaus\Plugins\Documents\Models\DocumentFolder;
/**
* „Dokumente verwalten“ gilt für die ganze Ablage. „Dokumente pflegen“ wird je
* Ordner vergeben (meist inkl. Unterordnern) – z. B. pflegt die Personalabteilung
* den Ordner „Personal“.
*/
class DocumentFolderPolicy
{
public function viewAny(User $user): bool
{
return $user->can('documents.manage') || $user->permissions()->ids('documents.edit', 'document_folder') !== [];
}
public function view(User $user, DocumentFolder $folder): bool
{
return app(FolderTree::class)->isVisible($folder->id, $user) || $this->update($user, $folder);
}
public function create(User $user, ?DocumentFolder $parent = null): bool
{
return $user->can('documents.manage') || ($parent !== null && $this->update($user, $parent));
}
/** Dokumente hochladen, ändern, löschen; Unterordner anlegen. */
public function update(User $user, DocumentFolder $folder): bool
{
return $user->can('documents.manage') || $user->can('documents.edit', ['document_folder', $folder->id]);
}
public function delete(User $user, DocumentFolder $folder): bool
{
return $user->can('documents.manage') || ($folder->parent_id !== null && $user->can('documents.edit', ['document_folder', $folder->parent_id]));
}
}

View file

@ -8,9 +8,9 @@ return new class extends Migration
{
public function up(): void
{
Schema::create('document_folders', function (Blueprint $table) {
Schema::create('download_folders', function (Blueprint $table) {
$table->id();
$table->foreignId('parent_id')->nullable()->constrained('document_folders')->restrictOnDelete();
$table->foreignId('parent_id')->nullable()->constrained('download_folders')->restrictOnDelete();
$table->string('name');
$table->string('description', 500)->nullable();
$table->unsignedInteger('sort')->default(0);
@ -20,12 +20,12 @@ return new class extends Migration
$table->index(['parent_id', 'sort']);
});
Schema::create('documents', function (Blueprint $table) {
Schema::create('downloads', function (Blueprint $table) {
$table->id();
$table->foreignId('folder_id')->constrained('document_folders')->restrictOnDelete();
$table->foreignId('folder_id')->constrained('download_folders')->restrictOnDelete();
$table->string('title');
$table->text('description')->nullable();
// Aktuelle Fassung; ältere bleiben in document_versions abrufbar.
// Aktuelle Fassung; ältere bleiben in download_versions abrufbar.
$table->unsignedBigInteger('current_version_id')->nullable();
$table->foreignId('created_by')->nullable()->constrained('users')->nullOnDelete();
$table->foreignId('updated_by')->nullable()->constrained('users')->nullOnDelete();
@ -34,9 +34,9 @@ return new class extends Migration
$table->index(['folder_id', 'title']);
});
Schema::create('document_versions', function (Blueprint $table) {
Schema::create('download_versions', function (Blueprint $table) {
$table->id();
$table->foreignId('document_id')->constrained('documents')->cascadeOnDelete();
$table->foreignId('download_id')->constrained('downloads')->cascadeOnDelete();
$table->unsignedInteger('version');
$table->string('name');
$table->string('path');
@ -46,15 +46,15 @@ return new class extends Migration
$table->foreignId('uploaded_by')->nullable()->constrained('users')->nullOnDelete();
$table->timestamp('created_at')->nullable();
$table->unique(['document_id', 'version']);
$table->unique(['download_id', 'version']);
$table->index('name');
});
}
public function down(): void
{
Schema::dropIfExists('document_versions');
Schema::dropIfExists('documents');
Schema::dropIfExists('document_folders');
Schema::dropIfExists('download_versions');
Schema::dropIfExists('downloads');
Schema::dropIfExists('download_folders');
}
};

View file

@ -0,0 +1,109 @@
<?php
use App\Plugins\PluginState;
use App\Support\Permissions\Permissions;
use App\Support\Settings;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
/**
* Aus dem Modul „Dokumente“ wird „Downloads“ (der Name „Dokumente“ bleibt dem
* QM-Modul vorbehalten). Bestehende Installationen: Tabellen, Rechte, Sichtbarkeiten,
* Einstellungen, Pagebuilder-Blöcke und der Plugin-Zustand ziehen mit um.
* Neue Installationen legen die Tabellen gleich unter den neuen Namen an.
*/
return new class extends Migration
{
public function up(): void
{
if (Schema::hasTable('documents') && ! Schema::hasTable('downloads')) {
Schema::rename('document_folders', 'download_folders');
Schema::rename('documents', 'downloads');
Schema::rename('document_versions', 'download_versions');
Schema::table('download_versions', fn (Blueprint $table) => $table->renameColumn('document_id', 'download_id'));
}
if (Schema::hasTable('document_favorites') && ! Schema::hasTable('download_favorites')) {
Schema::rename('document_favorites', 'download_favorites');
Schema::table('download_favorites', fn (Blueprint $table) => $table->renameColumn('document_id', 'download_id'));
}
if (Schema::hasTable('downloads') && Schema::hasColumn('downloads', 'downloads')) {
Schema::table('downloads', fn (Blueprint $table) => $table->renameColumn('downloads', 'download_count'));
}
// Rechte und Sichtbarkeiten
DB::table('grants')->where('ability', 'documents.manage')->update(['ability' => 'downloads.manage']);
DB::table('grants')->where('ability', 'documents.edit')->update(['ability' => 'downloads.edit']);
DB::table('grants')->where('resource_type', 'document_folder')->update(['resource_type' => 'download_folder']);
DB::table('audiences')->where('resource_type', 'document_folder')->update(['resource_type' => 'download_folder']);
// Einstellungen: Menü-Einträge und Anordnung der Startseite
$this->updateSetting('navigation.menu', function (array $menu) {
$rename = function (array $item) use (&$rename) {
if (($item['type'] ?? null) === 'module' && ($item['module'] ?? null) === 'documents') {
$item['module'] = 'downloads';
}
if (isset($item['children']) && is_array($item['children'])) {
$item['children'] = array_map($rename, $item['children']);
}
return $item;
};
return array_map($rename, $menu);
});
$this->updateSetting('dashboard.layout', function (array $layout) {
if (isset($layout['documents.favorites'])) {
$layout['downloads.favorites'] = $layout['documents.favorites'];
unset($layout['documents.favorites']);
}
return $layout;
});
// Pagebuilder-Blöcke in Seiten und ihren Fassungen
foreach (['pages' => ['content', 'draft', 'scheduled_content'], 'page_revisions' => ['content']] as $table => $columns) {
if (! Schema::hasTable($table)) {
continue;
}
foreach ($columns as $column) {
DB::table($table)->where($column, 'like', '%documents.folder%')->orderBy('id')->each(function ($row) use ($table, $column) {
DB::table($table)->where('id', $row->id)->update([
$column => str_replace('"documents.folder"', '"downloads.folder"', $row->{$column}),
]);
});
}
}
// Plugin-Zustand (z. B. „deaktiviert“) übernehmen
$state = app(PluginState::class);
$old = $state->all()['documents'] ?? null;
if (is_array($old)) {
$state->setEnabled('downloads', (bool) ($old['enabled'] ?? true), $old['disabled_reason'] ?? null);
$state->forget('documents');
}
app(Settings::class)->flush();
Permissions::flush();
}
public function down(): void
{
// Umbenennung wird nicht zurückgenommen.
}
private function updateSetting(string $key, callable $change): void
{
$row = DB::table('settings')->where('key', $key)->first();
$value = $row ? json_decode((string) $row->value, true) : null;
if (is_array($value)) {
DB::table('settings')->where('key', $key)->update(['value' => json_encode($change($value), JSON_UNESCAPED_UNICODE)]);
}
}
};

View file

@ -0,0 +1,41 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
// Zweimal ausführen schadet nicht (Umbenennung älterer Installationen, siehe 2026_09_29_000002).
if (! Schema::hasTable('download_favorites')) {
Schema::create('download_favorites', function (Blueprint $table) {
$table->foreignId('user_id')->constrained()->cascadeOnDelete();
$table->foreignId('download_id')->constrained()->cascadeOnDelete();
$table->timestamp('created_at')->nullable();
$table->primary(['user_id', 'download_id']);
});
}
if (Schema::hasColumn('downloads', 'download_count')) {
return;
}
Schema::table('downloads', function (Blueprint $table) {
$table->unsignedInteger('download_count')->default(0)->after('updated_by');
$table->index('download_count');
});
}
public function down(): void
{
Schema::table('downloads', function (Blueprint $table) {
$table->dropIndex(['download_count']);
$table->dropColumn('download_count');
});
Schema::dropIfExists('download_favorites');
}
};

View file

@ -0,0 +1,13 @@
{
"slug": "downloads",
"name": "Downloads",
"version": "1.0.0",
"description": "Download-Bereich mit Ordnern, Versionen, Suche und Rechten je Ordner – z. B. Vorlagen, Anträge, Infomaterial. Für QM-Dokumente ist das QM-Modul gedacht.",
"author": "Inhaus",
"namespace": "Inhaus\\Plugins\\Downloads\\",
"class": "Inhaus\\Plugins\\Downloads\\DownloadsPlugin",
"requires": {
"core": ">=0.8.0",
"php": ">=8.3"
}
}

View file

@ -15,7 +15,7 @@ const formatSize = (bytes) => (bytes >= 1024 * 1024 ? `${(bytes / 1024 / 1024).t
<Link :href="block.props.folder_url" class="inline-flex items-center gap-0.5 text-[13px] font-medium text-brand-text hover:underline">Zum Ordner <ChevronRight class="size-3.5" /></Link>
</div>
<ul class="divide-y rounded-lg border bg-card">
<li v-for="doc in block.props.documents" :key="doc.id">
<li v-for="doc in block.props.downloads" :key="doc.id">
<a :href="doc.download_url" class="group flex items-center gap-3 px-4 py-3 hover:bg-accent/50">
<FileIcon :extension="doc.extension" />
<span class="min-w-0 flex-1">
@ -26,7 +26,7 @@ const formatSize = (bytes) => (bytes >= 1024 * 1024 ? `${(bytes / 1024 / 1024).t
<Download class="size-4 shrink-0 text-muted-foreground" />
</a>
</li>
<li v-if="!block.props.documents.length" class="px-4 py-3 text-sm text-muted-foreground">Keine Dokumente in diesem Ordner.</li>
<li v-if="!block.props.downloads.length" class="px-4 py-3 text-sm text-muted-foreground">Keine Dateien in diesem Ordner.</li>
</ul>
</section>
</template>

View file

@ -0,0 +1,59 @@
<script setup>
import { Link } from '@inertiajs/vue3';
import { Download, Folder, Star } from '@lucide/vue';
import { Button } from '@/components/ui/button';
import { formatShortDate } from '@/lib/format';
import { folderSummary, formatSize } from '../lib';
import DownloadMenu from './DownloadMenu.vue';
import FavoriteButton from './FavoriteButton.vue';
import DownloadThumb from './DownloadThumb.vue';
/**
* Kachelansicht: Ordner und Dateien als Karten.
*/
defineProps({
folders: { type: Array, default: () => [] },
downloads: { type: Array, default: () => [] },
canEdit: { type: Boolean, default: false },
});
defineEmits(['versions', 'new-version', 'edit', 'remove', 'favorite']);
</script>
<template>
<div class="grid gap-6">
<ul v-if="folders.length" class="grid grid-cols-[repeat(auto-fill,minmax(12.5rem,1fr))] gap-3">
<li v-for="folder in folders" :key="folder.id" class="group relative flex items-center gap-3 rounded-lg border bg-card p-3 hover:border-brand-300 hover:shadow-xs">
<span class="grid size-10 shrink-0 place-items-center rounded-md bg-brand-soft text-brand-text"><Folder class="size-5" :stroke-width="1.75" /></span>
<span class="min-w-0">
<Link :href="`/downloads/ordner/${folder.id}`" class="block truncate text-sm font-medium after:absolute after:inset-0 group-hover:underline">{{ folder.name }}</Link>
<span class="block truncate text-xs text-muted-foreground">{{ folderSummary(folder) }}</span>
</span>
</li>
</ul>
<ul v-if="downloads.length" class="grid grid-cols-[repeat(auto-fill,minmax(12.5rem,1fr))] gap-3">
<li v-for="doc in downloads" :key="doc.id" class="group relative flex flex-col rounded-lg border bg-card hover:border-brand-300 hover:shadow-xs">
<DownloadThumb :download="doc">
<span v-if="doc.version > 1" class="absolute bottom-2 left-2 rounded bg-card px-1.5 py-0.5 text-[11px] font-medium text-muted-foreground ring-1 ring-border">Fassung {{ doc.version }}</span>
<span v-if="doc.preview_url" class="absolute right-2 bottom-2 rounded bg-card px-1.5 py-0.5 text-[10px] font-bold tracking-wide text-muted-foreground uppercase ring-1 ring-border">{{ doc.extension }}</span>
</DownloadThumb>
<div class="flex min-h-0 flex-1 flex-col p-3">
<a v-if="doc.download_url" :href="doc.download_url" class="line-clamp-2 text-sm leading-snug font-medium after:absolute after:inset-0 hover:underline" :title="doc.name">{{ doc.title }}</a>
<span v-else class="line-clamp-2 text-sm leading-snug font-medium">{{ doc.title }}</span>
<p class="mt-auto pt-2 text-xs text-muted-foreground">
{{ formatShortDate(doc.updated_at) }} · {{ formatSize(doc.size) }}
</p>
</div>
<div v-if="doc.favorite" class="absolute top-2 left-2 z-10 text-amber-500"><Star class="size-4 fill-current" /></div>
<div class="absolute top-1.5 right-1.5 z-10 flex gap-0.5 rounded-md bg-card/90 opacity-0 shadow-xs ring-1 ring-border transition-opacity group-focus-within:opacity-100 group-hover:opacity-100 max-md:opacity-100">
<FavoriteButton :download="doc" @toggle="$emit('favorite', $event)" />
<Button v-if="doc.download_url" variant="ghost" size="icon" class="size-8 text-muted-foreground" as-child :title="`${doc.title} herunterladen`">
<a :href="doc.download_url" :aria-label="`${doc.title} herunterladen`"><Download /></a>
</Button>
<DownloadMenu :download="doc" :can-edit="canEdit" @versions="$emit('versions', $event)" @new-version="$emit('new-version', $event)" @edit="$emit('edit', $event)" @remove="$emit('remove', $event)" />
</div>
</li>
</ul>
</div>
</template>

View file

@ -0,0 +1,29 @@
<script setup>
import { EllipsisVertical, FilePlus2, History, PencilLine, Trash2 } from '@lucide/vue';
import { Button } from '@/components/ui/button';
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger } from '@/components/ui/dropdown-menu';
defineProps({
download: { type: Object, required: true },
canEdit: { type: Boolean, default: false },
});
defineEmits(['versions', 'new-version', 'edit', 'remove']);
</script>
<template>
<DropdownMenu>
<DropdownMenuTrigger as-child>
<Button variant="ghost" size="icon" class="size-8 text-muted-foreground" :aria-label="`Aktionen für ${download.title}`"><EllipsisVertical /></Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end" class="w-60">
<DropdownMenuItem @select="$emit('versions', download)"><History /> Fassungen anzeigen</DropdownMenuItem>
<template v-if="canEdit">
<DropdownMenuItem @select="$emit('new-version', download)"><FilePlus2 /> Neue Fassung hochladen</DropdownMenuItem>
<DropdownMenuItem @select="$emit('edit', download)"><PencilLine /> Bearbeiten oder verschieben</DropdownMenuItem>
<DropdownMenuSeparator />
<DropdownMenuItem class="text-destructive" @select="$emit('remove', download)"><Trash2 /> Löschen</DropdownMenuItem>
</template>
</DropdownMenuContent>
</DropdownMenu>
</template>

View file

@ -0,0 +1,32 @@
<script setup>
import FileIcon from './FileIcon.vue';
/**
* Kurze Liste für Seitenspalten (Meine Downloads, Häufig genutzt).
*/
defineProps({
title: { type: String, required: true },
icon: { type: [Object, Function], required: true },
downloads: { type: Array, required: true },
empty: { type: String, default: '' },
showDownloads: { type: Boolean, default: false },
});
</script>
<template>
<section class="rounded-lg border bg-card">
<h2 class="flex items-center gap-2 border-b px-4 py-2.5 text-sm font-semibold"><component :is="icon" class="size-4 text-brand-text" /> {{ title }}</h2>
<ul v-if="downloads.length" class="p-2">
<li v-for="doc in downloads" :key="doc.id">
<a :href="doc.download_url" class="flex items-center gap-3 rounded-md px-2 py-1.5 hover:bg-accent">
<FileIcon :extension="doc.extension" size="sm" />
<span class="min-w-0 flex-1">
<span class="block truncate text-[13px] font-medium">{{ doc.title }}</span>
<span class="block truncate text-xs text-muted-foreground">{{ doc.folder_name }}<template v-if="showDownloads"> · {{ doc.download_count.toLocaleString('de-DE') }}× geladen</template></span>
</span>
</a>
</li>
</ul>
<p v-else class="px-4 py-3 text-[13px] text-muted-foreground">{{ empty }}</p>
</section>
</template>

View file

@ -0,0 +1,119 @@
<script setup>
import { computed, ref } from 'vue';
import { Link } from '@inertiajs/vue3';
import { ArrowDown, ArrowUp, Download, Folder } from '@lucide/vue';
import { Button } from '@/components/ui/button';
import { formatRelative } from '@/lib/format';
import { folderSummary, formatSize } from '../lib';
import DownloadMenu from './DownloadMenu.vue';
import FavoriteButton from './FavoriteButton.vue';
import FileIcon from './FileIcon.vue';
/**
* Listenansicht wie in einer Dateiablage: Ordner oben, Dateien darunter,
* nach Name, Änderung oder Größe sortierbar.
*/
const props = defineProps({
folders: { type: Array, default: () => [] },
downloads: { type: Array, default: () => [] },
canEdit: { type: Boolean, default: false },
showFolder: { type: Boolean, default: false },
sortable: { type: Boolean, default: true },
compact: { type: Boolean, default: false }, // schmale Spalte: ohne Größe
});
defineEmits(['versions', 'new-version', 'edit', 'remove', 'favorite']);
const sort = ref({ key: 'title', dir: 1 });
function sortBy(key) {
sort.value = sort.value.key === key ? { key, dir: -sort.value.dir } : { key, dir: key === 'title' ? 1 : -1 };
}
const sorted = computed(() => {
if (!props.sortable) return props.downloads;
const { key, dir } = sort.value;
const value = (d) => (key === 'title' ? d.title.toLocaleLowerCase('de') : key === 'size' ? d.size : d.updated_at ?? '');
return [...props.downloads].sort((a, b) => (value(a) > value(b) ? dir : value(a) < value(b) ? -dir : 0));
});
const columns = computed(() => {
if (props.compact) return props.showFolder ? 'md:grid-cols-[minmax(0,1fr)_8rem_9.5rem_6.5rem]' : 'md:grid-cols-[minmax(0,1fr)_9.5rem_6.5rem]';
return props.showFolder ? 'md:grid-cols-[minmax(0,1fr)_12rem_11rem_5.5rem_6.5rem]' : 'md:grid-cols-[minmax(0,1fr)_11rem_5.5rem_6.5rem]';
});
</script>
<template>
<div class="overflow-hidden rounded-lg border bg-card">
<div class="hidden border-b bg-muted/40 px-4 py-2 text-xs font-medium text-muted-foreground md:grid md:items-center md:gap-4" :class="columns" role="row">
<button v-if="sortable" type="button" class="inline-flex items-center gap-1 text-left hover:text-foreground" @click="sortBy('title')">
Name <component :is="sort.dir > 0 ? ArrowUp : ArrowDown" v-if="sort.key === 'title'" class="size-3.5" />
</button>
<span v-else>Name</span>
<span v-if="showFolder">Ordner</span>
<button v-if="sortable" type="button" class="inline-flex items-center gap-1 text-left hover:text-foreground" @click="sortBy('updated_at')">
Geändert <component :is="sort.dir > 0 ? ArrowUp : ArrowDown" v-if="sort.key === 'updated_at'" class="size-3.5" />
</button>
<span v-else>Geändert</span>
<template v-if="!compact">
<button v-if="sortable" type="button" class="inline-flex items-center justify-end gap-1 hover:text-foreground" @click="sortBy('size')">
Größe <component :is="sort.dir > 0 ? ArrowUp : ArrowDown" v-if="sort.key === 'size'" class="size-3.5" />
</button>
<span v-else class="text-right">Größe</span>
</template>
<span class="sr-only">Aktionen</span>
</div>
<ul class="divide-y">
<li v-for="folder in folders" :key="`f${folder.id}`" class="group relative grid items-center gap-x-4 px-4 py-2 hover:bg-accent/60" :class="columns">
<div class="flex min-w-0 items-center gap-3">
<span class="grid size-8 shrink-0 place-items-center rounded-md bg-brand-soft text-brand-text"><Folder class="size-4" :stroke-width="1.75" /></span>
<div class="min-w-0">
<Link :href="`/downloads/ordner/${folder.id}`" class="block truncate text-sm font-medium after:absolute after:inset-0 group-hover:underline">{{ folder.name }}</Link>
<p class="truncate text-xs text-muted-foreground">{{ folderSummary(folder) }}</p>
</div>
</div>
<span v-if="showFolder" class="hidden md:block" />
<span class="hidden text-[13px] text-muted-foreground md:block">–</span>
<span v-if="!compact" class="hidden md:block" />
<span class="hidden md:block" />
</li>
<li v-for="doc in sorted" :key="doc.id" class="group relative grid items-center gap-x-4 py-2 pr-32 pl-4 hover:bg-accent/60 md:pr-4" :class="columns">
<div class="flex min-w-0 items-center gap-3">
<FileIcon :extension="doc.extension" size="sm" />
<div class="min-w-0">
<div class="flex min-w-0 items-baseline gap-2">
<a v-if="doc.download_url" :href="doc.download_url" class="truncate text-sm font-medium hover:underline" :title="doc.name">{{ doc.title }}</a>
<span v-else class="truncate text-sm font-medium">{{ doc.title }}</span>
<span class="hidden shrink-0 text-[11px] font-medium text-muted-foreground uppercase sm:inline">{{ doc.extension }}</span>
</div>
<p v-if="doc.description" class="truncate text-xs text-muted-foreground">{{ doc.description }}</p>
<p class="truncate text-xs text-muted-foreground md:hidden">
{{ formatRelative(doc.updated_at) }} · {{ formatSize(doc.size) }}<template v-if="showFolder && doc.folder_name"> · {{ doc.folder_name }}</template>
</p>
</div>
</div>
<Link v-if="showFolder" :href="`/downloads/ordner/${doc.folder_id}`" class="hidden truncate text-[13px] text-muted-foreground hover:text-foreground hover:underline md:block">{{ doc.folder_name }}</Link>
<div class="hidden min-w-0 text-[13px] md:block">
<div class="truncate leading-tight">{{ formatRelative(doc.updated_at) }}</div>
<div class="truncate text-xs leading-tight text-muted-foreground">
<template v-if="doc.updated_by">{{ doc.updated_by }}</template>
<template v-if="doc.version > 1">{{ doc.updated_by ? ' · ' : '' }}Fassung {{ doc.version }}</template>
</div>
</div>
<span v-if="!compact" class="hidden text-right text-[13px] text-muted-foreground tabular-nums md:block">{{ formatSize(doc.size) }}</span>
<div class="absolute top-1/2 right-2 flex -translate-y-1/2 items-center justify-end gap-0.5 md:static md:translate-y-0">
<FavoriteButton :download="doc" @toggle="$emit('favorite', $event)" />
<Button v-if="doc.download_url" variant="ghost" size="icon" class="size-8 text-muted-foreground" as-child :title="`${doc.title} herunterladen`">
<a :href="doc.download_url" :aria-label="`${doc.title} herunterladen`"><Download /></a>
</Button>
<DownloadMenu :download="doc" :can-edit="canEdit" @versions="$emit('versions', $event)" @new-version="$emit('new-version', $event)" @edit="$emit('edit', $event)" @remove="$emit('remove', $event)" />
</div>
</li>
</ul>
</div>
</template>

View file

@ -0,0 +1,56 @@
<script setup>
import { onBeforeUnmount, onMounted, ref } from 'vue';
import FileIcon from './FileIcon.vue';
/**
* Kopf einer Datei-Kachel: Vorschaubild (Bild oder erste PDF-Seite), sonst Dateitypsymbol.
* Geladen wird erst, wenn die Kachel ins Bild kommt.
*/
const props = defineProps({
download: { type: Object, required: true },
});
const root = ref(null);
const src = ref(null);
const failed = ref(false);
let observer;
async function load() {
if (props.download.preview_kind === 'image') {
src.value = props.download.preview_url;
return;
}
try {
const { pdfThumbnail } = await import('../pdfThumbnail');
src.value = await pdfThumbnail(props.download.preview_url);
} catch {
failed.value = true;
}
}
onMounted(() => {
if (!props.download.preview_url || typeof IntersectionObserver === 'undefined') return;
observer = new IntersectionObserver((entries) => {
if (entries.some((e) => e.isIntersecting)) {
observer.disconnect();
load();
}
}, { rootMargin: '200px' });
observer.observe(root.value);
});
onBeforeUnmount(() => observer?.disconnect());
</script>
<template>
<div ref="root" class="relative h-32 overflow-hidden rounded-t-lg border-b bg-muted/40">
<img v-if="src && !failed" :src="src" alt="" class="size-full object-cover object-top" loading="lazy" @error="failed = true" />
<div v-else class="grid size-full place-items-center">
<FileIcon :extension="download.extension" size="lg" />
</div>
<slot />
</div>
</template>

View file

@ -0,0 +1,23 @@
<script setup>
import { Star } from '@lucide/vue';
defineProps({
download: { type: Object, required: true },
});
defineEmits(['toggle']);
</script>
<template>
<button
type="button"
class="grid size-8 place-items-center rounded-md hover:bg-accent"
:class="download.favorite ? 'text-amber-500' : 'text-muted-foreground hover:text-foreground'"
:aria-pressed="download.favorite"
:title="download.favorite ? 'Aus „Meine Downloads“ entfernen' : 'In „Meine Downloads“ merken'"
:aria-label="download.favorite ? `${download.title} nicht mehr merken` : `${download.title} merken`"
@click="$emit('toggle', download)"
>
<Star class="size-4" :class="{ 'fill-current': download.favorite }" />
</button>
</template>

View file

@ -0,0 +1,44 @@
<script setup>
import { computed } from 'vue';
import { File, FileArchive, FileImage, FileSpreadsheet, FileText, Presentation } from '@lucide/vue';
/**
* Symbol und Farbe nach Dateityp – so erkennt man Word, Excel, PDF auf einen Blick.
*/
const props = defineProps({
extension: { type: String, default: '' },
size: { type: String, default: 'md' }, // sm | md | lg
});
const text = { icon: FileText };
const sheet = { icon: FileSpreadsheet };
const kinds = {
PDF: { ...text, class: 'bg-red-50 text-red-700 dark:bg-red-950/50 dark:text-red-300' },
DOC: { ...text, class: 'bg-sky-50 text-sky-700 dark:bg-sky-950/50 dark:text-sky-300' },
DOCX: { ...text, class: 'bg-sky-50 text-sky-700 dark:bg-sky-950/50 dark:text-sky-300' },
ODT: { ...text, class: 'bg-sky-50 text-sky-700 dark:bg-sky-950/50 dark:text-sky-300' },
RTF: { ...text, class: 'bg-sky-50 text-sky-700 dark:bg-sky-950/50 dark:text-sky-300' },
TXT: { ...text, class: 'bg-muted text-muted-foreground' },
XLS: { ...sheet, class: 'bg-emerald-50 text-emerald-700 dark:bg-emerald-950/50 dark:text-emerald-300' },
XLSX: { ...sheet, class: 'bg-emerald-50 text-emerald-700 dark:bg-emerald-950/50 dark:text-emerald-300' },
CSV: { ...sheet, class: 'bg-emerald-50 text-emerald-700 dark:bg-emerald-950/50 dark:text-emerald-300' },
ODS: { ...sheet, class: 'bg-emerald-50 text-emerald-700 dark:bg-emerald-950/50 dark:text-emerald-300' },
PPT: { icon: Presentation, class: 'bg-orange-50 text-orange-700 dark:bg-orange-950/50 dark:text-orange-300' },
PPTX: { icon: Presentation, class: 'bg-orange-50 text-orange-700 dark:bg-orange-950/50 dark:text-orange-300' },
JPG: { icon: FileImage, class: 'bg-violet-50 text-violet-700 dark:bg-violet-950/50 dark:text-violet-300' },
JPEG: { icon: FileImage, class: 'bg-violet-50 text-violet-700 dark:bg-violet-950/50 dark:text-violet-300' },
PNG: { icon: FileImage, class: 'bg-violet-50 text-violet-700 dark:bg-violet-950/50 dark:text-violet-300' },
ZIP: { icon: FileArchive, class: 'bg-amber-50 text-amber-700 dark:bg-amber-950/50 dark:text-amber-300' },
};
const kind = computed(() => kinds[props.extension?.toUpperCase()] ?? { icon: File, class: 'bg-muted text-muted-foreground' });
const box = computed(() => ({ sm: 'size-8 rounded-md', md: 'size-10 rounded-md', lg: 'size-14 rounded-lg' })[props.size]);
const glyph = computed(() => ({ sm: 'size-4', md: 'size-5', lg: 'size-7' })[props.size]);
</script>
<template>
<span class="relative grid shrink-0 place-items-center" :class="[box, kind.class]" :title="extension || undefined">
<component :is="kind.icon" :class="glyph" :stroke-width="1.75" />
<span v-if="extension && size !== 'sm'" class="absolute -bottom-1.5 rounded-[3px] bg-card px-1 text-[9px] leading-tight font-bold tracking-wide text-current ring-1 ring-border">{{ extension }}</span>
</span>
</template>

View file

@ -14,7 +14,7 @@ defineProps({
<ul class="grid gap-0.5" :class="depth ? 'ml-3 border-l pl-2' : ''">
<li v-for="item in items" :key="item.id">
<Link
:href="`/dokumente/ordner/${item.id}`"
:href="`/downloads/ordner/${item.id}`"
class="flex items-center gap-2 rounded-md px-2.5 py-1.5 text-sm"
:class="item.id === currentId ? 'bg-brand-soft font-medium text-brand-soft-foreground' : 'text-foreground/80 hover:bg-accent hover:text-foreground'"
preserve-scroll

View file

@ -0,0 +1,17 @@
export const formatSize = (bytes) => {
if (!bytes) return '–';
if (bytes >= 1024 * 1024) return `${(bytes / 1024 / 1024).toFixed(1).replace('.', ',')} MB`;
return `${Math.max(1, Math.round(bytes / 1024))} KB`;
};
export const entries = (n, one, many) => `${n.toLocaleString('de-DE')} ${n === 1 ? one : many}`;
/** „3 Dateien · 2 Ordner“ – leere Teile weglassen. */
export function folderSummary(folder) {
const parts = [];
if (folder.folders) parts.push(entries(folder.folders, 'Ordner', 'Ordner'));
if (folder.downloads) parts.push(entries(folder.downloads, 'Datei', 'Dateien'));
return parts.join(' · ') || 'Noch leer';
}

View file

@ -0,0 +1,433 @@
<script setup>
import { computed, ref, watch } from 'vue';
import { Link, router, useForm, usePage } from '@inertiajs/vue3';
import { Clock, Download, EllipsisVertical, Folder, FolderPlus, FolderTree, Info, LayoutGrid, LibraryBig, List, LoaderCircle, PencilLine, Search, Star, Trash2, TrendingUp, Upload } from '@lucide/vue';
import { toast } from 'vue-sonner';
import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import { Skeleton } from '@/components/ui/skeleton';
import { Textarea } from '@/components/ui/textarea';
import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle } from '@/components/ui/dialog';
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger } from '@/components/ui/dropdown-menu';
import EmptyState from '@/components/EmptyState.vue';
import FormField from '@/components/FormField.vue';
import NativeSelect from '@/components/NativeSelect.vue';
import PageHeader from '@/components/PageHeader.vue';
import AppLayout from '@/layouts/AppLayout.vue';
import { http } from '@/lib/http';
import { formatRelative } from '@/lib/format';
import { useStoredChoice } from '@/composables/useStoredChoice';
import DownloadGrid from '../components/DownloadGrid.vue';
import DownloadMiniList from '../components/DownloadMiniList.vue';
import DownloadTable from '../components/DownloadTable.vue';
import FolderTreeNav from '../components/FolderTreeNav.vue';
import { entries, folderSummary, formatSize } from '../lib';
const props = defineProps({
tree: { type: Array, required: true },
folder: { type: Object, default: null },
breadcrumbs: { type: Array, default: () => [] },
children: { type: Array, default: () => [] },
downloads: { type: Array, default: () => [] },
recent: { type: Array, default: () => [] },
favorites: { type: Array, default: () => [] },
popular: { type: Array, default: () => [] },
search: { type: String, default: '' },
canCreateRoot: { type: Boolean, default: false },
folderOptions: { type: Array, default: () => [] },
maxUploadMb: { type: Number, default: 20 },
});
const page = usePage();
watch(() => page.props.flash.status, (status) => status && toast.success(status), { immediate: true });
const openIds = computed(() => props.breadcrumbs.map((b) => b.id));
const canEdit = computed(() => !!props.folder?.can_edit);
const title = computed(() => (props.search ? `Suche: ${props.search}` : props.folder?.name ?? 'Downloads'));
// Jüngste Änderung im Ordner – aus denselben Angaben wie die Liste.
const lastChange = computed(() => props.downloads.map((d) => d.updated_at).filter(Boolean).sort().at(-1) ?? null);
const crumbs = computed(() => (isHome.value ? [] : [{ label: 'Downloads', href: '/downloads' }, ...props.breadcrumbs.map((b) => ({ label: b.name, href: `/downloads/ordner/${b.id}` }))]));
const isHome = computed(() => !props.folder && !props.search);
const view = useStoredChoice('downloads.view', 'list', ['list', 'grid']);
const summary = computed(() => {
const parts = [];
if (props.children.length && !props.search) parts.push(entries(props.children.length, 'Ordner', 'Ordner'));
parts.push(entries(props.downloads.length, props.search ? 'Treffer' : 'Datei', props.search ? 'Treffer' : 'Dateien'));
return parts.join(' · ');
});
// Aktionen aus Liste und Kacheln (v-on mit Ereignisnamen).
const handlers = {
versions: (doc) => showVersions(doc),
'new-version': (doc) => {
versionFor.value = doc;
versionForm.reset();
},
edit: (doc) => edit(doc),
remove: (doc) => remove(doc),
favorite: (doc) => toggleFavorite(doc),
};
function toggleFavorite(doc) {
const url = `/downloads/${doc.id}/favorit`;
const options = { preserveScroll: true, preserveState: true };
doc.favorite ? router.delete(url, options) : router.post(url, {}, options);
}
// Suche
const query = ref(props.search);
function submitSearch() {
router.get(props.folder ? `/downloads/ordner/${props.folder.id}` : '/downloads', query.value.trim() ? { q: query.value.trim() } : {}, { preserveState: true });
}
// Hochladen (auch per Ziehen und Ablegen)
const upload = useForm({ files: [] });
const dragging = ref(false);
const fileInput = ref(null);
function sendFiles(files) {
if (!canEdit.value || !files.length) return;
const tooLarge = files.find((f) => f.size > props.maxUploadMb * 1024 * 1024);
if (tooLarge) {
toast.error(`„${tooLarge.name}“ ist größer als ${props.maxUploadMb} MB.`);
return;
}
upload.files = files;
upload.post(`/downloads/ordner/${props.folder.id}/dateien`, {
forceFormData: true,
preserveScroll: true,
onError: (errors) => toast.error(Object.values(errors)[0]),
onFinish: () => upload.reset(),
});
}
function onDrop(event) {
dragging.value = false;
sendFiles([...(event.dataTransfer?.files ?? [])]);
}
// Neue Fassung
const versionFor = ref(null);
const versionForm = useForm({ file: null, note: '' });
function submitVersion() {
versionForm.post(`/downloads/${versionFor.value.id}/versionen`, {
forceFormData: true,
preserveScroll: true,
onSuccess: () => {
versionFor.value = null;
versionForm.reset();
},
});
}
// Bearbeiten
const editing = ref(null);
const editForm = useForm({ title: '', description: '', folder_id: null });
function edit(doc) {
editing.value = doc;
editForm.defaults({ title: doc.title, description: doc.description ?? '', folder_id: doc.folder_id });
editForm.reset();
editForm.clearErrors();
}
function submitEdit() {
editForm.put(`/downloads/${editing.value.id}`, { preserveScroll: true, onSuccess: () => (editing.value = null) });
}
function remove(doc) {
if (window.confirm(`„${doc.title}“ mit allen Fassungen löschen?`)) {
router.delete(`/downloads/${doc.id}`, { preserveScroll: true });
}
}
// Fassungen
const history = ref(null);
const versions = ref([]);
async function showVersions(doc) {
history.value = doc;
versions.value = [];
versions.value = (await http.get(`/downloads/${doc.id}/versionen`)).versions;
}
// Ordner
const folderDialog = ref(null); // 'new' | 'rename'
const folderForm = useForm({ name: '', parent_id: null });
function openFolderDialog(mode) {
folderDialog.value = mode;
folderForm.clearErrors();
folderForm.name = mode === 'rename' ? props.folder.name : '';
folderForm.parent_id = mode === 'new' ? props.folder?.id ?? null : null;
}
function submitFolder() {
if (folderDialog.value === 'rename') {
folderForm.transform((data) => ({ name: data.name, description: props.folder.description })).put(`/downloads/ordner/${props.folder.id}`, { onSuccess: () => (folderDialog.value = null) });
} else {
folderForm.transform((data) => data).post('/downloads/ordner', { onSuccess: () => (folderDialog.value = null) });
}
}
function deleteFolder() {
if (window.confirm(`Ordner „${props.folder.name}“ löschen?`)) {
router.delete(`/downloads/ordner/${props.folder.id}`, { onError: (errors) => toast.error(Object.values(errors)[0]) });
}
}
</script>
<template>
<AppLayout :title="title">
<div class="grid gap-6 lg:grid-cols-[240px_minmax(0,1fr)]">
<aside class="hidden lg:block">
<nav class="sticky top-20 rounded-lg border bg-card" aria-label="Ordner">
<div class="flex items-center gap-2 border-b px-4 py-2.5 text-sm font-semibold"><FolderTree class="size-4 text-brand-text" /> Ablage</div>
<div class="max-h-[calc(100vh-12rem)] overflow-y-auto p-2">
<Link
href="/downloads"
class="mb-0.5 flex items-center gap-2 rounded-md px-2.5 py-1.5 text-sm"
:class="isHome ? 'bg-brand-soft font-medium text-brand-soft-foreground' : 'text-foreground/80 hover:bg-accent hover:text-foreground'"
>
<LibraryBig class="size-4 shrink-0" /> Übersicht
</Link>
<FolderTreeNav :items="tree" :current-id="folder?.id ?? null" :open-ids="openIds" />
<p v-if="!tree.length" class="px-2.5 py-2 text-[13px] text-muted-foreground">Noch keine Ordner.</p>
</div>
</nav>
</aside>
<section
class="relative min-w-0"
@dragover.prevent="canEdit && (dragging = true)"
@drop.prevent="onDrop"
>
<PageHeader :title="title" :breadcrumbs="crumbs" :description="isHome ? 'Vorlagen, Anträge und Infomaterial – immer in der aktuellen Fassung.' : !search ? folder?.description ?? '' : ''">
<template #actions>
<Button v-if="isHome && canCreateRoot" variant="outline" class="h-10" @click="openFolderDialog('new')"><FolderPlus /> Ordner anlegen</Button>
<form class="relative w-full sm:w-72" role="search" @submit.prevent="submitSearch">
<Search class="pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2 text-muted-foreground" />
<Input v-model="query" type="search" class="h-10 bg-card pl-9" placeholder="Downloads durchsuchen …" aria-label="Downloads durchsuchen" />
</form>
</template>
</PageHeader>
<!-- Startseite der Ablage -->
<template v-if="isHome">
<ul v-if="children.length" class="mb-7 grid grid-cols-[repeat(auto-fill,minmax(17rem,1fr))] gap-4">
<li v-for="area in children" :key="area.id" class="group relative flex flex-col rounded-lg border bg-card hover:border-brand-300">
<div class="flex items-start gap-3 p-4">
<span class="grid size-10 shrink-0 place-items-center rounded-md bg-brand text-white"><Folder class="size-5" :stroke-width="1.75" /></span>
<div class="min-w-0">
<Link :href="`/downloads/ordner/${area.id}`" class="text-[15px] leading-tight font-semibold after:absolute after:inset-0 group-hover:underline">{{ area.name }}</Link>
<p v-if="area.description" class="mt-0.5 line-clamp-2 text-[13px] leading-snug text-muted-foreground">{{ area.description }}</p>
<p v-if="area.subfolders.length" class="relative z-10 mt-1 truncate text-xs text-muted-foreground">
<template v-for="(sub, index) in area.subfolders" :key="sub.id">
<span v-if="index"> · </span><Link :href="`/downloads/ordner/${sub.id}`" class="hover:text-foreground hover:underline">{{ sub.name }}</Link>
</template>
</p>
</div>
</div>
<div class="mt-auto border-t bg-muted/30 px-4 py-2 text-xs font-medium text-brand-text">{{ folderSummary(area) }}</div>
</li>
</ul>
<div v-else class="mb-5 rounded-lg border bg-card"><EmptyState :icon="Folder" title="Noch keine Downloads" text="Sobald Ordner angelegt sind, erscheinen sie hier." /></div>
<div class="grid items-start gap-5 xl:grid-cols-[minmax(0,1fr)_18rem]">
<div v-if="recent.length" class="min-w-0">
<h2 class="mb-3 flex items-center gap-2 text-sm font-semibold"><Clock class="size-4 text-brand-text" /> Zuletzt aktualisiert</h2>
<DownloadTable :downloads="recent" show-folder compact :sortable="false" v-on="handlers" />
</div>
<aside class="grid gap-5 xl:pt-8">
<DownloadMiniList title="Meine Downloads" :icon="Star" :downloads="favorites" empty="Mit dem Stern merken Sie sich Dateien – sie erscheinen hier und auf der Startseite." />
<DownloadMiniList v-if="popular.length" title="Häufig genutzt" :icon="TrendingUp" :downloads="popular" show-downloads />
</aside>
</div>
</template>
<!-- Ordner oder Suche -->
<template v-else>
<div class="mb-4 flex flex-wrap items-center justify-between gap-3">
<p class="text-[13px] text-muted-foreground">{{ summary }}</p>
<div class="flex items-center gap-2">
<div class="inline-flex rounded-md border bg-card p-0.5" role="group" aria-label="Ansicht">
<button
v-for="option in [{ key: 'list', icon: List, label: 'Liste' }, { key: 'grid', icon: LayoutGrid, label: 'Kacheln' }]"
:key="option.key"
type="button"
class="inline-flex h-8 items-center gap-1.5 rounded px-2.5 text-[13px]"
:class="view === option.key ? 'bg-brand-soft font-medium text-brand-soft-foreground' : 'text-muted-foreground hover:text-foreground'"
:aria-pressed="view === option.key"
@click="view = option.key"
>
<component :is="option.icon" class="size-4" /> <span class="hidden sm:inline">{{ option.label }}</span>
</button>
</div>
<Button v-if="canEdit" :disabled="upload.processing" @click="fileInput?.click()">
<LoaderCircle v-if="upload.processing" class="animate-spin" />
<Upload v-else /> Hochladen
</Button>
<input ref="fileInput" type="file" multiple class="hidden" @change="sendFiles([...$event.target.files]); $event.target.value = ''" />
<DropdownMenu v-if="canEdit">
<DropdownMenuTrigger as-child><Button variant="outline" size="icon" aria-label="Ordner-Aktionen"><EllipsisVertical /></Button></DropdownMenuTrigger>
<DropdownMenuContent align="end">
<DropdownMenuItem @select="openFolderDialog('new')"><FolderPlus /> Unterordner anlegen</DropdownMenuItem>
<DropdownMenuItem @select="openFolderDialog('rename')"><PencilLine /> Ordner umbenennen</DropdownMenuItem>
<DropdownMenuSeparator v-if="folder.can_delete" />
<DropdownMenuItem v-if="folder.can_delete" class="text-destructive" @select="deleteFolder"><Trash2 /> Ordner löschen</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
</div>
</div>
<div v-if="upload.processing && upload.progress" class="mb-3 h-1.5 overflow-hidden rounded-full bg-muted" role="progressbar" :aria-valuenow="upload.progress.percentage">
<div class="h-full bg-brand transition-all" :style="{ width: `${upload.progress.percentage}%` }" />
</div>
<div class="grid items-start gap-5" :class="{ 'xl:grid-cols-[minmax(0,1fr)_16rem]': folder && !search }">
<div class="min-w-0">
<template v-if="(children.length && !search) || downloads.length">
<DownloadTable v-if="view === 'list'" :folders="search ? [] : children" :downloads="downloads" :can-edit="canEdit" :show-folder="!!search" v-on="handlers" />
<DownloadGrid v-else :folders="search ? [] : children" :downloads="downloads" :can-edit="canEdit" v-on="handlers" />
</template>
<div v-else-if="search" class="rounded-lg border bg-card"><EmptyState :icon="Search" title="Keine Treffer" :text="`Nichts gefunden zu „${search}“. Gesucht wird in Titeln, Beschreibungen und Dateinamen.`" /></div>
<button
v-else-if="canEdit"
type="button"
class="grid w-full place-items-center rounded-lg border-2 border-dashed bg-card px-6 py-14 text-center hover:border-brand-300"
@click="fileInput?.click()"
>
<Upload class="size-8 text-muted-foreground" :stroke-width="1.5" />
<span class="mt-3 text-sm font-medium">Dieser Ordner ist leer</span>
<span class="mt-1 text-[13px] text-muted-foreground">Dateien hierher ziehen oder klicken, um sie auszuwählen – bis {{ maxUploadMb }} MB je Datei.</span>
</button>
<div v-else class="rounded-lg border bg-card"><EmptyState :icon="Folder" title="Dieser Ordner ist leer" /></div>
</div>
<aside v-if="folder && !search" class="hidden overflow-hidden rounded-lg border bg-card text-[13px] xl:block">
<h2 class="flex items-center gap-2 border-b px-4 py-2.5 text-sm font-semibold"><Info class="size-4 text-brand-text" /> Über diesen Ordner</h2>
<dl class="grid gap-3 p-4">
<div class="grid grid-cols-2 gap-2">
<div class="rounded-md bg-muted/50 px-3 py-2">
<dt class="text-xs text-muted-foreground">Dateien</dt>
<dd class="text-lg font-semibold tabular-nums">{{ downloads.length }}</dd>
</div>
<div class="rounded-md bg-muted/50 px-3 py-2">
<dt class="text-xs text-muted-foreground">Ordner</dt>
<dd class="text-lg font-semibold tabular-nums">{{ children.length }}</dd>
</div>
</div>
<div v-if="lastChange">
<dt class="text-xs text-muted-foreground">Zuletzt geändert</dt>
<dd>{{ formatRelative(lastChange) }}</dd>
</div>
<div>
<dt class="text-xs text-muted-foreground">Gepflegt von</dt>
<dd v-if="folder.editors.length" class="mt-1 flex flex-wrap gap-1">
<span v-for="role in folder.editors" :key="role" class="rounded bg-brand-soft px-1.5 py-0.5 text-xs text-brand-soft-foreground">{{ role }}</span>
</dd>
<dd v-else>Administration</dd>
</div>
<div v-if="canEdit" class="rounded-md border border-dashed px-3 py-2 text-xs text-muted-foreground">
Dateien einfach in die Liste ziehen. Bis {{ maxUploadMb }} MB je Datei, ältere Fassungen bleiben erhalten.
</div>
</dl>
</aside>
</div>
</template>
<div
v-if="dragging && canEdit"
class="absolute inset-0 z-20 grid place-items-center rounded-lg border-2 border-dashed border-brand-400 bg-brand-soft/90 text-center backdrop-blur-[1px]"
@dragleave.self="dragging = false"
>
<div>
<Upload class="mx-auto size-8 text-brand-text" />
<p class="mt-2 text-sm font-semibold text-brand-soft-foreground">Loslassen, um in „{{ folder.name }}“ hochzuladen</p>
</div>
</div>
</section>
</div>
<!-- Neue Fassung -->
<Dialog :open="!!versionFor" @update:open="(v) => !v && (versionFor = null)">
<DialogContent class="sm:max-w-md">
<DialogHeader>
<DialogTitle>Neue Fassung</DialogTitle>
<DialogDescription>„{{ versionFor?.title }}“ – die bisherige Fassung bleibt unter „Fassungen“ abrufbar.</DialogDescription>
</DialogHeader>
<form class="grid gap-4" @submit.prevent="submitVersion">
<FormField id="version-file" label="Datei" :error="versionForm.errors.file">
<input id="version-file" type="file" class="text-sm" @change="versionForm.file = $event.target.files[0]" />
</FormField>
<FormField id="version-note" label="Was hat sich geändert? (optional)" :error="versionForm.errors.note">
<Input id="version-note" v-model="versionForm.note" maxlength="500" />
</FormField>
<DialogFooter>
<Button type="button" variant="outline" @click="versionFor = null">Abbrechen</Button>
<Button type="submit" :disabled="!versionForm.file || versionForm.processing">Hochladen</Button>
</DialogFooter>
</form>
</DialogContent>
</Dialog>
<!-- Bearbeiten -->
<Dialog :open="!!editing" @update:open="(v) => !v && (editing = null)">
<DialogContent class="sm:max-w-lg">
<DialogHeader><DialogTitle>Datei bearbeiten</DialogTitle></DialogHeader>
<form class="grid gap-4" @submit.prevent="submitEdit">
<FormField id="doc-title" label="Titel" :error="editForm.errors.title"><Input id="doc-title" v-model="editForm.title" maxlength="250" /></FormField>
<FormField id="doc-description" label="Beschreibung" :error="editForm.errors.description"><Textarea id="doc-description" v-model="editForm.description" rows="3" maxlength="2000" /></FormField>
<FormField id="doc-folder" label="Ordner" :error="editForm.errors.folder_id"><NativeSelect id="doc-folder" v-model="editForm.folder_id" :options="folderOptions" /></FormField>
<DialogFooter>
<Button type="button" variant="outline" @click="editing = null">Abbrechen</Button>
<Button type="submit" :disabled="editForm.processing">Speichern</Button>
</DialogFooter>
</form>
</DialogContent>
</Dialog>
<!-- Fassungen -->
<Dialog :open="!!history" @update:open="(v) => !v && (history = null)">
<DialogContent class="sm:max-w-lg">
<DialogHeader><DialogTitle>Fassungen</DialogTitle><DialogDescription>{{ history?.title }}</DialogDescription></DialogHeader>
<ul v-if="!versions.length" class="-mx-2 divide-y" aria-busy="true">
<li v-for="n in 3" :key="n" class="flex items-center gap-3 px-2 py-2.5">
<Skeleton class="size-8" />
<div class="grid flex-1 gap-1.5"><Skeleton class="h-3.5 w-2/3" /><Skeleton class="h-3 w-1/3" /></div>
</li>
</ul>
<ul v-else class="-mx-2 divide-y">
<li v-for="v in versions" :key="v.version" class="flex items-center gap-3 px-2 py-2.5">
<span class="grid size-8 place-items-center rounded-md bg-muted text-xs font-semibold">{{ v.version }}</span>
<div class="min-w-0 flex-1">
<p class="truncate text-sm">{{ v.name }} <span v-if="v.current" class="ml-1 rounded bg-brand-soft px-1.5 py-0.5 text-[11px] text-brand-soft-foreground">aktuell</span></p>
<p class="text-xs text-muted-foreground">{{ formatRelative(v.created_at) }}<template v-if="v.uploader"> · {{ v.uploader }}</template> · {{ formatSize(v.size) }}</p>
<p v-if="v.note" class="text-xs">{{ v.note }}</p>
</div>
<Button variant="ghost" size="icon" as-child :title="`Fassung ${v.version} herunterladen`"><a :href="v.download_url"><Download /></a></Button>
</li>
</ul>
</DialogContent>
</Dialog>
<!-- Ordner -->
<Dialog :open="!!folderDialog" @update:open="(v) => !v && (folderDialog = null)">
<DialogContent class="sm:max-w-md">
<DialogHeader><DialogTitle>{{ folderDialog === 'rename' ? 'Ordner umbenennen' : folder ? `Unterordner in „${folder.name}“` : 'Neuer Ordner' }}</DialogTitle></DialogHeader>
<form class="grid gap-4" @submit.prevent="submitFolder">
<FormField id="folder-name" label="Name" :error="folderForm.errors.name"><Input id="folder-name" v-model="folderForm.name" maxlength="120" autofocus /></FormField>
<DialogFooter>
<Button type="button" variant="outline" @click="folderDialog = null">Abbrechen</Button>
<Button type="submit" :disabled="folderForm.processing || !folderForm.name.trim()">Speichern</Button>
</DialogFooter>
</form>
</DialogContent>
</Dialog>
</AppLayout>
</template>

View file

@ -0,0 +1,47 @@
/**
* Erste Seite eines PDFs als kleines Bild – im Browser mit pdf.js, damit der
* Server (Shared Hosting) keine Bildbearbeitung braucht. pdf.js wird erst
* geladen, wenn tatsächlich ein Vorschaubild gebraucht wird.
*/
const cache = new Map();
let library = null;
async function pdfjs() {
library ??= Promise.all([import('pdfjs-dist'), import('pdfjs-dist/build/pdf.worker.min.mjs?url')]).then(([lib, worker]) => {
lib.GlobalWorkerOptions.workerSrc = worker.default;
return lib;
});
return library;
}
export function pdfThumbnail(url, width = 360) {
if (!cache.has(url)) {
cache.set(
url,
(async () => {
const lib = await pdfjs();
const pdf = await lib.getDownload({ url, isEvalSupported: false, enableXfa: false }).promise;
try {
const page = await pdf.getPage(1);
const viewport = page.getViewport({ scale: width / page.getViewport({ scale: 1 }).width });
const canvas = document.createElement('canvas');
canvas.width = Math.round(viewport.width);
canvas.height = Math.round(viewport.height);
await page.render({ canvasContext: canvas.getContext('2d'), viewport }).promise;
return canvas.toDataURL('image/jpeg', 0.82);
} finally {
pdf.destroy();
}
})().catch((error) => {
cache.delete(url);
throw error;
}),
);
}
return cache.get(url);
}

View file

@ -0,0 +1,31 @@
<script setup>
import { Star } from '@lucide/vue';
import Panel from '@/components/Panel.vue';
import FileIcon from '../components/FileIcon.vue';
/**
* Startseite: gemerkte Dateien (Stern) – ohne Favoriten die meistgenutzten.
*/
const props = defineProps({
favorites: { type: Array, default: () => [] },
popular: { type: Array, default: () => [] },
});
const items = props.favorites.length ? props.favorites : props.popular;
</script>
<template>
<Panel :title="favorites.length ? 'Meine Downloads' : 'Häufig genutzt'" action-label="Alle Downloads" action-href="/downloads">
<ul v-if="items.length" class="-my-1.5 grid gap-0.5">
<li v-for="doc in items" :key="doc.id">
<a :href="doc.download_url" class="-mx-2 flex items-center gap-3 rounded-md px-2 py-1.5 hover:bg-accent">
<FileIcon :extension="doc.extension" size="sm" />
<span class="min-w-0 flex-1 truncate text-sm">{{ doc.title }}</span>
</a>
</li>
</ul>
<p v-if="!favorites.length" class="text-[13px] text-muted-foreground" :class="{ 'mt-3 border-t pt-3': items.length }">
<Star class="-mt-0.5 mr-1 inline size-3.5" />Mit dem Stern unter „Downloads“ merken Sie sich Dateien für diese Kachel.
</p>
</Panel>
</template>

View file

@ -0,0 +1,27 @@
<?php
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
use Inhaus\Plugins\Downloads\Http\Controllers\DownloadController;
Route::middleware('auth')->prefix('downloads')->name('downloads.')->controller(DownloadController::class)->where(['download' => '[0-9]+', 'folder' => '[0-9]+', 'version' => '[0-9]+'])->group(function () {
Route::get('/', 'index')->name('index');
Route::get('/ordner/{folder}', 'folder')->name('folder');
Route::post('/ordner', 'storeFolder')->name('folders.store');
Route::put('/ordner/{folder}', 'updateFolder')->name('folders.update');
Route::delete('/ordner/{folder}', 'destroyFolder')->name('folders.destroy');
Route::post('/ordner/{folder}/dateien', 'upload')->name('upload');
Route::put('/{download}', 'update')->name('update');
Route::delete('/{download}', 'destroy')->name('destroy');
Route::post('/{download}/versionen', 'newVersion')->name('versions.store');
Route::get('/{download}/versionen', 'versions')->name('versions');
Route::post('/{download}/favorit', 'favorite')->name('favorite');
Route::delete('/{download}/favorit', 'unfavorite')->name('unfavorite');
Route::get('/{download}/herunterladen/{version}/{name}', 'download')->name('download');
});
// Früher hieß der Bereich „Dokumente“ – alte Links und Lesezeichen führen weiter.
Route::get('/dokumente/{path?}', fn (Request $request, ?string $path = null) => redirect(
'/downloads'.($path ? '/'.$path : '').($request->getQueryString() ? '?'.$request->getQueryString() : ''),
301,
))->where('path', '.*')->name('downloads.legacy');

View file

@ -0,0 +1,42 @@
<?php
namespace Inhaus\Plugins\Downloads;
use Inhaus\Plugins\Downloads\Models\Download;
final class DownloadPresenter
{
/**
* @return array<string, mixed>
*/
/** Dateitypen, die für Vorschaubilder im Browser ausgeliefert werden (kein SVG/HTML). */
public const PREVIEW_MIMES = ['application/pdf', 'image/jpeg', 'image/png', 'image/gif', 'image/webp'];
/** Größere PDFs lädt die Kachelansicht nicht für ein Vorschaubild. */
public const PREVIEW_MAX_BYTES = 8 * 1024 * 1024;
public static function row(Download $download, ?string $folderName = null, bool $favorite = false): array
{
$version = $download->currentVersion;
$previewable = $version && in_array($version->mime, self::PREVIEW_MIMES, true) && $version->size <= self::PREVIEW_MAX_BYTES;
return [
'id' => $download->id,
'title' => $download->title,
'description' => $download->description,
'folder_id' => $download->folder_id,
'folder_name' => $folderName,
'version' => $version?->version,
'name' => $version?->name,
'extension' => $version?->extension(),
'size' => (int) ($version?->size ?? 0),
'updated_by' => $version?->relationLoaded('uploader') ? $version->uploader?->name : null,
'updated_at' => ($version?->created_at ?? $download->updated_at)?->toIso8601String(),
'download_url' => $version ? $download->downloadUrl($version) : null,
'preview_url' => $previewable ? $download->downloadUrl($version).'?vorschau=1' : null,
'preview_kind' => $previewable ? ($version->mime === 'application/pdf' ? 'pdf' : 'image') : null,
'favorite' => $favorite,
'download_count' => (int) $download->download_count,
];
}
}

View file

@ -0,0 +1,78 @@
<?php
namespace Inhaus\Plugins\Downloads;
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;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Gate;
use Inhaus\Plugins\Downloads\Models\Download;
use Inhaus\Plugins\Downloads\Models\DownloadFolder;
use Inhaus\Plugins\Downloads\Policies\DownloadFolderPolicy;
class DownloadsPlugin extends Plugin
{
public function register(): void
{
$this->app->singleton(FolderTree::class);
$this->app->make(Navigation::class)->add('downloads', 'Downloads', '/downloads', active: 'downloads.*', sort: 50);
$abilities = $this->app->make(Abilities::class);
$abilities->define('downloads.manage', 'Downloads: gesamten Bereich verwalten', 'Downloads');
$abilities->define('downloads.edit', 'Downloads pflegen', 'Downloads', resource: 'download_folder');
$abilities->resourceType(
'download_folder',
'Download-Ordner',
fn () => $this->app->make(FolderTree::class)->options(),
fn (array $ids) => $this->app->make(FolderTree::class)->descendantIds($ids),
);
Gate::policy(DownloadFolder::class, DownloadFolderPolicy::class);
// Startseite: gemerkte Dateien – ohne Favoriten die meistgenutzten.
$this->app->make(Widgets::class)->add('downloads.favorites', 'downloads::MyDownloads', 'aside', sort: 25, props: function (User $user) {
$visible = $this->app->make(FolderTree::class)->visibleIds($user) ?: [0];
$favorites = Download::query()->whereIn('folder_id', $visible)
->whereIn('id', DB::table('download_favorites')->where('user_id', $user->id)->select('download_id'))
->with('currentVersion')->orderBy('title')->limit(6)->get();
$popular = $favorites->isEmpty()
? Download::query()->whereIn('folder_id', $visible)->where('download_count', '>', 0)->with('currentVersion')->orderByDesc('download_count')->limit(5)->get()
: collect();
return [
'favorites' => $favorites->map(fn (Download $d) => DownloadPresenter::row($d, null, true))->all(),
'popular' => $popular->map(fn (Download $d) => DownloadPresenter::row($d))->all(),
];
}, label: 'Meine Downloads');
$this->app->make(Blocks::class)->add(BlockType::make('downloads.folder', 'Downloads', 'file-down', 'dynamic', 'downloads::FolderBlock')
->description('Die Dateien eines Download-Ordners – immer in der aktuellen Fassung.')
->fields([
Field::text('title', 'Überschrift', 150),
Field::select('folder', 'Ordner', fn () => collect($this->app->make(FolderTree::class)->options())->mapWithKeys(fn ($name, $id) => [(string) $id => $name])->all()),
Field::toggle('show_description', 'Beschreibungen anzeigen', true),
])
->resolveUsing(function (array $data, ?User $user) {
$tree = $this->app->make(FolderTree::class);
$folderId = (int) $data['folder'];
if (! $folderId || ! $tree->isVisible($folderId, $user)) {
return null;
}
$downloads = Download::query()->where('folder_id', $folderId)->with('currentVersion')->orderBy('title')->limit(100)->get();
return [
'folder_url' => route('downloads.folder', $folderId),
'downloads' => $downloads->map(fn (Download $d) => DownloadPresenter::row($d))->all(),
];
}));
}
}

View file

@ -1,6 +1,6 @@
<?php
namespace Inhaus\Plugins\Documents\Filament\Resources\DocumentFolders;
namespace Inhaus\Plugins\Downloads\Filament\Resources\DownloadFolders;
use App\Filament\Components\AudienceSection;
use App\Filament\Components\RoleGrantSelect;
@ -16,18 +16,18 @@ use Filament\Schemas\Schema;
use Filament\Support\Icons\Heroicon;
use Filament\Tables\Columns\TextColumn;
use Filament\Tables\Table;
use Inhaus\Plugins\Documents\Filament\Resources\DocumentFolders\Pages\ManageDocumentFolders;
use Inhaus\Plugins\Documents\FolderTree;
use Inhaus\Plugins\Documents\Models\DocumentFolder;
use Inhaus\Plugins\Downloads\Filament\Resources\DownloadFolders\Pages\ManageDownloadFolders;
use Inhaus\Plugins\Downloads\FolderTree;
use Inhaus\Plugins\Downloads\Models\DownloadFolder;
use UnitEnum;
/**
* Ordnerstruktur der Dokumentenablage: Rechte je Ordner und Sichtbarkeit.
* Hochladen und Pflegen der Dokumente geschieht im Portal unter „Dokumente“.
* Ordnerstruktur des Download-Bereichs: Rechte je Ordner und Sichtbarkeit.
* Hochladen und Pflegen der Dateien geschieht im Portal unter „Downloads“.
*/
class DocumentFolderResource extends Resource
class DownloadFolderResource extends Resource
{
protected static ?string $model = DocumentFolder::class;
protected static ?string $model = DownloadFolder::class;
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedFolder;
@ -35,15 +35,15 @@ class DocumentFolderResource extends Resource
protected static ?int $navigationSort = 6;
protected static ?string $modelLabel = 'Dokumentenordner';
protected static ?string $modelLabel = 'Download-Ordner';
protected static ?string $pluralModelLabel = 'Dokumentenordner';
protected static ?string $pluralModelLabel = 'Download-Ordner';
protected static ?string $slug = 'dokumentenordner';
protected static ?string $slug = 'download-ordner';
public static function canAccess(): bool
{
return auth()->user()?->can('documents.manage') ?? false;
return auth()->user()?->can('downloads.manage') ?? false;
}
public static function form(Schema $schema): Schema
@ -51,38 +51,38 @@ class DocumentFolderResource extends Resource
return $schema->columns(2)->components([
TextInput::make('name')->label('Name')->required()->maxLength(120),
Select::make('parent_id')->label('Übergeordneter Ordner')->placeholder('– oberste Ebene –')->searchable()
->options(fn (?DocumentFolder $record) => collect(app(FolderTree::class)->options())
->options(fn (?DownloadFolder $record) => collect(app(FolderTree::class)->options())
->except($record ? [$record->id, ...app(FolderTree::class)->descendantIds([$record->id])] : [])->all()),
TextInput::make('description')->label('Beschreibung')->maxLength(500)->columnSpanFull(),
TextInput::make('sort')->label('Reihenfolge')->numeric()->default(0),
Section::make('Pflege')
->description('Rollen, die in diesem Ordner und allen Unterordnern Dokumente hochladen, ändern und löschen dürfen.')
->description('Rollen, die in diesem Ordner und allen Unterordnern Dateien hochladen, ändern und löschen dürfen.')
->columnSpanFull()
->schema([RoleGrantSelect::make('editors', 'Dürfen Dokumente pflegen', 'documents.edit', 'document_folder', includeChildren: true)]),
AudienceSection::make('document_folder', 'Wer den Ordner sieht. Leer lassen = alle. Gilt auch für alle Unterordner.')->columnSpanFull(),
->schema([RoleGrantSelect::make('editors', 'Dürfen Downloads pflegen', 'downloads.edit', 'download_folder', includeChildren: true)]),
AudienceSection::make('download_folder', 'Wer den Ordner sieht. Leer lassen = alle. Gilt auch für alle Unterordner.')->columnSpanFull(),
]);
}
public static function table(Table $table): Table
{
return $table
->modifyQueryUsing(fn ($query) => $query->withCount('documents'))
->modifyQueryUsing(fn ($query) => $query->withCount('downloads'))
->defaultSort('name')
->columns([
TextColumn::make('name')->label('Name')->weight('medium')->searchable()
->formatStateUsing(fn (string $state, DocumentFolder $record) => str_repeat('— ', count(app(FolderTree::class)->ancestors($record->id))).$state),
TextColumn::make('documents_count')->label('Dokumente'),
->formatStateUsing(fn (string $state, DownloadFolder $record) => str_repeat('— ', count(app(FolderTree::class)->ancestors($record->id))).$state),
TextColumn::make('downloads_count')->label('Dateien'),
])
->recordActions([
Action::make('open')->label('Öffnen')->icon(Heroicon::OutlinedArrowTopRightOnSquare)->iconButton()
->url(fn (DocumentFolder $record) => route('documents.folder', $record)),
->url(fn (DownloadFolder $record) => route('downloads.folder', $record)),
EditAction::make()->after(fn () => FolderTree::flush(true)),
DeleteAction::make()->visible(fn (DocumentFolder $record) => $record->documents_count === 0 && ! $record->children()->exists()),
DeleteAction::make()->visible(fn (DownloadFolder $record) => $record->downloads_count === 0 && ! $record->children()->exists()),
]);
}
public static function getPages(): array
{
return ['index' => ManageDocumentFolders::route('/')];
return ['index' => ManageDownloadFolders::route('/')];
}
}

View file

@ -1,15 +1,15 @@
<?php
namespace Inhaus\Plugins\Documents\Filament\Resources\DocumentFolders\Pages;
namespace Inhaus\Plugins\Downloads\Filament\Resources\DownloadFolders\Pages;
use Filament\Actions\CreateAction;
use Filament\Resources\Pages\ManageRecords;
use Inhaus\Plugins\Documents\Filament\Resources\DocumentFolders\DocumentFolderResource;
use Inhaus\Plugins\Documents\FolderTree;
use Inhaus\Plugins\Downloads\Filament\Resources\DownloadFolders\DownloadFolderResource;
use Inhaus\Plugins\Downloads\FolderTree;
class ManageDocumentFolders extends ManageRecords
class ManageDownloadFolders extends ManageRecords
{
protected static string $resource = DocumentFolderResource::class;
protected static string $resource = DownloadFolderResource::class;
protected function getHeaderActions(): array
{

View file

@ -1,6 +1,6 @@
<?php
namespace Inhaus\Plugins\Documents;
namespace Inhaus\Plugins\Downloads;
use App\Models\User;
use App\Support\Permissions\Audiences;
@ -14,7 +14,7 @@ use Illuminate\Support\Facades\DB;
*/
class FolderTree
{
private const CACHE_KEY = 'documents.tree';
private const CACHE_KEY = 'downloads.tree';
/** @var array{folders: array<int, array<string, mixed>>, children: array<int, list<int>>}|null */
private ?array $data = null;
@ -88,7 +88,7 @@ class FolderTree
public function isVisible(int $id, ?User $user): bool
{
if ($user?->can('documents.manage')) {
if ($user?->can('downloads.manage')) {
return $this->get($id) !== null;
}
@ -157,11 +157,11 @@ class FolderTree
private function data(): array
{
return $this->data ??= Cache::rememberForever(self::CACHE_KEY, function () {
$audiences = Audiences::allOfType('document_folder');
$audiences = Audiences::allOfType('download_folder');
$folders = [];
$children = [];
foreach (DB::table('document_folders')->orderBy('sort')->orderBy('name')->get(['id', 'parent_id', 'name']) as $row) {
foreach (DB::table('download_folders')->orderBy('sort')->orderBy('name')->get(['id', 'parent_id', 'name']) as $row) {
$folders[$row->id] = [
'id' => (int) $row->id,
'parent_id' => $row->parent_id !== null ? (int) $row->parent_id : null,

View file

@ -0,0 +1,351 @@
<?php
namespace Inhaus\Plugins\Downloads\Http\Controllers;
use App\Http\Controllers\Controller;
use App\Models\Grant;
use App\Support\Audit;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Http\UploadedFile;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Gate;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Str;
use Illuminate\Validation\Rule;
use Illuminate\Validation\ValidationException;
use Inertia\Inertia;
use Inertia\Response;
use Inhaus\Plugins\Downloads\DownloadPresenter;
use Inhaus\Plugins\Downloads\FolderTree;
use Inhaus\Plugins\Downloads\Models\Download;
use Inhaus\Plugins\Downloads\Models\DownloadFolder;
use Inhaus\Plugins\Downloads\Models\DownloadVersion;
use Symfony\Component\HttpFoundation\StreamedResponse;
class DownloadController extends Controller
{
/** Nie als Datei annehmen: ausführbarer Code, Webseiten, Skripte. */
private const BLOCKED = ['php', 'phtml', 'phar', 'php3', 'php4', 'php5', 'php7', 'php8', 'pht', 'shtml', 'htaccess', 'exe', 'bat', 'cmd', 'com', 'sh', 'js', 'mjs', 'html', 'htm', 'svg', 'xhtml', 'jsp', 'asp', 'aspx', 'cgi', 'pl', 'py', 'msi', 'ps1', 'vbs', 'scr'];
public const MAX_KB = 100 * 1024;
public function __construct(private readonly FolderTree $tree) {}
public function index(Request $request): Response
{
return $this->render($request, null);
}
public function folder(Request $request, DownloadFolder $folder): Response
{
abort_unless($this->tree->isVisible($folder->id, $request->user()) || $request->user()->can('update', $folder), 404);
return $this->render($request, $folder);
}
public function upload(Request $request, DownloadFolder $folder): RedirectResponse
{
Gate::authorize('update', $folder);
$request->validate([
'files' => ['required', 'array', 'max:20'],
'files.*' => ['file', 'max:'.self::MAX_KB],
], [], ['files.*' => 'Datei']);
$count = 0;
foreach ($request->file('files') as $index => $file) {
$this->assertAllowed($file, "files.{$index}");
}
foreach ($request->file('files') as $file) {
DB::transaction(function () use ($folder, $file, $request) {
$download = $folder->downloads()->create([
'title' => Str::limit(pathinfo($file->getClientOriginalName(), PATHINFO_FILENAME) ?: 'Datei', 250, ''),
'created_by' => $request->user()->id,
'updated_by' => $request->user()->id,
]);
$this->storeVersion($download, $file, $request, null);
});
$count++;
}
Audit::log('downloads.uploaded', ['folder' => $folder->id, 'count' => $count]);
return back()->with('status', $count === 1 ? 'Datei hochgeladen.' : "{$count} Dateien hochgeladen.");
}
public function newVersion(Request $request, Download $download): RedirectResponse
{
Gate::authorize('update', $download->folder);
$request->validate(['file' => ['required', 'file', 'max:'.self::MAX_KB], 'note' => ['nullable', 'string', 'max:500']], [], ['file' => 'Datei', 'note' => 'Hinweis']);
$this->assertAllowed($request->file('file'), 'file');
DB::transaction(fn () => $this->storeVersion($download, $request->file('file'), $request, $request->input('note')));
Audit::log('downloads.version_added', ['download' => $download->id, 'title' => $download->title]);
return back()->with('status', 'Neue Fassung hochgeladen.');
}
public function update(Request $request, Download $download): RedirectResponse
{
Gate::authorize('update', $download->folder);
$data = $request->validate([
'title' => ['required', 'string', 'max:250'],
'description' => ['nullable', 'string', 'max:2000'],
'folder_id' => ['required', 'integer', Rule::exists('download_folders', 'id')],
], [], ['title' => 'Titel', 'folder_id' => 'Ordner']);
// Verschieben: im Zielordner muss man ebenfalls pflegen dürfen.
if ((int) $data['folder_id'] !== $download->folder_id) {
Gate::authorize('update', DownloadFolder::query()->findOrFail($data['folder_id']));
}
$download->update([...$data, 'updated_by' => $request->user()->id]);
return back()->with('status', 'Gespeichert.');
}
public function destroy(Request $request, Download $download): RedirectResponse
{
Gate::authorize('update', $download->folder);
$download->delete();
Audit::log('downloads.deleted', ['download' => $download->id, 'title' => $download->title]);
return back()->with('status', 'Datei gelöscht.');
}
public function versions(Request $request, Download $download): JsonResponse
{
abort_unless($this->tree->isVisible($download->folder_id, $request->user()) || $request->user()->can('update', $download->folder), 404);
return response()->json(['versions' => $download->versions()->with('uploader:id,name')->get()->map(fn (DownloadVersion $v) => [
'version' => $v->version,
'name' => $v->name,
'size' => (int) $v->size,
'note' => $v->note,
'uploader' => $v->uploader?->name,
'created_at' => $v->created_at?->toIso8601String(),
'current' => $v->id === $download->current_version_id,
'download_url' => $download->downloadUrl($v),
])]);
}
public function download(Request $request, Download $download, int $version): StreamedResponse
{
abort_unless($this->tree->isVisible($download->folder_id, $request->user()) || $request->user()->can('update', $download->folder), 404);
$file = $download->versions()->where('version', $version)->firstOrFail();
// Vorschaubild (Kachelansicht): nur ungefährliche Typen, im Browser anzeigen, nicht mitzählen.
if ($request->boolean('vorschau')) {
abort_unless(in_array($file->mime, DownloadPresenter::PREVIEW_MIMES, true), 404);
return Storage::disk(DownloadVersion::DISK)->response($file->path, $file->name, [
'Content-Type' => $file->mime,
'X-Content-Type-Options' => 'nosniff',
'Content-Security-Policy' => "default-src 'none'; sandbox",
'Cache-Control' => 'private, max-age=3600',
]);
}
// Ohne updated_at zu ändern – ein Download ist keine Bearbeitung.
DB::table('downloads')->where('id', $download->id)->increment('download_count');
return Storage::disk(DownloadVersion::DISK)->download($file->path, $file->name, [
'Content-Type' => $file->mime ?: 'application/octet-stream',
'X-Content-Type-Options' => 'nosniff',
'Cache-Control' => 'private, max-age=300',
]);
}
public function favorite(Request $request, Download $download): RedirectResponse
{
abort_unless($this->tree->isVisible($download->folder_id, $request->user()), 404);
DB::table('download_favorites')->insertOrIgnore(['user_id' => $request->user()->id, 'download_id' => $download->id, 'created_at' => now()]);
return back();
}
public function unfavorite(Request $request, Download $download): RedirectResponse
{
DB::table('download_favorites')->where('user_id', $request->user()->id)->where('download_id', $download->id)->delete();
return back();
}
public function storeFolder(Request $request): RedirectResponse
{
$data = $request->validate([
'name' => ['required', 'string', 'max:120'],
'parent_id' => ['nullable', 'integer', Rule::exists('download_folders', 'id')],
], [], ['name' => 'Name']);
$parent = isset($data['parent_id']) ? DownloadFolder::query()->findOrFail($data['parent_id']) : null;
Gate::authorize('create', [DownloadFolder::class, $parent]);
$folder = DownloadFolder::query()->create([
'name' => trim($data['name']),
'parent_id' => $parent?->id,
'sort' => (int) DownloadFolder::query()->where('parent_id', $parent?->id)->max('sort') + 1,
'created_by' => $request->user()->id,
]);
return to_route('downloads.folder', $folder)->with('status', 'Ordner angelegt.');
}
public function updateFolder(Request $request, DownloadFolder $folder): RedirectResponse
{
Gate::authorize('update', $folder);
$folder->update($request->validate(['name' => ['required', 'string', 'max:120'], 'description' => ['nullable', 'string', 'max:500']], [], ['name' => 'Name']));
return back()->with('status', 'Ordner gespeichert.');
}
public function destroyFolder(Request $request, DownloadFolder $folder): RedirectResponse
{
Gate::authorize('delete', $folder);
if ($folder->children()->exists() || $folder->downloads()->exists()) {
throw ValidationException::withMessages(['folder' => 'Der Ordner ist nicht leer. Bitte zuerst Dateien und Unterordner entfernen oder verschieben.']);
}
$parent = $folder->parent_id;
$folder->delete();
return ($parent ? to_route('downloads.folder', $parent) : to_route('downloads.index'))->with('status', 'Ordner gelöscht.');
}
private function render(Request $request, ?DownloadFolder $folder): Response
{
$user = $request->user();
$search = trim((string) $request->query('q', ''));
if ($search !== '') {
$like = '%'.str_replace(['\\', '%', '_'], ['\\\\', '\\%', '\\_'], $search).'%';
$downloads = Download::query()
->whereIn('folder_id', $this->tree->visibleIds($user) ?: [0])
->where(fn ($q) => $q->where('title', 'like', $like)->orWhere('description', 'like', $like)
->orWhereHas('versions', fn ($v) => $v->where('name', 'like', $like)))
->with('currentVersion.uploader')->orderBy('title')->limit(100)->get();
} else {
$downloads = $folder
? $folder->downloads()->with('currentVersion.uploader')->orderBy('title')->get()
: collect();
}
// Startseite der Ablage: zuletzt geänderte Dateien aus allen sichtbaren Ordnern.
$recent = ! $folder && $search === ''
? Download::query()->whereIn('folder_id', $this->tree->visibleIds($user) ?: [0])
->with('currentVersion.uploader')->latest('updated_at')->limit(8)->get()
: collect();
$favoriteIds = DB::table('download_favorites')->where('user_id', $user->id)->pluck('download_id')->flip();
$visible = $this->tree->visibleIds($user) ?: [0];
$favorites = ! $folder && $search === ''
? Download::query()->whereIn('id', $favoriteIds->keys()->all() ?: [0])->whereIn('folder_id', $visible)
->with('currentVersion.uploader')->orderBy('title')->limit(24)->get()
: collect();
$popular = ! $folder && $search === ''
? Download::query()->whereIn('folder_id', $visible)->where('download_count', '>', 0)
->with('currentVersion.uploader')->orderByDesc('download_count')->orderBy('title')->limit(6)->get()
: collect();
$folderName = fn (Download $d) => ($folder && $search === '') ? null : ($this->tree->get($d->folder_id)['name'] ?? null);
$childIds = array_values(array_filter($this->tree->childIds($folder?->id), fn ($id) => $this->tree->isVisible($id, $user)));
$counts = Download::query()->whereIn('folder_id', $childIds ?: [0])->selectRaw('folder_id, count(*) as c')->groupBy('folder_id')->pluck('c', 'folder_id');
$descriptions = DownloadFolder::query()->whereIn('id', $childIds ?: [0])->pluck('description', 'id');
$visibleChildren = fn (int $id) => array_values(array_filter($this->tree->childIds($id), fn ($c) => $this->tree->isVisible($c, $user)));
$children = collect($childIds)->map(fn ($id) => [
'id' => $id,
'name' => $this->tree->get($id)['name'],
'description' => $descriptions[$id] ?? null,
'downloads' => (int) ($counts[$id] ?? 0),
'folders' => count($visibleChildren($id)),
'subfolders' => array_map(fn ($c) => ['id' => $c, 'name' => $this->tree->get($c)['name']], array_slice($visibleChildren($id), 0, 4)),
'count' => (int) ($counts[$id] ?? 0) + count($this->tree->childIds($id)),
]);
return Inertia::render('downloads::Index', [
'tree' => $this->tree->visibleTree(null, $user),
'folder' => $folder ? [
'id' => $folder->id,
'name' => $folder->name,
'description' => $folder->description,
'parent_id' => $folder->parent_id,
'can_edit' => $user->can('update', $folder),
'can_delete' => $user->can('delete', $folder),
'editors' => $this->editorRoles($folder),
] : null,
'breadcrumbs' => $folder ? array_map(fn ($f) => ['id' => $f['id'], 'name' => $f['name']], $this->tree->ancestors($folder->id)) : [],
'children' => $children,
'downloads' => $downloads->map($row = fn (Download $d) => DownloadPresenter::row($d, $folderName($d), $favoriteIds->has($d->id))),
'recent' => $recent->map($row),
'favorites' => $favorites->map($row),
'popular' => $popular->map($row),
'search' => $search,
'canCreateRoot' => $user->can('downloads.manage'),
// Zielordner zum Verschieben: nur solche, in denen die Person pflegen darf.
'folderOptions' => collect($this->tree->options())->filter(fn ($name, $id) => $user->can('downloads.edit', ['download_folder', $id]))
->map(fn ($name, $id) => ['value' => $id, 'label' => $name])->values(),
'maxUploadMb' => (int) floor(min(self::MAX_KB / 1024, self::phpUploadLimitMb())),
]);
}
/**
* Rollen, die diesen Ordner pflegen dürfen – direkt oder über einen übergeordneten
* Ordner mit „inkl. Unterordnern“.
*
* @return list<string>
*/
private function editorRoles(DownloadFolder $folder): array
{
$ancestors = array_column($this->tree->ancestors($folder->id), 'id');
return Grant::query()
->where('ability', 'downloads.edit')->where('resource_type', 'download_folder')
->where(fn ($q) => $q->where('resource_id', $folder->id)
->orWhere(fn ($q) => $q->whereIn('resource_id', array_diff($ancestors, [$folder->id]) ?: [0])->where('include_children', true)))
->with('role:id,name')->get()
->pluck('role.name')->filter()->unique()->sort()->values()->all();
}
private function storeVersion(Download $download, UploadedFile $file, Request $request, ?string $note): DownloadVersion
{
$name = Str::limit(preg_replace('/[^\pL\pN ._()\-]+/u', '_', $file->getClientOriginalName()) ?: 'datei', 200, '');
$extension = strtolower(pathinfo($name, PATHINFO_EXTENSION));
$version = $download->versions()->create([
'version' => (int) $download->versions()->max('version') + 1,
'name' => $name,
'path' => $file->storeAs('downloads/'.$download->folder_id, Str::random(40).($extension ? '.'.$extension : ''), DownloadVersion::DISK),
'mime' => $file->getMimeType(),
'size' => $file->getSize(),
'note' => $note,
'uploaded_by' => $request->user()->id,
'created_at' => now(),
]);
$download->forceFill(['current_version_id' => $version->id, 'updated_by' => $request->user()->id])->save();
return $version;
}
private function assertAllowed(UploadedFile $file, string $field): void
{
$extensions = [strtolower(pathinfo($file->getClientOriginalName(), PATHINFO_EXTENSION)), strtolower((string) $file->getClientOriginalExtension())];
if (array_intersect($extensions, self::BLOCKED) !== []) {
throw ValidationException::withMessages([$field => '„'.$file->getClientOriginalName().'“: Dieser Dateityp ist aus Sicherheitsgründen nicht erlaubt.']);
}
}
private static function phpUploadLimitMb(): float
{
$bytes = fn (string $v) => (int) $v * (['g' => 1024 ** 3, 'm' => 1024 ** 2, 'k' => 1024][strtolower(substr(trim($v), -1))] ?? 1);
$limits = array_filter([$bytes((string) ini_get('upload_max_filesize')), $bytes((string) ini_get('post_max_size'))]);
return $limits === [] ? self::MAX_KB / 1024 : min($limits) / 1024 / 1024;
}
}

View file

@ -1,44 +1,53 @@
<?php
namespace Inhaus\Plugins\Documents\Models;
namespace Inhaus\Plugins\Downloads\Models;
use App\Models\User;
use Illuminate\Database\Eloquent\Attributes\Fillable;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\Relations\HasMany;
#[Fillable(['folder_id', 'title', 'description', 'created_by', 'updated_by'])]
class Document extends Model
class Download extends Model
{
protected static function booted(): void
{
// Dateien aller Fassungen mit entfernen.
static::deleting(fn (Document $document) => $document->versions()->get()->each->delete());
static::deleting(fn (Download $download) => $download->versions()->get()->each->delete());
}
/**
* @return BelongsTo<DocumentFolder, $this>
* @return BelongsTo<DownloadFolder, $this>
*/
public function folder(): BelongsTo
{
return $this->belongsTo(DocumentFolder::class, 'folder_id');
return $this->belongsTo(DownloadFolder::class, 'folder_id');
}
/**
* @return BelongsTo<DocumentVersion, $this>
* @return BelongsTo<DownloadVersion, $this>
*/
/**
* @return BelongsToMany<User, $this>
*/
public function favoritedBy(): BelongsToMany
{
return $this->belongsToMany(User::class, 'download_favorites')->withPivot('created_at');
}
public function currentVersion(): BelongsTo
{
return $this->belongsTo(DocumentVersion::class, 'current_version_id');
return $this->belongsTo(DownloadVersion::class, 'current_version_id');
}
/**
* @return HasMany<DocumentVersion, $this>
* @return HasMany<DownloadVersion, $this>
*/
public function versions(): HasMany
{
return $this->hasMany(DocumentVersion::class)->orderByDesc('version');
return $this->hasMany(DownloadVersion::class)->orderByDesc('version');
}
/**
@ -49,10 +58,10 @@ class Document extends Model
return $this->belongsTo(User::class, 'updated_by');
}
public function downloadUrl(?DocumentVersion $version = null): string
public function downloadUrl(?DownloadVersion $version = null): string
{
$version ??= $this->currentVersion;
return route('documents.download', ['document' => $this->id, 'version' => $version?->version, 'name' => $version?->name ?? 'datei']);
return route('downloads.download', ['download' => $this->id, 'version' => $version?->version, 'name' => $version?->name ?? 'datei']);
}
}

View file

@ -1,19 +1,19 @@
<?php
namespace Inhaus\Plugins\Documents\Models;
namespace Inhaus\Plugins\Downloads\Models;
use Illuminate\Database\Eloquent\Attributes\Fillable;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Inhaus\Plugins\Documents\FolderTree;
use Inhaus\Plugins\Downloads\FolderTree;
#[Fillable(['parent_id', 'name', 'description', 'sort', 'created_by'])]
class DocumentFolder extends Model
class DownloadFolder extends Model
{
protected static function booted(): void
{
static::saved(fn (DocumentFolder $folder) => FolderTree::flush($folder->wasRecentlyCreated || $folder->wasChanged('parent_id')));
static::saved(fn (DownloadFolder $folder) => FolderTree::flush($folder->wasRecentlyCreated || $folder->wasChanged('parent_id')));
static::deleted(fn () => FolderTree::flush(true));
}
@ -22,30 +22,30 @@ class DocumentFolder extends Model
*/
public function permissionResource(): array
{
return ['document_folder', $this->id];
return ['download_folder', $this->id];
}
/**
* @return BelongsTo<DocumentFolder, $this>
* @return BelongsTo<DownloadFolder, $this>
*/
public function parent(): BelongsTo
{
return $this->belongsTo(DocumentFolder::class, 'parent_id');
return $this->belongsTo(DownloadFolder::class, 'parent_id');
}
/**
* @return HasMany<DocumentFolder, $this>
* @return HasMany<DownloadFolder, $this>
*/
public function children(): HasMany
{
return $this->hasMany(DocumentFolder::class, 'parent_id')->orderBy('sort')->orderBy('name');
return $this->hasMany(DownloadFolder::class, 'parent_id')->orderBy('sort')->orderBy('name');
}
/**
* @return HasMany<Document, $this>
* @return HasMany<Download, $this>
*/
public function documents(): HasMany
public function downloads(): HasMany
{
return $this->hasMany(Document::class, 'folder_id');
return $this->hasMany(Download::class, 'folder_id');
}
}

View file

@ -1,6 +1,6 @@
<?php
namespace Inhaus\Plugins\Documents\Models;
namespace Inhaus\Plugins\Downloads\Models;
use App\Models\User;
use Illuminate\Database\Eloquent\Attributes\Fillable;
@ -9,11 +9,11 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Support\Facades\Storage;
/**
* Eine Fassung eines Dokuments. Die Datei liegt außerhalb von public/ und
* Eine Fassung einer Datei. Die Datei liegt außerhalb von public/ und
* wird nur an Personen ausgeliefert, die den Ordner sehen dürfen.
*/
#[Fillable(['document_id', 'version', 'name', 'path', 'mime', 'size', 'note', 'uploaded_by', 'created_at'])]
class DocumentVersion extends Model
#[Fillable(['download_id', 'version', 'name', 'path', 'mime', 'size', 'note', 'uploaded_by', 'created_at'])]
class DownloadVersion extends Model
{
public const DISK = 'local';
@ -21,15 +21,15 @@ class DocumentVersion extends Model
protected static function booted(): void
{
static::deleted(fn (DocumentVersion $version) => Storage::disk(self::DISK)->delete($version->path));
static::deleted(fn (DownloadVersion $version) => Storage::disk(self::DISK)->delete($version->path));
}
/**
* @return BelongsTo<Document, $this>
* @return BelongsTo<Download, $this>
*/
public function document(): BelongsTo
public function download(): BelongsTo
{
return $this->belongsTo(Document::class);
return $this->belongsTo(Download::class);
}
/**

View file

@ -0,0 +1,41 @@
<?php
namespace Inhaus\Plugins\Downloads\Policies;
use App\Models\User;
use Inhaus\Plugins\Downloads\FolderTree;
use Inhaus\Plugins\Downloads\Models\DownloadFolder;
/**
* „Downloads verwalten“ gilt für den ganzen Bereich. „Downloads pflegen“ wird je
* Ordner vergeben (meist inkl. Unterordnern) – z. B. pflegt die Personalabteilung
* den Ordner „Personal“.
*/
class DownloadFolderPolicy
{
public function viewAny(User $user): bool
{
return $user->can('downloads.manage') || $user->permissions()->ids('downloads.edit', 'download_folder') !== [];
}
public function view(User $user, DownloadFolder $folder): bool
{
return app(FolderTree::class)->isVisible($folder->id, $user) || $this->update($user, $folder);
}
public function create(User $user, ?DownloadFolder $parent = null): bool
{
return $user->can('downloads.manage') || ($parent !== null && $this->update($user, $parent));
}
/** Dateien hochladen, ändern, löschen; Unterordner anlegen. */
public function update(User $user, DownloadFolder $folder): bool
{
return $user->can('downloads.manage') || $user->can('downloads.edit', ['download_folder', $folder->id]);
}
public function delete(User $user, DownloadFolder $folder): bool
{
return $user->can('downloads.manage') || ($folder->parent_id !== null && $user->can('downloads.edit', ['download_folder', $folder->parent_id]));
}
}

View file

@ -4,6 +4,7 @@ import { Link } from '@inertiajs/vue3';
import { CalendarDays, MapPin, Video } from '@lucide/vue';
import EmptyState from '@/components/EmptyState.vue';
import EventDateBlock from '../components/EventDateBlock.vue';
import PageHeader from '@/components/PageHeader.vue';
import AppLayout from '@/layouts/AppLayout.vue';
import { formatEventRange, formatMonthYear } from '@/lib/format';
@ -34,10 +35,7 @@ const groups = computed(() => {
<template>
<AppLayout title="Termine">
<div class="mb-6">
<h1 class="text-2xl font-semibold tracking-tight">Termine</h1>
<p class="mt-1 text-sm text-muted-foreground">Veranstaltungen, Fortbildungen und Treffen.</p>
</div>
<PageHeader title="Termine" description="Veranstaltungen, Fortbildungen und Treffen." />
<div v-if="groups.length" class="grid max-w-4xl gap-8">
<section v-for="group in groups" :key="group.label">

View file

@ -2,6 +2,7 @@
import { Link } from '@inertiajs/vue3';
import { ChevronRight, ClipboardList } from '@lucide/vue';
import EmptyState from '@/components/EmptyState.vue';
import PageHeader from '@/components/PageHeader.vue';
import AppLayout from '@/layouts/AppLayout.vue';
import { formatDate } from '@/lib/format';
@ -12,10 +13,7 @@ defineProps({
<template>
<AppLayout title="Formulare">
<div class="mb-6">
<h1 class="text-2xl font-semibold tracking-tight">Formulare</h1>
<p class="mt-1 text-sm text-muted-foreground">Anträge, Anmeldungen und Meldungen – direkt online ausfüllen.</p>
</div>
<PageHeader title="Formulare" description="Anträge, Anmeldungen und Meldungen – direkt online ausfüllen." />
<div v-if="forms.length" class="grid gap-4 md:grid-cols-2 xl:grid-cols-3">
<Link v-for="form in forms" :key="form.id" :href="form.url" class="group flex gap-4 rounded-lg border bg-card p-5 hover:border-brand-300">

View file

@ -4,6 +4,7 @@ import { ChevronLeft, ChevronRight, Newspaper, PenLine } from '@lucide/vue';
import { Button } from '@/components/ui/button';
import EmptyState from '@/components/EmptyState.vue';
import NewsCard from '../components/NewsCard.vue';
import PageHeader from '@/components/PageHeader.vue';
import AppLayout from '@/layouts/AppLayout.vue';
defineProps({
@ -16,13 +17,11 @@ defineProps({
<template>
<AppLayout title="Neuigkeiten">
<div class="mb-6 flex flex-wrap items-end justify-between gap-4">
<div>
<h1 class="text-2xl font-semibold tracking-tight">Neuigkeiten</h1>
<p class="mt-1 text-sm text-muted-foreground">Aktuelles aus dem Unternehmen und den Bereichen.</p>
</div>
<Button v-if="canWrite" as-child><Link href="/redaktion/neuigkeiten/neu"><PenLine /> Beitrag schreiben</Link></Button>
</div>
<PageHeader title="Neuigkeiten" description="Aktuelles aus dem Unternehmen und den Bereichen.">
<template v-if="canWrite" #actions>
<Button as-child><Link href="/redaktion/neuigkeiten/neu"><PenLine /> Beitrag schreiben</Link></Button>
</template>
</PageHeader>
<nav v-if="categories.length" class="mb-6 flex flex-wrap gap-2" aria-label="Kategorien">
<Link

View file

@ -4,6 +4,7 @@ import { Link } from '@inertiajs/vue3';
import { ChevronRight, FileText, FolderOpen, Plus } from '@lucide/vue';
import { Button } from '@/components/ui/button';
import EmptyState from '@/components/EmptyState.vue';
import PageHeader from '@/components/PageHeader.vue';
import AppLayout from '@/layouts/AppLayout.vue';
import NewPageDialog from '../components/NewPageDialog.vue';
@ -17,13 +18,11 @@ const creating = ref(false);
<template>
<AppLayout title="Seiten">
<div class="mb-6 flex flex-wrap items-end justify-between gap-4">
<div>
<h1 class="text-2xl font-semibold tracking-tight">Seiten</h1>
<p class="mt-1 text-sm text-muted-foreground">Informationen der Bereiche, Abteilungen und Gremien.</p>
</div>
<Button v-if="canCreate" @click="creating = true"><Plus /> Neue Seite</Button>
</div>
<PageHeader title="Seiten" description="Informationen der Bereiche, Abteilungen und Gremien.">
<template v-if="canCreate" #actions>
<Button @click="creating = true"><Plus /> Neue Seite</Button>
</template>
</PageHeader>
<div v-if="tree.length" class="grid gap-5 md:grid-cols-2 xl:grid-cols-3">
<section v-for="section in tree" :key="section.id" class="rounded-lg border bg-card">

View file

@ -49,6 +49,32 @@ class PagesPlugin extends Plugin
], $this->app->make(PageTree::class)->navigation($user));
});
// Menü-Editor: „Seite“ als Menüpunkt, auf Wunsch mit ihren Unterseiten als Untermenü.
$this->app->make(Navigation::class)->source('page', 'Seite', fn () => $this->app->make(PageTree::class)->options(), function (string $id, array $item, Request $request, ?User $user) {
$tree = $this->app->make(PageTree::class);
$page = $tree->get((int) $id);
if (! $page || ! $tree->isVisible($page['id'], $user)) {
return null;
}
$current = trim((string) $request->route('path'), '/');
$isActive = fn (string $path) => $request->routeIs('pages.show') && ($current === $path || str_starts_with($current, $path.'/'));
$children = [];
if (! empty($item['subpages'])) {
foreach ($tree->childIds($page['id']) as $childId) {
$child = $tree->get($childId);
if ($child && $tree->isVisible($childId, $user)) {
$children[] = ['label' => $child['title'], 'href' => '/seiten/'.$child['path'], 'active' => $isActive($child['path'])];
}
}
}
return ['label' => $page['title'], 'href' => '/seiten/'.$page['path'], 'active' => $isActive($page['path']), 'children' => $children];
});
$this->app->make(Editorial::class)->add(
'pages',
'Seiten',

View file

@ -1,3 +1,8 @@
# JavaScript-Module (u. a. pdf.js-Worker für Vorschaubilder in der Dokumentenablage)
<IfModule mod_mime.c>
AddType text/javascript .mjs
</IfModule>
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews -Indexes

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1 +1 @@
import{_ as e,b as t,bt as n,mt as r,o as i,qt as a,v as o}from"./runtime-core.esm-bundler-B8D2lM98.js";import{t as s}from"./Panel-CSRDt0_D.js";import{t as c}from"./NewsCard-CXsirogk.js";var l={class:`-mx-5 flex snap-x scroll-px-5 gap-4 overflow-x-auto px-5 pb-1 [scrollbar-width:none] sm:mx-0 sm:grid sm:grid-cols-2 sm:overflow-visible sm:px-0 sm:pb-0 xl:grid-cols-4 [&::-webkit-scrollbar]:hidden`},u={__name:`Areas`,props:{posts:{type:Array,required:!0}},setup(u){return(d,f)=>(r(),o(s,{title:`Aktuelles aus den Bereichen`,"action-label":`Alle`,"action-href":`/neuigkeiten`},{default:a(()=>[e(`div`,l,[(r(!0),t(i,null,n(u.posts,e=>(r(),o(c,{key:e.id,post:e,class:`w-[78%] shrink-0 snap-start sm:w-auto`},null,8,[`post`]))),128))])]),_:1}))}};export{u as default};
import{_ as e,b as t,bt as n,mt as r,o as i,qt as a,v as o}from"./runtime-core.esm-bundler-B8D2lM98.js";import{t as s}from"./Panel-xPHuwfuu.js";import{t as c}from"./NewsCard-CWMFENyt.js";var l={class:`-mx-5 flex snap-x scroll-px-5 gap-4 overflow-x-auto px-5 pb-1 [scrollbar-width:none] sm:mx-0 sm:grid sm:grid-cols-2 sm:overflow-visible sm:px-0 sm:pb-0 xl:grid-cols-4 [&::-webkit-scrollbar]:hidden`},u={__name:`Areas`,props:{posts:{type:Array,required:!0}},setup(u){return(d,f)=>(r(),o(s,{title:`Aktuelles aus den Bereichen`,"action-label":`Alle`,"action-href":`/neuigkeiten`},{default:a(()=>[e(`div`,l,[(r(!0),t(i,null,n(u.posts,e=>(r(),o(c,{key:e.id,post:e,class:`w-[78%] shrink-0 snap-start sm:w-auto`},null,8,[`post`]))),128))])]),_:1}))}};export{u as default};

View file

@ -1 +0,0 @@
import{D as e,On as t,Zn as n,_ as r,b as i,mt as a,qt as o,tr as s,v as c,y as l}from"./runtime-core.esm-bundler-B8D2lM98.js";import{n as u}from"./app-DutZVOiO.js";import{t as d}from"./cake-DYVAYX9m.js";import{_ as f}from"./format-2iB7L6ww.js";var p={class:`relative shrink-0`},m={key:0,class:`absolute -right-1 -bottom-1 grid size-5 place-items-center rounded-full bg-brand text-brand-foreground ring-2 ring-card`},h={class:`min-w-0 flex-1`},g={class:`block truncate text-sm font-medium group-hover:underline`},_={class:`block truncate text-xs text-muted-foreground`},v={__name:`BirthdayItem`,props:{item:{type:Object,required:!0}},setup(v){let y=e=>new Intl.DateTimeFormat(`de-DE`,{day:`numeric`,month:`long`}).format(new Date(`${e}T12:00:00`)),b=e=>new Intl.DateTimeFormat(`de-DE`,{weekday:`short`}).format(new Date(`${e}T12:00:00`));return(x,S)=>(a(),c(t(u),{href:`/personen/${v.item.person.id}`,class:`group flex items-center gap-3 py-2.5`},{default:o(()=>[r(`span`,p,[e(f,{person:v.item.person,class:`size-10`},null,8,[`person`]),v.item.today?(a(),i(`span`,m,[e(t(d),{class:`size-3`})])):l(``,!0)]),r(`span`,h,[r(`span`,g,s(v.item.person.name),1),r(`span`,_,s(v.item.person.job_title||v.item.person.department),1)]),r(`span`,{class:n([`shrink-0 text-right text-xs`,v.item.today?`font-semibold text-brand-text`:`text-muted-foreground`])},s(v.item.today?`Heute`:`${b(v.item.date)}, ${y(v.item.date)}`),3)]),_:1},8,[`href`]))}};export{v as t};

View file

@ -0,0 +1 @@
import{D as e,On as t,Zn as n,_ as r,b as i,mt as a,qt as o,tr as s,v as c,y as l}from"./runtime-core.esm-bundler-B8D2lM98.js";import{n as u}from"./app-CIvn5Z1l.js";import{b as d,it as f}from"./AppIcon-BVHFLm12.js";var p={class:`relative shrink-0`},m={key:0,class:`absolute -right-1 -bottom-1 grid size-5 place-items-center rounded-full bg-brand text-brand-foreground ring-2 ring-card`},h={class:`min-w-0 flex-1`},g={class:`block truncate text-sm font-medium group-hover:underline`},_={class:`block truncate text-xs text-muted-foreground`},v={__name:`BirthdayItem`,props:{item:{type:Object,required:!0}},setup(v){let y=e=>new Intl.DateTimeFormat(`de-DE`,{day:`numeric`,month:`long`}).format(new Date(`${e}T12:00:00`)),b=e=>new Intl.DateTimeFormat(`de-DE`,{weekday:`short`}).format(new Date(`${e}T12:00:00`));return(x,S)=>(a(),c(t(u),{href:`/personen/${v.item.person.id}`,class:`group flex items-center gap-3 py-2.5`},{default:o(()=>[r(`span`,p,[e(d,{person:v.item.person,class:`size-10`},null,8,[`person`]),v.item.today?(a(),i(`span`,m,[e(t(f),{class:`size-3`})])):l(``,!0)]),r(`span`,h,[r(`span`,g,s(v.item.person.name),1),r(`span`,_,s(v.item.person.job_title||v.item.person.department),1)]),r(`span`,{class:n([`shrink-0 text-right text-xs`,v.item.today?`font-semibold text-brand-text`:`text-muted-foreground`])},s(v.item.today?`Heute`:`${b(v.item.date)}, ${y(v.item.date)}`),3)]),_:1},8,[`href`]))}};export{v as t};

View file

@ -1 +1 @@
import{_ as e,b as t,bt as n,mt as r,o as i,tr as a,v as o,y as s}from"./runtime-core.esm-bundler-B8D2lM98.js";import{t as c}from"./BirthdayItem-B6-Z7Zov.js";var l={key:0,class:`mb-3 text-lg font-semibold`},u={class:`divide-y rounded-lg border bg-card px-4`},d={key:0,class:`py-3 text-sm text-muted-foreground`},f={__name:`BirthdaysBlock`,props:{block:{type:Object,required:!0}},setup(f){return(p,m)=>(r(),t(`section`,null,[f.block.data.title?(r(),t(`h3`,l,a(f.block.data.title),1)):s(``,!0),e(`div`,u,[(r(!0),t(i,null,n(f.block.props?.birthdays??[],e=>(r(),o(c,{key:`${e.person.id}-${e.date}`,item:e},null,8,[`item`]))),128)),(f.block.props?.birthdays??[]).length?s(``,!0):(r(),t(`p`,d,`Keine anstehenden Geburtstage.`))])]))}};export{f as default};
import{_ as e,b as t,bt as n,mt as r,o as i,tr as a,v as o,y as s}from"./runtime-core.esm-bundler-B8D2lM98.js";import{t as c}from"./BirthdayItem-DK6xURSZ.js";var l={key:0,class:`mb-3 text-lg font-semibold`},u={class:`divide-y rounded-lg border bg-card px-4`},d={key:0,class:`py-3 text-sm text-muted-foreground`},f={__name:`BirthdaysBlock`,props:{block:{type:Object,required:!0}},setup(f){return(p,m)=>(r(),t(`section`,null,[f.block.data.title?(r(),t(`h3`,l,a(f.block.data.title),1)):s(``,!0),e(`div`,u,[(r(!0),t(i,null,n(f.block.props?.birthdays??[],e=>(r(),o(c,{key:`${e.person.id}-${e.date}`,item:e},null,8,[`item`]))),128)),(f.block.props?.birthdays??[]).length?s(``,!0):(r(),t(`p`,d,`Keine anstehenden Geburtstage.`))])]))}};export{f as default};

View file

@ -0,0 +1 @@
import{J as e,On as t,Zn as n,_ as r,b as i,mt as a,tr as o,v as s,wt as c,y as l}from"./runtime-core.esm-bundler-B8D2lM98.js";import{J as u,L as d}from"./AppIcon-BVHFLm12.js";import{S as f,v as p,x as m}from"./http-9R3L4KBg.js";import{t as h}from"./circle-alert-qymEjja5.js";var g=[`role`],_={class:`min-w-0 flex-1`},v={key:0,class:`mb-2 font-semibold`},y={__name:`Box`,props:{block:{type:Object,required:!0}},setup(y){let b=e(`pagebuilder:list`),x={info:{icon:m,class:`border-sky-200 bg-sky-50 text-sky-950 dark:border-sky-900 dark:bg-sky-950/40 dark:text-sky-100`,iconClass:`text-sky-600 dark:text-sky-400`},note:{icon:u,class:`border-amber-200 bg-amber-50 text-amber-950 dark:border-amber-900 dark:bg-amber-950/40 dark:text-amber-100`,iconClass:`text-amber-600 dark:text-amber-400`},warning:{icon:p,class:`border-red-200 bg-red-50 text-red-950 dark:border-red-900 dark:bg-red-950/40 dark:text-red-100`,iconClass:`text-red-600 dark:text-red-400`},success:{icon:f,class:`border-emerald-200 bg-emerald-50 text-emerald-950 dark:border-emerald-900 dark:bg-emerald-950/40 dark:text-emerald-100`,iconClass:`text-emerald-600 dark:text-emerald-400`},neutral:{icon:h,class:`border-border bg-muted text-foreground`,iconClass:`text-muted-foreground`},highlight:{icon:d,class:`border-brand-200 bg-brand-soft text-foreground`,iconClass:`text-brand-text`}};return(e,u)=>(a(),i(`aside`,{class:n([`pb-box flex gap-3 rounded-lg border p-4 @xl:p-5`,x[y.block.data.variant]?.class]),role:y.block.data.variant===`warning`?`alert`:`note`},[y.block.data.show_icon?(a(),s(c(x[y.block.data.variant]?.icon),{key:0,class:n([`mt-0.5 size-5 shrink-0`,x[y.block.data.variant]?.iconClass])},null,8,[`class`])):l(``,!0),r(`div`,_,[y.block.data.title?(a(),i(`p`,v,o(y.block.data.title),1)):l(``,!0),(a(),s(c(t(b)),{item:y.block.items[0]},null,8,[`item`]))])],10,g))}};export{y as default};

View file

@ -1 +0,0 @@
import{J as e,On as t,Zn as n,_ as r,b as i,mt as a,tr as o,v as s,wt as c,y as l}from"./runtime-core.esm-bundler-B8D2lM98.js";import{j as u}from"./dist-CleIz2GP.js";import{b as d,v as f,y as p}from"./http-C4J46rTq.js";import{t as m}from"./circle-alert-qymEjja5.js";import{t as h}from"./lightbulb-BXPWdUy9.js";var g=u({name:`star`,size:24,node:[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]}),_=[`role`],v={class:`min-w-0 flex-1`},y={key:0,class:`mb-2 font-semibold`},b={__name:`Box`,props:{block:{type:Object,required:!0}},setup(u){let b=e(`pagebuilder:list`),x={info:{icon:p,class:`border-sky-200 bg-sky-50 text-sky-950 dark:border-sky-900 dark:bg-sky-950/40 dark:text-sky-100`,iconClass:`text-sky-600 dark:text-sky-400`},note:{icon:h,class:`border-amber-200 bg-amber-50 text-amber-950 dark:border-amber-900 dark:bg-amber-950/40 dark:text-amber-100`,iconClass:`text-amber-600 dark:text-amber-400`},warning:{icon:f,class:`border-red-200 bg-red-50 text-red-950 dark:border-red-900 dark:bg-red-950/40 dark:text-red-100`,iconClass:`text-red-600 dark:text-red-400`},success:{icon:d,class:`border-emerald-200 bg-emerald-50 text-emerald-950 dark:border-emerald-900 dark:bg-emerald-950/40 dark:text-emerald-100`,iconClass:`text-emerald-600 dark:text-emerald-400`},neutral:{icon:m,class:`border-border bg-muted text-foreground`,iconClass:`text-muted-foreground`},highlight:{icon:g,class:`border-brand-200 bg-brand-soft text-foreground`,iconClass:`text-brand-text`}};return(e,d)=>(a(),i(`aside`,{class:n([`pb-box flex gap-3 rounded-lg border p-4 @xl:p-5`,x[u.block.data.variant]?.class]),role:u.block.data.variant===`warning`?`alert`:`note`},[u.block.data.show_icon?(a(),s(c(x[u.block.data.variant]?.icon),{key:0,class:n([`mt-0.5 size-5 shrink-0`,x[u.block.data.variant]?.iconClass])},null,8,[`class`])):l(``,!0),r(`div`,v,[u.block.data.title?(a(),i(`p`,y,o(u.block.data.title),1)):l(``,!0),(a(),s(c(t(b)),{item:u.block.items[0]},null,8,[`item`]))])],10,_))}};export{b as default};

View file

@ -1 +1 @@
import{Zn as e,_ as t,b as n,g as r,mt as i,o as a,tr as o,y as s}from"./runtime-core.esm-bundler-B8D2lM98.js";import{i as c}from"./app-DutZVOiO.js";var l={class:`flex items-center gap-3`},u=[`src`,`alt`],d=[`src`,`alt`],f=[`src`,`alt`],p=[`src`,`alt`],m=[`src`],h={class:`text-[17px] font-semibold tracking-tight`},g={__name:`BrandLogo`,props:{inverted:{type:Boolean,default:!1},compact:{type:Boolean,default:!1}},setup(g){let _=g,v=r(()=>c().props.branding),y=r(()=>v.value.portal_name.trim().charAt(0).toUpperCase()),b=r(()=>v.value.logo_dark_url??v.value.logo_url);return(r,c)=>(i(),n(`span`,l,[v.value.logo_url?(i(),n(a,{key:0},[g.compact&&v.value.logo_mark_url?(i(),n(`img`,{key:0,src:v.value.logo_mark_url,alt:v.value.portal_name,class:`size-8 sm:hidden`},null,8,u)):s(``,!0),t(`span`,{class:e(g.compact&&v.value.logo_mark_url?`hidden sm:contents`:`contents`)},[_.inverted?(i(),n(`img`,{key:0,src:b.value,alt:v.value.portal_name,class:`h-8 w-auto`},null,8,d)):(i(),n(a,{key:1},[t(`img`,{src:v.value.logo_url,alt:v.value.portal_name,class:`h-8 w-auto dark:hidden`},null,8,f),t(`img`,{src:b.value,alt:v.value.portal_name,class:`hidden h-8 w-auto dark:block`},null,8,p)],64))],2)],64)):(i(),n(a,{key:1},[v.value.logo_mark_url?(i(),n(`img`,{key:0,src:v.value.logo_mark_url,alt:``,class:`size-8`},null,8,m)):(i(),n(`span`,{key:1,class:e([`grid size-8 place-items-center rounded-md text-base font-bold`,_.inverted?`bg-white/15 text-current`:`bg-brand text-brand-foreground`])},o(y.value),3)),t(`span`,h,o(v.value.portal_name),1)],64))]))}};export{g as t};
import{Zn as e,_ as t,b as n,g as r,mt as i,o as a,tr as o,y as s}from"./runtime-core.esm-bundler-B8D2lM98.js";import{i as c}from"./app-CIvn5Z1l.js";var l={class:`flex items-center gap-3`},u=[`src`,`alt`],d=[`src`,`alt`],f=[`src`,`alt`],p=[`src`,`alt`],m=[`src`],h={class:`text-[17px] font-semibold tracking-tight`},g={__name:`BrandLogo`,props:{inverted:{type:Boolean,default:!1},compact:{type:Boolean,default:!1}},setup(g){let _=g,v=r(()=>c().props.branding),y=r(()=>v.value.portal_name.trim().charAt(0).toUpperCase()),b=r(()=>v.value.logo_dark_url??v.value.logo_url);return(r,c)=>(i(),n(`span`,l,[v.value.logo_url?(i(),n(a,{key:0},[g.compact&&v.value.logo_mark_url?(i(),n(`img`,{key:0,src:v.value.logo_mark_url,alt:v.value.portal_name,class:`size-8 sm:hidden`},null,8,u)):s(``,!0),t(`span`,{class:e(g.compact&&v.value.logo_mark_url?`hidden sm:contents`:`contents`)},[_.inverted?(i(),n(`img`,{key:0,src:b.value,alt:v.value.portal_name,class:`h-8 w-auto`},null,8,d)):(i(),n(a,{key:1},[t(`img`,{src:v.value.logo_url,alt:v.value.portal_name,class:`h-8 w-auto dark:hidden`},null,8,f),t(`img`,{src:b.value,alt:v.value.portal_name,class:`hidden h-8 w-auto dark:block`},null,8,p)],64))],2)],64)):(i(),n(a,{key:1},[v.value.logo_mark_url?(i(),n(`img`,{key:0,src:v.value.logo_mark_url,alt:``,class:`size-8`},null,8,m)):(i(),n(`span`,{key:1,class:e([`grid size-8 place-items-center rounded-md text-base font-bold`,_.inverted?`bg-white/15 text-current`:`bg-brand text-brand-foreground`])},o(y.value),3)),t(`span`,h,o(v.value.portal_name),1)],64))]))}};export{g as t};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1 +0,0 @@
import{D as e,E as t,On as n,Zn as r,_ as i,b as a,bt as o,mt as s,o as c,qt as l,tr as u,y as d}from"./runtime-core.esm-bundler-B8D2lM98.js";import{n as f}from"./app-DutZVOiO.js";import{t as p}from"./mail-BdcYMJ5_.js";import{_ as m}from"./format-2iB7L6ww.js";import{t as h}from"./phone-B-aOouYp.js";var g={key:0,class:`mb-3 text-lg font-semibold`},_={class:`min-w-0`},v={key:0,class:`truncate text-[13px] text-muted-foreground`},y={class:`mt-1.5 flex flex-wrap gap-x-4 gap-y-1 text-[13px]`},b=[`href`],x=[`href`],S={class:`truncate`},C={key:0,class:`text-sm text-muted-foreground`},w={__name:`Contacts`,props:{block:{type:Object,required:!0}},setup(w){return(T,E)=>(s(),a(`section`,null,[w.block.data.title?(s(),a(`h3`,g,u(w.block.data.title),1)):d(``,!0),i(`div`,{class:r(w.block.data.layout===`list`?`divide-y rounded-lg border bg-card`:`grid gap-4 @xl:grid-cols-2 @4xl:grid-cols-3`)},[(s(!0),a(c,null,o(w.block.props?.people??[],o=>(s(),a(`div`,{key:o.id,class:r([`flex gap-3`,w.block.data.layout===`list`?`items-center px-4 py-3`:`rounded-lg border bg-card p-4`])},[e(m,{person:o,class:`size-12 shrink-0`},null,8,[`person`]),i(`div`,_,[e(n(f),{href:`/personen/${o.id}`,class:`block truncate font-semibold hover:underline`},{default:l(()=>[t(u(o.name),1)]),_:2},1032,[`href`]),o.job_title?(s(),a(`p`,v,u(o.job_title),1)):d(``,!0),i(`div`,y,[o.phone?(s(),a(`a`,{key:0,href:`tel:${o.phone}`,class:`inline-flex items-center gap-1 text-brand-text hover:underline`},[e(n(h),{class:`size-3.5`}),t(` `+u(o.phone),1)],8,b)):d(``,!0),i(`a`,{href:`mailto:${o.email}`,class:`inline-flex min-w-0 items-center gap-1 text-brand-text hover:underline`},[e(n(p),{class:`size-3.5 shrink-0`}),E[0]||=t(),i(`span`,S,u(o.email),1)],8,x)])])],2))),128)),(w.block.props?.people??[]).length?d(``,!0):(s(),a(`p`,C,`Noch keine Personen ausgewählt.`))],2)]))}};export{w as default};

View file

@ -0,0 +1 @@
import{D as e,E as t,On as n,Zn as r,_ as i,b as a,bt as o,mt as s,o as c,qt as l,tr as u,y as d}from"./runtime-core.esm-bundler-B8D2lM98.js";import{n as f}from"./app-CIvn5Z1l.js";import{K as p,b as m}from"./AppIcon-BVHFLm12.js";import{y as h}from"./http-9R3L4KBg.js";var g={key:0,class:`mb-3 text-lg font-semibold`},_={class:`min-w-0`},v={key:0,class:`truncate text-[13px] text-muted-foreground`},y={class:`mt-1.5 flex flex-wrap gap-x-4 gap-y-1 text-[13px]`},b=[`href`],x=[`href`],S={class:`truncate`},C={key:0,class:`text-sm text-muted-foreground`},w={__name:`Contacts`,props:{block:{type:Object,required:!0}},setup(w){return(T,E)=>(s(),a(`section`,null,[w.block.data.title?(s(),a(`h3`,g,u(w.block.data.title),1)):d(``,!0),i(`div`,{class:r(w.block.data.layout===`list`?`divide-y rounded-lg border bg-card`:`grid gap-4 @xl:grid-cols-2 @4xl:grid-cols-3`)},[(s(!0),a(c,null,o(w.block.props?.people??[],o=>(s(),a(`div`,{key:o.id,class:r([`flex gap-3`,w.block.data.layout===`list`?`items-center px-4 py-3`:`rounded-lg border bg-card p-4`])},[e(m,{person:o,class:`size-12 shrink-0`},null,8,[`person`]),i(`div`,_,[e(n(f),{href:`/personen/${o.id}`,class:`block truncate font-semibold hover:underline`},{default:l(()=>[t(u(o.name),1)]),_:2},1032,[`href`]),o.job_title?(s(),a(`p`,v,u(o.job_title),1)):d(``,!0),i(`div`,y,[o.phone?(s(),a(`a`,{key:0,href:`tel:${o.phone}`,class:`inline-flex items-center gap-1 text-brand-text hover:underline`},[e(n(h),{class:`size-3.5`}),t(` `+u(o.phone),1)],8,b)):d(``,!0),i(`a`,{href:`mailto:${o.email}`,class:`inline-flex min-w-0 items-center gap-1 text-brand-text hover:underline`},[e(n(p),{class:`size-3.5 shrink-0`}),E[0]||=t(),i(`span`,S,u(o.email),1)],8,x)])])],2))),128)),(w.block.props?.people??[]).length?d(``,!0):(s(),a(`p`,C,`Noch keine Personen ausgewählt.`))],2)]))}};export{w as default};

View file

@ -1 +0,0 @@
import{On as e,Zn as t,_ as n,b as r,mt as i,qt as a,tr as o,v as s,wt as c,y as l}from"./runtime-core.esm-bundler-B8D2lM98.js";import{b as u,v as d,y as f}from"./http-C4J46rTq.js";import{t as p}from"./circle-alert-qymEjja5.js";import{t as m}from"./megaphone-DL1vN9P4.js";import{t as h}from"./Panel-CSRDt0_D.js";var g=[`src`,`alt`],_={key:0,class:`block px-4 py-3 text-sm font-semibold group-hover:underline`},v={class:`min-w-0 flex-1`},y={key:0,class:`font-semibold`},b=[`innerHTML`],x=[`href`,`target`],S=[`innerHTML`],C=[`href`,`target`],w={__name:`CustomTile`,props:{tile:{type:Object,required:!0}},setup(w){let T={brand:{icon:m,class:`border-brand bg-brand text-brand-foreground`},info:{icon:f,class:`border-sky-200 bg-sky-50 text-sky-950 dark:border-sky-900 dark:bg-sky-950/40 dark:text-sky-100`},success:{icon:u,class:`border-emerald-200 bg-emerald-50 text-emerald-950 dark:border-emerald-900 dark:bg-emerald-950/40 dark:text-emerald-100`},warning:{icon:d,class:`border-red-200 bg-red-50 text-red-950 dark:border-red-900 dark:bg-red-950/40 dark:text-red-100`},neutral:{icon:p,class:`border-border bg-card text-foreground`}};return(u,d)=>w.tile.type===`image`&&w.tile.image_url?(i(),s(c(w.tile.url?`a`:`figure`),{key:0,href:w.tile.url||void 0,target:w.tile.url&&w.tile.new_tab?`_blank`:void 0,rel:w.tile.url&&w.tile.new_tab?`noopener`:void 0,class:`group block overflow-hidden rounded-lg border bg-card`},{default:a(()=>[n(`img`,{src:w.tile.image_url,alt:w.tile.alt||w.tile.title||``,loading:`lazy`,class:`w-full object-cover transition-transform duration-300 group-hover:scale-[1.02]`},null,8,g),w.tile.title?(i(),r(`span`,_,o(w.tile.title),1)):l(``,!0)]),_:1},8,[`href`,`target`,`rel`])):w.tile.type===`notice`?(i(),r(`section`,{key:1,class:t([`pb-box flex gap-3 rounded-lg border p-4 sm:p-5`,T[w.tile.variant]?.class??T.brand.class])},[(i(),s(c(T[w.tile.variant]?.icon??e(m)),{class:`mt-0.5 size-5 shrink-0`})),n(`div`,v,[w.tile.title?(i(),r(`p`,y,o(w.tile.title),1)):l(``,!0),w.tile.html?(i(),r(`div`,{key:1,class:t([`prose prose-sm max-w-none [&_a]:underline`,w.tile.title?`mt-1`:``]),innerHTML:w.tile.html},null,10,b)):l(``,!0),w.tile.url?(i(),r(`a`,{key:2,href:w.tile.url,target:w.tile.new_tab?`_blank`:void 0,class:`mt-2 inline-block text-sm font-medium underline`},`Mehr erfahren`,8,x)):l(``,!0)])],2)):(i(),s(h,{key:2,title:w.tile.title||``},{default:a(()=>[n(`div`,{class:`prose prose-sm prose-neutral max-w-none prose-img:rounded-md`,innerHTML:w.tile.html},null,8,S),w.tile.url?(i(),r(`a`,{key:0,href:w.tile.url,target:w.tile.new_tab?`_blank`:void 0,class:`mt-3 inline-block text-[13px] font-medium text-brand-text hover:underline`},`Mehr erfahren`,8,C)):l(``,!0)]),_:1},8,[`title`]))}};export{w as default};

View file

@ -0,0 +1 @@
import{On as e,Zn as t,_ as n,b as r,mt as i,qt as a,tr as o,v as s,wt as c,y as l}from"./runtime-core.esm-bundler-B8D2lM98.js";import{W as u}from"./AppIcon-BVHFLm12.js";import{S as d,v as f,x as p}from"./http-9R3L4KBg.js";import{t as m}from"./circle-alert-qymEjja5.js";import{t as h}from"./Panel-xPHuwfuu.js";var g=[`src`,`alt`],_={key:0,class:`block px-4 py-3 text-sm font-semibold group-hover:underline`},v={class:`min-w-0 flex-1`},y={key:0,class:`font-semibold`},b=[`innerHTML`],x=[`href`,`target`],S=[`innerHTML`],C=[`href`,`target`],w={__name:`CustomTile`,props:{tile:{type:Object,required:!0}},setup(w){let T={brand:{icon:u,class:`border-brand bg-brand text-brand-foreground`},info:{icon:p,class:`border-sky-200 bg-sky-50 text-sky-950 dark:border-sky-900 dark:bg-sky-950/40 dark:text-sky-100`},success:{icon:d,class:`border-emerald-200 bg-emerald-50 text-emerald-950 dark:border-emerald-900 dark:bg-emerald-950/40 dark:text-emerald-100`},warning:{icon:f,class:`border-red-200 bg-red-50 text-red-950 dark:border-red-900 dark:bg-red-950/40 dark:text-red-100`},neutral:{icon:m,class:`border-border bg-card text-foreground`}};return(d,f)=>w.tile.type===`image`&&w.tile.image_url?(i(),s(c(w.tile.url?`a`:`figure`),{key:0,href:w.tile.url||void 0,target:w.tile.url&&w.tile.new_tab?`_blank`:void 0,rel:w.tile.url&&w.tile.new_tab?`noopener`:void 0,class:`group block overflow-hidden rounded-lg border bg-card`},{default:a(()=>[n(`img`,{src:w.tile.image_url,alt:w.tile.alt||w.tile.title||``,loading:`lazy`,class:`w-full object-cover transition-transform duration-300 group-hover:scale-[1.02]`},null,8,g),w.tile.title?(i(),r(`span`,_,o(w.tile.title),1)):l(``,!0)]),_:1},8,[`href`,`target`,`rel`])):w.tile.type===`notice`?(i(),r(`section`,{key:1,class:t([`pb-box flex gap-3 rounded-lg border p-4 sm:p-5`,T[w.tile.variant]?.class??T.brand.class])},[(i(),s(c(T[w.tile.variant]?.icon??e(u)),{class:`mt-0.5 size-5 shrink-0`})),n(`div`,v,[w.tile.title?(i(),r(`p`,y,o(w.tile.title),1)):l(``,!0),w.tile.html?(i(),r(`div`,{key:1,class:t([`prose prose-sm max-w-none [&_a]:underline`,w.tile.title?`mt-1`:``]),innerHTML:w.tile.html},null,10,b)):l(``,!0),w.tile.url?(i(),r(`a`,{key:2,href:w.tile.url,target:w.tile.new_tab?`_blank`:void 0,class:`mt-2 inline-block text-sm font-medium underline`},`Mehr erfahren`,8,x)):l(``,!0)])],2)):(i(),s(h,{key:2,title:w.tile.title||``},{default:a(()=>[n(`div`,{class:`prose prose-sm prose-neutral max-w-none prose-img:rounded-md`,innerHTML:w.tile.html},null,8,S),w.tile.url?(i(),r(`a`,{key:0,href:w.tile.url,target:w.tile.new_tab?`_blank`:void 0,class:`mt-3 inline-block text-[13px] font-medium text-brand-text hover:underline`},`Mehr erfahren`,8,C)):l(``,!0)]),_:1},8,[`title`]))}};export{w as default};

View file

@ -0,0 +1,2 @@
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CustomTile-rpvbUDGX.js","assets/runtime-core.esm-bundler-B8D2lM98.js","assets/AppIcon-BVHFLm12.js","assets/usePrimitiveElement-BOk1PFhF.js","assets/runtime-dom.esm-bundler-BEWGoe8n.js","assets/dist-CleIz2GP.js","assets/app-CIvn5Z1l.js","assets/app-BZMCjaRn.css","assets/RovingFocusGroup-NIVUjBd5.js","assets/http-9R3L4KBg.js","assets/circle-alert-qymEjja5.js","assets/Panel-xPHuwfuu.js","assets/chevron-right-DR4LjgDm.js","assets/Greeting-B05GQpKd.js","assets/AppLayout-Cy38OwfZ.js","assets/BrandLogo-TGGJyC1K.js","assets/NewColleagues-DMxyPHNm.js","assets/PeopleSearch-lOnxyLDv.js","assets/arrow-right-CdMsByuI.js","assets/ProfileIncomplete-D_-55Kim.js","assets/QuickLinks-DD-ribbK.js","assets/chevron-left-CfNljcKt.js","assets/dist-BRRmd-wM.js","assets/Greeting-BNtvUzyI.js","assets/Upcoming-2G8rjb71.js","assets/BirthdayItem-DK6xURSZ.js","assets/MyDownloads-C3KvafhB.js","assets/FileIcon-BHQ0ftg2.js","assets/Upcoming-DpyMBhkM.js","assets/EmptyState-Ceq4v8mE.js","assets/EventListItem-C_pDZ4ur.js","assets/EventDateBlock-Cxz_hY6g.js","assets/Areas-Bzac5pwG.js","assets/NewsCard-CWMFENyt.js","assets/NewsImage-31QS1JbU.js","assets/Hero-OPvK6LV0.js","assets/play-_hM1KTvn.js","assets/Latest-CZZxoFB3.js","assets/NewsListItem-DmR535f5.js"])))=>i.map(i=>d[i]);
import{O as e,On as t,_ as n,b as r,bt as i,et as a,g as o,mt as s,o as c,qt as l,v as u,wt as d,y as f}from"./runtime-core.esm-bundler-B8D2lM98.js";import{o as p}from"./app-CIvn5Z1l.js";import{t as m}from"./AppLayout-Cy38OwfZ.js";import{n as h}from"./dist-BRRmd-wM.js";var g=Object.assign({"../widgets/CustomTile.vue":()=>p(()=>import(`./CustomTile-rpvbUDGX.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])),"../widgets/Greeting.vue":()=>p(()=>import(`./Greeting-B05GQpKd.js`),__vite__mapDeps([13,1,6,4,7,2,3,5,8,9,14,15])),"../widgets/NewColleagues.vue":()=>p(()=>import(`./NewColleagues-DMxyPHNm.js`),__vite__mapDeps([16,1,6,4,7,2,3,5,8,9,11,12])),"../widgets/PeopleSearch.vue":()=>p(()=>import(`./PeopleSearch-lOnxyLDv.js`),__vite__mapDeps([17,1,6,4,7,2,3,5,8,9,18,11,12])),"../widgets/ProfileIncomplete.vue":()=>p(()=>import(`./ProfileIncomplete-D_-55Kim.js`),__vite__mapDeps([19,1,6,4,7,14,3,5,2,8,9,15])),"../widgets/QuickLinks.vue":()=>p(()=>import(`./QuickLinks-DD-ribbK.js`),__vite__mapDeps([20,1,6,4,7,2,3,5,8,9,21,12,22]))}),_=Object.assign({"../../../plugins-core/birthdays/resources/js/widgets/Greeting.vue":()=>p(()=>import(`./Greeting-BNtvUzyI.js`),__vite__mapDeps([23,1,2,3,4,5,6,7,8,9])),"../../../plugins-core/birthdays/resources/js/widgets/Upcoming.vue":()=>p(()=>import(`./Upcoming-2G8rjb71.js`),__vite__mapDeps([24,1,25,6,4,7,2,3,5,8,9,11,12])),"../../../plugins-core/downloads/resources/js/widgets/MyDownloads.vue":()=>p(()=>import(`./MyDownloads-C3KvafhB.js`),__vite__mapDeps([26,1,2,3,4,5,6,7,8,9,27,11,12])),"../../../plugins-core/events/resources/js/widgets/Upcoming.vue":()=>p(()=>import(`./Upcoming-DpyMBhkM.js`),__vite__mapDeps([28,1,2,3,4,5,6,7,8,9,29,11,12,30,31])),"../../../plugins-core/news/resources/js/widgets/Areas.vue":()=>p(()=>import(`./Areas-Bzac5pwG.js`),__vite__mapDeps([32,1,11,6,4,7,12,5,33,2,3,8,9,34])),"../../../plugins-core/news/resources/js/widgets/Hero.vue":()=>p(()=>import(`./Hero-OPvK6LV0.js`),__vite__mapDeps([35,1,4,6,7,5,18,21,12,36])),"../../../plugins-core/news/resources/js/widgets/Latest.vue":()=>p(()=>import(`./Latest-CZZxoFB3.js`),__vite__mapDeps([37,1,2,3,4,5,6,7,8,9,29,11,12,38,34]))}),v={};for(let[t,n]of Object.entries(g))v[`core::${t.split(`/`).pop().replace(`.vue`,``)}`]=e(n);for(let[t,n]of Object.entries(_)){let[,r]=t.match(/plugins-core\/([^/]+)\//);v[`${r}::${t.split(`/`).pop().replace(`.vue`,``)}`]=e(n)}function y(e){return v[e]??null}var b={key:0,class:`mb-6 grid gap-6`},x={key:1,class:`grid grid-cols-12 gap-6`},S={class:`col-span-8 grid min-w-0 grid-cols-1 content-start gap-6 xl:col-span-9 xl:grid-cols-3`},C={class:`col-span-4 grid min-w-0 grid-cols-1 content-start gap-6 xl:col-span-3`},w={key:2,class:`grid min-w-0 grid-cols-1 gap-6`},T={__name:`Dashboard`,props:{widgets:{type:Array,required:!0}},setup(e){let p=e,g=h(`(min-width: 1024px)`),_=o(()=>p.widgets.filter(e=>y(e.component))),v=e=>_.value.filter(t=>t.area===e),T=o(()=>v(`hero`)[0]??null),E=o(()=>[..._.value].sort((e,t)=>e.mobileSort-t.mobileSort));return(e,o)=>(s(),u(m,{title:`Startseite`},{default:l(()=>[t(g)&&v(`top`).length?(s(),r(`div`,b,[(s(!0),r(c,null,i(v(`top`),e=>(s(),u(d(t(y)(e.component)),a({key:e.key},{ref_for:!0},e.props),null,16))),128))])):f(``,!0),t(g)?(s(),r(`div`,x,[n(`div`,S,[T.value?(s(),u(d(t(y)(T.value.component)),a({key:0},T.value.props,{class:`xl:col-span-2`}),null,16)):f(``,!0),(s(!0),r(c,null,i(v(`feed`),e=>(s(),u(d(t(y)(e.component)),a({key:e.key},{ref_for:!0},e.props,{wide:!T.value,class:T.value?`xl:col-span-1`:`xl:col-span-3`}),null,16,[`wide`,`class`]))),128)),(s(!0),r(c,null,i(v(`main`),e=>(s(),u(d(t(y)(e.component)),a({key:e.key},{ref_for:!0},e.props,{class:`xl:col-span-3`}),null,16))),128))]),n(`aside`,C,[(s(!0),r(c,null,i(v(`aside`),e=>(s(),u(d(t(y)(e.component)),a({key:e.key},{ref_for:!0},e.props),null,16))),128))])])):(s(),r(`div`,w,[(s(!0),r(c,null,i(E.value,e=>(s(),u(d(t(y)(e.component)),a({key:e.key},{ref_for:!0},e.props),null,16))),128))]))]),_:1}))}};export{T as default};

View file

@ -1,2 +0,0 @@
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CustomTile-DIqwZ_up.js","assets/runtime-core.esm-bundler-B8D2lM98.js","assets/http-C4J46rTq.js","assets/usePrimitiveElement-BOk1PFhF.js","assets/runtime-dom.esm-bundler-BEWGoe8n.js","assets/dist-CleIz2GP.js","assets/circle-alert-qymEjja5.js","assets/megaphone-DL1vN9P4.js","assets/Panel-CSRDt0_D.js","assets/app-DutZVOiO.js","assets/app-ByBIwDRK.css","assets/chevron-right-DR4LjgDm.js","assets/Greeting-5T-q1GH6.js","assets/AppLayout-TVgriWCn.js","assets/format-2iB7L6ww.js","assets/RovingFocusGroup-rJCF33aj.js","assets/BrandLogo-C_Q4jJ0X.js","assets/NewColleagues-BCt7scUE.js","assets/PeopleSearch-3CUTorxR.js","assets/arrow-right-CdMsByuI.js","assets/ProfileIncomplete-BKCtjmPt.js","assets/QuickLinks-CZRpiTG6.js","assets/icons-COQb0lsF.js","assets/building-complex-CrN0pJ2v.js","assets/calendar-days-s3GhWVmT.js","assets/clock-CH5MxcFu.js","assets/file-text-4udxc_PB.js","assets/folder-RPbMRHJl.js","assets/lightbulb-BXPWdUy9.js","assets/link-mbI8ikd_.js","assets/mail-BdcYMJ5_.js","assets/phone-B-aOouYp.js","assets/shield-check-DkQMxjpx.js","assets/users-DBJKCYY2.js","assets/chevron-left-CfNljcKt.js","assets/dist-BRRmd-wM.js","assets/Greeting-BN7uh037.js","assets/cake-DYVAYX9m.js","assets/Upcoming-DENAYDeN.js","assets/BirthdayItem-B6-Z7Zov.js","assets/Upcoming-DjDGjJmS.js","assets/EmptyState-Ceq4v8mE.js","assets/EventListItem-Ba4pBmM-.js","assets/EventDateBlock-BNB1SIga.js","assets/Areas-BcDw3EVv.js","assets/NewsCard-CXsirogk.js","assets/NewsImage-DDjX5Y1w.js","assets/Hero-DMrqXgYz.js","assets/play-_hM1KTvn.js","assets/Latest-o6VLverX.js","assets/NewsListItem-BwQqJd5p.js"])))=>i.map(i=>d[i]);
import{O as e,On as t,_ as n,b as r,bt as i,et as a,g as o,mt as s,o as c,qt as l,v as u,wt as d,y as f}from"./runtime-core.esm-bundler-B8D2lM98.js";import{o as p}from"./app-DutZVOiO.js";import{t as m}from"./AppLayout-TVgriWCn.js";import{n as h}from"./dist-BRRmd-wM.js";var g=Object.assign({"../widgets/CustomTile.vue":()=>p(()=>import(`./CustomTile-DIqwZ_up.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])),"../widgets/Greeting.vue":()=>p(()=>import(`./Greeting-5T-q1GH6.js`),__vite__mapDeps([12,1,9,4,10,13,3,5,2,14,15,16])),"../widgets/NewColleagues.vue":()=>p(()=>import(`./NewColleagues-BCt7scUE.js`),__vite__mapDeps([17,1,9,4,10,14,3,5,2,15,8,11])),"../widgets/PeopleSearch.vue":()=>p(()=>import(`./PeopleSearch-3CUTorxR.js`),__vite__mapDeps([18,1,9,4,10,19,5,14,3,2,15,8,11])),"../widgets/ProfileIncomplete.vue":()=>p(()=>import(`./ProfileIncomplete-BKCtjmPt.js`),__vite__mapDeps([20,1,9,4,10,13,3,5,2,14,15,16])),"../widgets/QuickLinks.vue":()=>p(()=>import(`./QuickLinks-CZRpiTG6.js`),__vite__mapDeps([21,1,9,4,10,22,5,23,24,25,26,27,28,29,30,7,14,3,2,15,31,32,33,34,11,35]))}),_=Object.assign({"../../../plugins-core/birthdays/resources/js/widgets/Greeting.vue":()=>p(()=>import(`./Greeting-BN7uh037.js`),__vite__mapDeps([36,1,37,5,2,3,4])),"../../../plugins-core/birthdays/resources/js/widgets/Upcoming.vue":()=>p(()=>import(`./Upcoming-DENAYDeN.js`),__vite__mapDeps([38,1,39,9,4,10,37,5,14,3,2,15,8,11])),"../../../plugins-core/events/resources/js/widgets/Upcoming.vue":()=>p(()=>import(`./Upcoming-DjDGjJmS.js`),__vite__mapDeps([40,1,24,5,41,8,9,4,10,11,42,14,3,2,15,43])),"../../../plugins-core/news/resources/js/widgets/Areas.vue":()=>p(()=>import(`./Areas-BcDw3EVv.js`),__vite__mapDeps([44,1,8,9,4,10,11,5,45,14,3,2,15,46])),"../../../plugins-core/news/resources/js/widgets/Hero.vue":()=>p(()=>import(`./Hero-DMrqXgYz.js`),__vite__mapDeps([47,1,4,9,10,5,19,34,11,48])),"../../../plugins-core/news/resources/js/widgets/Latest.vue":()=>p(()=>import(`./Latest-o6VLverX.js`),__vite__mapDeps([49,1,14,3,4,5,2,15,41,8,9,10,11,50,46]))}),v={};for(let[t,n]of Object.entries(g))v[`core::${t.split(`/`).pop().replace(`.vue`,``)}`]=e(n);for(let[t,n]of Object.entries(_)){let[,r]=t.match(/plugins-core\/([^/]+)\//);v[`${r}::${t.split(`/`).pop().replace(`.vue`,``)}`]=e(n)}function y(e){return v[e]??null}var b={key:0,class:`mb-6 grid gap-6`},x={key:1,class:`grid grid-cols-12 gap-6`},S={class:`col-span-8 grid min-w-0 grid-cols-1 content-start gap-6 xl:col-span-9 xl:grid-cols-3`},C={class:`col-span-4 grid min-w-0 grid-cols-1 content-start gap-6 xl:col-span-3`},w={key:2,class:`grid min-w-0 grid-cols-1 gap-6`},T={__name:`Dashboard`,props:{widgets:{type:Array,required:!0}},setup(e){let p=e,g=h(`(min-width: 1024px)`),_=o(()=>p.widgets.filter(e=>y(e.component))),v=e=>_.value.filter(t=>t.area===e),T=o(()=>v(`hero`)[0]??null),E=o(()=>[..._.value].sort((e,t)=>e.mobileSort-t.mobileSort));return(e,o)=>(s(),u(m,{title:`Startseite`},{default:l(()=>[t(g)&&v(`top`).length?(s(),r(`div`,b,[(s(!0),r(c,null,i(v(`top`),e=>(s(),u(d(t(y)(e.component)),a({key:e.key},{ref_for:!0},e.props),null,16))),128))])):f(``,!0),t(g)?(s(),r(`div`,x,[n(`div`,S,[T.value?(s(),u(d(t(y)(T.value.component)),a({key:0},T.value.props,{class:`xl:col-span-2`}),null,16)):f(``,!0),(s(!0),r(c,null,i(v(`feed`),e=>(s(),u(d(t(y)(e.component)),a({key:e.key},{ref_for:!0},e.props,{wide:!T.value,class:T.value?`xl:col-span-1`:`xl:col-span-3`}),null,16,[`wide`,`class`]))),128)),(s(!0),r(c,null,i(v(`main`),e=>(s(),u(d(t(y)(e.component)),a({key:e.key},{ref_for:!0},e.props,{class:`xl:col-span-3`}),null,16))),128))]),n(`aside`,C,[(s(!0),r(c,null,i(v(`aside`),e=>(s(),u(d(t(y)(e.component)),a({key:e.key},{ref_for:!0},e.props),null,16))),128))])])):(s(),r(`div`,w,[(s(!0),r(c,null,i(E.value,e=>(s(),u(d(t(y)(e.component)),a({key:e.key},{ref_for:!0},e.props),null,16))),128))]))]),_:1}))}};export{T as default};

View file

@ -0,0 +1 @@
import{a as e}from"./usePrimitiveElement-BOk1PFhF.js";import{On as t,Zn as n,b as r,et as i,k as a,mt as o,qt as s,v as c,xt as l}from"./runtime-core.esm-bundler-B8D2lM98.js";import{d as u,h as d,o as f,p}from"./dist-CleIz2GP.js";import{j as m}from"./AppIcon-BVHFLm12.js";var h=a({__name:`DialogDescription`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`p`}},setup(e){let n=e;d();let r=m();return(e,a)=>(o(),c(t(p),i(n,{id:t(r).descriptionId}),{default:s(()=>[l(e.$slots,`default`)]),_:3},16,[`id`]))}}),g=a({__name:`DialogDescription`,props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(n){let r=n,a=f(r,`class`),d=e(a);return(e,n)=>(o(),c(t(h),i({"data-slot":`dialog-description`},t(d),{class:t(u)(`text-muted-foreground text-sm`,r.class)}),{default:s(()=>[l(e.$slots,`default`)]),_:3},16,[`class`]))}}),_=a({__name:`DialogHeader`,props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){let i=e;return(e,a)=>(o(),r(`div`,{"data-slot":`dialog-header`,class:n(t(u)(`flex flex-col gap-2 text-center sm:text-left`,i.class))},[l(e.$slots,`default`)],2))}});export{g as n,_ as t};

View file

@ -1 +0,0 @@
import{a as e}from"./usePrimitiveElement-BOk1PFhF.js";import{On as t,Zn as n,b as r,et as i,k as a,mt as o,qt as s,v as c,xt as l}from"./runtime-core.esm-bundler-B8D2lM98.js";import{d as u,h as d,o as f,p}from"./dist-CleIz2GP.js";import{D as m}from"./format-2iB7L6ww.js";var h=a({__name:`DialogDescription`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`p`}},setup(e){let n=e;d();let r=m();return(e,a)=>(o(),c(t(p),i(n,{id:t(r).descriptionId}),{default:s(()=>[l(e.$slots,`default`)]),_:3},16,[`id`]))}}),g=a({__name:`DialogDescription`,props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(n){let r=n,a=f(r,`class`),d=e(a);return(e,n)=>(o(),c(t(h),i({"data-slot":`dialog-description`},t(d),{class:t(u)(`text-muted-foreground text-sm`,r.class)}),{default:s(()=>[l(e.$slots,`default`)]),_:3},16,[`class`]))}}),_=a({__name:`DialogHeader`,props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){let i=e;return(e,a)=>(o(),r(`div`,{"data-slot":`dialog-header`,class:n(t(u)(`flex flex-col gap-2 text-center sm:text-left`,i.class))},[l(e.$slots,`default`)],2))}});export{g as n,_ as t};

View file

@ -1 +1 @@
import{D as e,E as t,On as n,_ as r,mt as i,qt as a,v as o,vn as s,y as c}from"./runtime-core.esm-bundler-B8D2lM98.js";import{w as l}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{n as u,r as d}from"./app-DutZVOiO.js";import{A as f}from"./dist-CleIz2GP.js";import{t as p}from"./arrow-left-nZZEveo4.js";import{t as m}from"./eye-off-DWbaLHNt.js";import{t as h}from"./eye-DcTo_il4.js";import{t as g}from"./FormField-BcJMyuzX.js";import{t as _}from"./button-SRYY3-ko.js";import{t as v}from"./Input-CgjHXzkf.js";import{t as y}from"./GuestLayout-DsZqMQXS.js";var b={class:`relative`},x=[`aria-label`],S={__name:`DirectoryLogin`,props:{provider:{type:Object,required:!0}},setup(S){let C=S,w=s(!1),T=d({username:``,password:``});function E(){T.post(C.provider.action,{onFinish:()=>T.reset(`password`)})}return(s,d)=>(i(),o(y,{title:S.provider.label,description:`Mit dem Benutzernamen und Passwort, mit dem Sie sich auch am Arbeitsplatz anmelden.`},{default:a(()=>[r(`form`,{class:`grid gap-5`,onSubmit:l(E,[`prevent`])},[e(g,{id:`username`,label:S.provider.username_label,error:n(T).errors.username},{default:a(()=>[e(n(v),{id:`username`,modelValue:n(T).username,"onUpdate:modelValue":d[0]||=e=>n(T).username=e,autocomplete:`username`,autocapitalize:`none`,spellcheck:`false`,autofocus:``,class:`h-10`,"aria-invalid":!!n(T).errors.username},null,8,[`modelValue`,`aria-invalid`])]),_:1},8,[`label`,`error`]),e(g,{id:`password`,label:`Passwort`,error:n(T).errors.password},{default:a(()=>[r(`div`,b,[e(n(v),{id:`password`,modelValue:n(T).password,"onUpdate:modelValue":d[1]||=e=>n(T).password=e,type:w.value?`text`:`password`,autocomplete:`current-password`,class:`h-10 pr-10`,"aria-invalid":!!n(T).errors.password},null,8,[`modelValue`,`type`,`aria-invalid`]),r(`button`,{type:`button`,class:`absolute inset-y-0 right-0 grid w-10 place-items-center text-muted-foreground hover:text-foreground`,"aria-label":w.value?`Passwort verbergen`:`Passwort anzeigen`,onClick:d[2]||=e=>w.value=!w.value},[w.value?(i(),o(n(m),{key:0,class:`size-4`})):(i(),o(n(h),{key:1,class:`size-4`}))],8,x)])]),_:1},8,[`error`]),e(n(_),{type:`submit`,size:`lg`,class:`mt-2 h-10 w-full`,disabled:n(T).processing},{default:a(()=>[n(T).processing?(i(),o(n(f),{key:0,class:`animate-spin`})):c(``,!0),d[3]||=t(` Anmelden `,-1)]),_:1},8,[`disabled`]),e(n(u),{href:`/login`,class:`inline-flex items-center justify-center gap-1.5 text-sm text-muted-foreground hover:text-foreground`},{default:a(()=>[e(n(p),{class:`size-4`}),d[4]||=t(` Andere Anmeldung wählen `,-1)]),_:1})],32)]),_:1},8,[`title`]))}};export{S as default};
import{D as e,E as t,On as n,_ as r,mt as i,qt as a,v as o,vn as s,y as c}from"./runtime-core.esm-bundler-B8D2lM98.js";import{w as l}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{n as u,r as d}from"./app-CIvn5Z1l.js";import{A as f}from"./dist-CleIz2GP.js";import{t as p}from"./arrow-left-nZZEveo4.js";import{t as m}from"./eye-off-DWbaLHNt.js";import{t as h}from"./eye-DcTo_il4.js";import{t as g}from"./FormField-BcJMyuzX.js";import{t as _}from"./button-SRYY3-ko.js";import{t as v}from"./Input-CgjHXzkf.js";import{t as y}from"./GuestLayout-DAusAB2K.js";var b={class:`relative`},x=[`aria-label`],S={__name:`DirectoryLogin`,props:{provider:{type:Object,required:!0}},setup(S){let C=S,w=s(!1),T=d({username:``,password:``});function E(){T.post(C.provider.action,{onFinish:()=>T.reset(`password`)})}return(s,d)=>(i(),o(y,{title:S.provider.label,description:`Mit dem Benutzernamen und Passwort, mit dem Sie sich auch am Arbeitsplatz anmelden.`},{default:a(()=>[r(`form`,{class:`grid gap-5`,onSubmit:l(E,[`prevent`])},[e(g,{id:`username`,label:S.provider.username_label,error:n(T).errors.username},{default:a(()=>[e(n(v),{id:`username`,modelValue:n(T).username,"onUpdate:modelValue":d[0]||=e=>n(T).username=e,autocomplete:`username`,autocapitalize:`none`,spellcheck:`false`,autofocus:``,class:`h-10`,"aria-invalid":!!n(T).errors.username},null,8,[`modelValue`,`aria-invalid`])]),_:1},8,[`label`,`error`]),e(g,{id:`password`,label:`Passwort`,error:n(T).errors.password},{default:a(()=>[r(`div`,b,[e(n(v),{id:`password`,modelValue:n(T).password,"onUpdate:modelValue":d[1]||=e=>n(T).password=e,type:w.value?`text`:`password`,autocomplete:`current-password`,class:`h-10 pr-10`,"aria-invalid":!!n(T).errors.password},null,8,[`modelValue`,`type`,`aria-invalid`]),r(`button`,{type:`button`,class:`absolute inset-y-0 right-0 grid w-10 place-items-center text-muted-foreground hover:text-foreground`,"aria-label":w.value?`Passwort verbergen`:`Passwort anzeigen`,onClick:d[2]||=e=>w.value=!w.value},[w.value?(i(),o(n(m),{key:0,class:`size-4`})):(i(),o(n(h),{key:1,class:`size-4`}))],8,x)])]),_:1},8,[`error`]),e(n(_),{type:`submit`,size:`lg`,class:`mt-2 h-10 w-full`,disabled:n(T).processing},{default:a(()=>[n(T).processing?(i(),o(n(f),{key:0,class:`animate-spin`})):c(``,!0),d[3]||=t(` Anmelden `,-1)]),_:1},8,[`disabled`]),e(n(u),{href:`/login`,class:`inline-flex items-center justify-center gap-1.5 text-sm text-muted-foreground hover:text-foreground`},{default:a(()=>[e(n(p),{class:`size-4`}),d[4]||=t(` Andere Anmeldung wählen `,-1)]),_:1})],32)]),_:1},8,[`title`]))}};export{S as default};

View file

@ -0,0 +1 @@
import{D as e,On as t,_ as n,b as r,bt as i,mt as a,o,tr as s,y as c}from"./runtime-core.esm-bundler-B8D2lM98.js";import{$ as l}from"./AppIcon-BVHFLm12.js";import{t as u}from"./download-cH_7CRKx.js";var d={key:0,class:`mb-3 text-lg font-semibold`},f={class:`divide-y rounded-lg border bg-card`},p=[`href`],m={class:`grid size-10 shrink-0 place-items-center rounded-md bg-brand-soft text-brand-text`},h={class:`min-w-0 flex-1`},g={class:`block truncate text-sm font-medium group-hover:underline`},_={class:`block text-xs text-muted-foreground`},v={key:0,class:`px-4 py-3 text-sm text-muted-foreground`},y={__name:`Downloads`,props:{block:{type:Object,required:!0}},setup(y){let b=e=>e>1048576?`${(e/1024/1024).toFixed(1).replace(`.`,`,`)} MB`:`${Math.max(1,Math.round(e/1024))} KB`;return(x,S)=>(a(),r(`section`,null,[y.block.data.title?(a(),r(`h3`,d,s(y.block.data.title),1)):c(``,!0),n(`ul`,f,[(a(!0),r(o,null,i(y.block.props?.files??[],i=>(a(),r(`li`,{key:i.id},[n(`a`,{href:i.url,class:`group flex items-center gap-3 px-4 py-3 hover:bg-accent/50`},[n(`span`,m,[e(t(l),{class:`size-5`})]),n(`span`,h,[n(`span`,g,s(i.name),1),n(`span`,_,s(i.extension||`Datei`)+` · `+s(b(i.size)),1)]),e(t(u),{class:`size-4 shrink-0 text-muted-foreground`})],8,p)]))),128)),(y.block.props?.files??[]).length?c(``,!0):(a(),r(`li`,v,`Noch keine Dateien.`))])]))}};export{y as default};

View file

@ -1 +0,0 @@
import{D as e,On as t,_ as n,b as r,bt as i,mt as a,o,tr as s,y as c}from"./runtime-core.esm-bundler-B8D2lM98.js";import{t as l}from"./download-cH_7CRKx.js";import{t as u}from"./file-text-4udxc_PB.js";var d={key:0,class:`mb-3 text-lg font-semibold`},f={class:`divide-y rounded-lg border bg-card`},p=[`href`],m={class:`grid size-10 shrink-0 place-items-center rounded-md bg-brand-soft text-brand-text`},h={class:`min-w-0 flex-1`},g={class:`block truncate text-sm font-medium group-hover:underline`},_={class:`block text-xs text-muted-foreground`},v={key:0,class:`px-4 py-3 text-sm text-muted-foreground`},y={__name:`Downloads`,props:{block:{type:Object,required:!0}},setup(y){let b=e=>e>1048576?`${(e/1024/1024).toFixed(1).replace(`.`,`,`)} MB`:`${Math.max(1,Math.round(e/1024))} KB`;return(x,S)=>(a(),r(`section`,null,[y.block.data.title?(a(),r(`h3`,d,s(y.block.data.title),1)):c(``,!0),n(`ul`,f,[(a(!0),r(o,null,i(y.block.props?.files??[],i=>(a(),r(`li`,{key:i.id},[n(`a`,{href:i.url,class:`group flex items-center gap-3 px-4 py-3 hover:bg-accent/50`},[n(`span`,m,[e(t(u),{class:`size-5`})]),n(`span`,h,[n(`span`,g,s(i.name),1),n(`span`,_,s(i.extension||`Datei`)+` · `+s(b(i.size)),1)]),e(t(l),{class:`size-4 shrink-0 text-muted-foreground`})],8,p)]))),128)),(y.block.props?.files??[]).length?c(``,!0):(a(),r(`li`,v,`Noch keine Dateien.`))])]))}};export{y as default};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1 +1 @@
import{D as e,E as t,On as n,_ as r,b as i,bt as a,mt as o,o as s,qt as c,tr as l,v as u,y as d}from"./runtime-core.esm-bundler-B8D2lM98.js";import{n as f}from"./app-DutZVOiO.js";import{t as p}from"./download-cH_7CRKx.js";import{t as m}from"./pencil-line-Cp-EHBoW.js";import{t as h}from"./plus-cKZvz4wH.js";import{t as g}from"./table-properties-B82lvC7D.js";import{t as _}from"./button-SRYY3-ko.js";import{t as v}from"./Panel-CSRDt0_D.js";var y=[`href`],b={key:0,class:`-mx-5 divide-y border-t`},x={class:`min-w-0 flex-1`},S={class:`text-xs text-muted-foreground`},C={class:`font-medium text-brand-text`},w=[`href`],T=[`href`],E={key:1,class:`text-sm text-muted-foreground`},D={__name:`EditorialForms`,props:{forms:{type:Array,required:!0},createUrl:{type:String,default:null}},setup(D){return(O,k)=>(o(),u(v,{title:`Formulare`},{actions:c(()=>[D.createUrl?(o(),u(n(_),{key:0,size:`sm`,variant:`outline`,"as-child":``},{default:c(()=>[r(`a`,{href:D.createUrl},[e(n(h)),k[0]||=t(` Neues Formular`,-1)],8,y)]),_:1})):d(``,!0)]),default:c(()=>[D.forms.length?(o(),i(`ul`,b,[(o(!0),i(s,null,a(D.forms,a=>(o(),i(`li`,{key:a.id,class:`flex items-center gap-3 px-5 py-2.5`},[r(`div`,x,[e(n(f),{href:a.url,class:`block truncate text-sm font-medium hover:underline`},{default:c(()=>[t(l(a.title),1)]),_:2},1032,[`href`]),r(`p`,S,[t(l(a.open?`offen`:`geschlossen`)+` · `+l(a.submissions)+` Einsendungen`,1),a.unread?(o(),i(s,{key:0},[k[1]||=t(`, `,-1),r(`span`,C,l(a.unread)+` neu`,1)],64)):d(``,!0)])]),a.builder_url?(o(),u(n(_),{key:0,size:`icon`,variant:`ghost`,"as-child":``,title:`Felder bearbeiten`},{default:c(()=>[e(n(f),{href:a.builder_url},{default:c(()=>[e(n(m))]),_:1},8,[`href`])]),_:2},1024)):d(``,!0),a.results_url?(o(),u(n(_),{key:1,size:`icon`,variant:`ghost`,"as-child":``,title:`Ergebnisse`},{default:c(()=>[r(`a`,{href:a.results_url},[e(n(g))],8,w)]),_:2},1024)):d(``,!0),a.csv_url?(o(),u(n(_),{key:2,size:`icon`,variant:`ghost`,"as-child":``,title:`Ergebnisse als CSV herunterladen`},{default:c(()=>[r(`a`,{href:a.csv_url},[e(n(p))],8,T)]),_:2},1024)):d(``,!0)]))),128))])):(o(),i(`p`,E,`Noch keine Formulare.`))]),_:1}))}};export{D as default};
import{D as e,E as t,On as n,_ as r,b as i,bt as a,mt as o,o as s,qt as c,tr as l,v as u,y as d}from"./runtime-core.esm-bundler-B8D2lM98.js";import{n as f}from"./app-CIvn5Z1l.js";import{t as p}from"./download-cH_7CRKx.js";import{t as m}from"./pencil-line-Cp-EHBoW.js";import{t as h}from"./plus-cKZvz4wH.js";import{t as g}from"./table-properties-B82lvC7D.js";import{t as _}from"./button-SRYY3-ko.js";import{t as v}from"./Panel-xPHuwfuu.js";var y=[`href`],b={key:0,class:`-mx-5 divide-y border-t`},x={class:`min-w-0 flex-1`},S={class:`text-xs text-muted-foreground`},C={class:`font-medium text-brand-text`},w=[`href`],T=[`href`],E={key:1,class:`text-sm text-muted-foreground`},D={__name:`EditorialForms`,props:{forms:{type:Array,required:!0},createUrl:{type:String,default:null}},setup(D){return(O,k)=>(o(),u(v,{title:`Formulare`},{actions:c(()=>[D.createUrl?(o(),u(n(_),{key:0,size:`sm`,variant:`outline`,"as-child":``},{default:c(()=>[r(`a`,{href:D.createUrl},[e(n(h)),k[0]||=t(` Neues Formular`,-1)],8,y)]),_:1})):d(``,!0)]),default:c(()=>[D.forms.length?(o(),i(`ul`,b,[(o(!0),i(s,null,a(D.forms,a=>(o(),i(`li`,{key:a.id,class:`flex items-center gap-3 px-5 py-2.5`},[r(`div`,x,[e(n(f),{href:a.url,class:`block truncate text-sm font-medium hover:underline`},{default:c(()=>[t(l(a.title),1)]),_:2},1032,[`href`]),r(`p`,S,[t(l(a.open?`offen`:`geschlossen`)+` · `+l(a.submissions)+` Einsendungen`,1),a.unread?(o(),i(s,{key:0},[k[1]||=t(`, `,-1),r(`span`,C,l(a.unread)+` neu`,1)],64)):d(``,!0)])]),a.builder_url?(o(),u(n(_),{key:0,size:`icon`,variant:`ghost`,"as-child":``,title:`Felder bearbeiten`},{default:c(()=>[e(n(f),{href:a.builder_url},{default:c(()=>[e(n(m))]),_:1},8,[`href`])]),_:2},1024)):d(``,!0),a.results_url?(o(),u(n(_),{key:1,size:`icon`,variant:`ghost`,"as-child":``,title:`Ergebnisse`},{default:c(()=>[r(`a`,{href:a.results_url},[e(n(g))],8,w)]),_:2},1024)):d(``,!0),a.csv_url?(o(),u(n(_),{key:2,size:`icon`,variant:`ghost`,"as-child":``,title:`Ergebnisse als CSV herunterladen`},{default:c(()=>[r(`a`,{href:a.csv_url},[e(n(p))],8,T)]),_:2},1024)):d(``,!0)]))),128))])):(o(),i(`p`,E,`Noch keine Formulare.`))]),_:1}))}};export{D as default};

View file

@ -0,0 +1 @@
import{D as e,E as t,On as n,Zn as r,_ as i,b as a,bt as o,mt as s,o as c,qt as l,tr as u,v as d,y as f}from"./runtime-core.esm-bundler-B8D2lM98.js";import{n as p}from"./app-CIvn5Z1l.js";import{c as m}from"./AppIcon-BVHFLm12.js";import{t as h}from"./message-square-warning-CUD7Iy66.js";import{t as g}from"./plus-cKZvz4wH.js";import{t as _}from"./button-SRYY3-ko.js";import{t as v}from"./Panel-xPHuwfuu.js";var y={class:`grid gap-5`},b={class:`mb-1 text-xs font-semibold tracking-wide text-muted-foreground uppercase`},x={key:0,class:`ml-1 rounded-full bg-brand px-1.5 py-0.5 text-[10px] text-brand-foreground`},S={key:0,class:`-mx-5 divide-y border-y`},C={class:`min-w-0 flex-1`},w={class:`truncate text-xs text-muted-foreground`},T={key:1,class:`text-sm text-muted-foreground`},E={__name:`EditorialNews`,props:{review:{type:Array,required:!0},mine:{type:Array,required:!0},scheduled:{type:Array,required:!0},canCreate:{type:Boolean,default:!1}},setup(E){let D=e=>({pending:`bg-amber-100 text-amber-800 dark:bg-amber-900/50 dark:text-amber-200`,published:`bg-emerald-100 text-emerald-800 dark:bg-emerald-900/50 dark:text-emerald-200`,draft:`bg-muted text-muted-foreground`})[e.status];return(O,k)=>(s(),d(v,{title:`Neuigkeiten`},{actions:l(()=>[E.canCreate?(s(),d(n(_),{key:0,size:`sm`,"as-child":``},{default:l(()=>[e(n(p),{href:`/redaktion/neuigkeiten/neu`},{default:l(()=>[e(n(g)),k[0]||=t(` Neuer Beitrag`,-1)]),_:1})]),_:1})):f(``,!0)]),default:l(()=>[i(`div`,y,[(s(!0),a(c,null,o([{key:`review`,title:`Zur Freigabe`,items:E.review,empty:null},{key:`mine`,title:`Meine Entwürfe`,items:E.mine,empty:`Keine offenen Entwürfe.`},{key:`scheduled`,title:`Geplant`,items:E.scheduled,empty:null}].filter(e=>e.items.length||e.empty),g=>(s(),a(`section`,{key:g.key},[i(`h3`,b,[t(u(g.title)+` `,1),g.key===`review`?(s(),a(`span`,x,u(g.items.length),1)):f(``,!0)]),g.items.length?(s(),a(`ul`,S,[(s(!0),a(c,null,o(g.items,o=>(s(),a(`li`,{key:o.id,class:`flex items-center gap-3 px-5 py-2.5`},[i(`div`,C,[e(n(p),{href:o.edit_url,class:`block truncate text-sm font-medium hover:underline`},{default:l(()=>[t(u(o.title),1)]),_:2},1032,[`href`]),i(`p`,w,[t(u(o.category??`Ohne Kategorie`),1),g.key!==`mine`&&o.author?(s(),a(c,{key:0},[t(` · `+u(o.author),1)],64)):f(``,!0),o.date?(s(),a(c,{key:1},[t(` · `+u(n(m)(o.date)),1)],64)):f(``,!0)])]),o.review_note?(s(),d(n(h),{key:0,class:`size-4 shrink-0 text-amber-600`,title:`Mit Anmerkung zurückgegeben`})):f(``,!0),i(`span`,{class:r([`shrink-0 rounded px-1.5 py-0.5 text-[11px] font-medium`,D(o)])},u(o.status_label),3)]))),128))])):(s(),a(`p`,T,u(g.empty),1))]))),128))])]),_:1}))}};export{E as default};

View file

@ -1 +0,0 @@
import{D as e,E as t,On as n,Zn as r,_ as i,b as a,bt as o,mt as s,o as c,qt as l,tr as u,v as d,y as f}from"./runtime-core.esm-bundler-B8D2lM98.js";import{n as p}from"./app-DutZVOiO.js";import{t as m}from"./message-square-warning-CUD7Iy66.js";import{a as h}from"./format-2iB7L6ww.js";import{t as g}from"./plus-cKZvz4wH.js";import{t as _}from"./button-SRYY3-ko.js";import{t as v}from"./Panel-CSRDt0_D.js";var y={class:`grid gap-5`},b={class:`mb-1 text-xs font-semibold tracking-wide text-muted-foreground uppercase`},x={key:0,class:`ml-1 rounded-full bg-brand px-1.5 py-0.5 text-[10px] text-brand-foreground`},S={key:0,class:`-mx-5 divide-y border-y`},C={class:`min-w-0 flex-1`},w={class:`truncate text-xs text-muted-foreground`},T={key:1,class:`text-sm text-muted-foreground`},E={__name:`EditorialNews`,props:{review:{type:Array,required:!0},mine:{type:Array,required:!0},scheduled:{type:Array,required:!0},canCreate:{type:Boolean,default:!1}},setup(E){let D=e=>({pending:`bg-amber-100 text-amber-800 dark:bg-amber-900/50 dark:text-amber-200`,published:`bg-emerald-100 text-emerald-800 dark:bg-emerald-900/50 dark:text-emerald-200`,draft:`bg-muted text-muted-foreground`})[e.status];return(O,k)=>(s(),d(v,{title:`Neuigkeiten`},{actions:l(()=>[E.canCreate?(s(),d(n(_),{key:0,size:`sm`,"as-child":``},{default:l(()=>[e(n(p),{href:`/redaktion/neuigkeiten/neu`},{default:l(()=>[e(n(g)),k[0]||=t(` Neuer Beitrag`,-1)]),_:1})]),_:1})):f(``,!0)]),default:l(()=>[i(`div`,y,[(s(!0),a(c,null,o([{key:`review`,title:`Zur Freigabe`,items:E.review,empty:null},{key:`mine`,title:`Meine Entwürfe`,items:E.mine,empty:`Keine offenen Entwürfe.`},{key:`scheduled`,title:`Geplant`,items:E.scheduled,empty:null}].filter(e=>e.items.length||e.empty),g=>(s(),a(`section`,{key:g.key},[i(`h3`,b,[t(u(g.title)+` `,1),g.key===`review`?(s(),a(`span`,x,u(g.items.length),1)):f(``,!0)]),g.items.length?(s(),a(`ul`,S,[(s(!0),a(c,null,o(g.items,o=>(s(),a(`li`,{key:o.id,class:`flex items-center gap-3 px-5 py-2.5`},[i(`div`,C,[e(n(p),{href:o.edit_url,class:`block truncate text-sm font-medium hover:underline`},{default:l(()=>[t(u(o.title),1)]),_:2},1032,[`href`]),i(`p`,w,[t(u(o.category??`Ohne Kategorie`),1),g.key!==`mine`&&o.author?(s(),a(c,{key:0},[t(` · `+u(o.author),1)],64)):f(``,!0),o.date?(s(),a(c,{key:1},[t(` · `+u(n(h)(o.date)),1)],64)):f(``,!0)])]),o.review_note?(s(),d(n(m),{key:0,class:`size-4 shrink-0 text-amber-600`,title:`Mit Anmerkung zurückgegeben`})):f(``,!0),i(`span`,{class:r([`shrink-0 rounded px-1.5 py-0.5 text-[11px] font-medium`,D(o)])},u(o.status_label),3)]))),128))])):(s(),a(`p`,T,u(g.empty),1))]))),128))])]),_:1}))}};export{E as default};

View file

@ -1 +0,0 @@
import{D as e,E as t,On as n,Zn as r,_ as i,b as a,bt as o,er as s,mt as c,o as l,qt as u,tr as d,v as f,vn as p,y as m}from"./runtime-core.esm-bundler-B8D2lM98.js";import{n as h}from"./app-DutZVOiO.js";import{t as g}from"./lock-4X8Kfof0.js";import{a as _}from"./format-2iB7L6ww.js";import{t as v}from"./plus-cKZvz4wH.js";import{t as y}from"./button-SRYY3-ko.js";import{t as b}from"./Panel-CSRDt0_D.js";import{t as x}from"./NewPageDialog-DAr4LrwK.js";var S={key:0,class:`-mx-5 divide-y border-t`},C={class:`text-xs text-muted-foreground`},w=[`title`],T={key:1,class:`text-sm text-muted-foreground`},E={__name:`EditorialPages`,props:{pages:{type:Array,required:!0},canCreate:{type:Boolean,default:!1}},setup(E){let D=p(!1),O={published:{label:`Veröffentlicht`,class:`bg-emerald-100 text-emerald-800 dark:bg-emerald-900/50 dark:text-emerald-200`},draft:{label:`Entwurf`,class:`bg-brand-soft text-brand-soft-foreground`},scheduled:{label:`Geplant`,class:`bg-amber-100 text-amber-800 dark:bg-amber-900/50 dark:text-amber-200`},new:{label:`Neu`,class:`bg-muted text-muted-foreground`}};return(p,k)=>(c(),f(b,{title:`Seiten`},{actions:u(()=>[E.canCreate?(c(),f(n(y),{key:0,size:`sm`,variant:`outline`,onClick:k[0]||=e=>D.value=!0},{default:u(()=>[e(n(v)),k[2]||=t(` Neue Seite`,-1)]),_:1})):m(``,!0)]),default:u(()=>[E.pages.length?(c(),a(`ul`,S,[(c(!0),a(l,null,o(E.pages,o=>(c(),a(`li`,{key:o.id,class:`flex items-center gap-3 py-2.5 pr-5`,style:s({paddingLeft:`${1.25+Math.min(o.depth,4)*1.25}rem`})},[i(`div`,{class:r([`min-w-0 flex-1`,o.depth?`border-l pl-3`:``])},[e(n(h),{href:o.edit_url,class:`block truncate text-sm font-medium hover:underline`},{default:u(()=>[t(d(o.title),1)]),_:2},1032,[`href`]),i(`p`,C,[t(d(o.url),1),o.changed_at?(c(),a(l,{key:0},[t(` · `+d(n(_)(o.changed_at)),1)],64)):m(``,!0)])],2),o.locked_by?(c(),a(`span`,{key:0,class:`inline-flex items-center gap-1 text-xs text-muted-foreground`,title:`${o.locked_by} bearbeitet gerade`},[e(n(g),{class:`size-3.5`}),t(` `+d(o.locked_by),1)],8,w)):m(``,!0),i(`span`,{class:r([`shrink-0 rounded px-1.5 py-0.5 text-[11px] font-medium`,O[o.status].class])},d(O[o.status].label),3)],4))),128))])):(c(),a(`p`,T,`Sie dürfen noch keine Seiten bearbeiten.`)),e(x,{open:D.value,"onUpdate:open":k[1]||=e=>D.value=e},null,8,[`open`])]),_:1}))}};export{E as default};

View file

@ -0,0 +1 @@
import{D as e,E as t,On as n,Zn as r,_ as i,b as a,bt as o,er as s,mt as c,o as l,qt as u,tr as d,v as f,vn as p,y as m}from"./runtime-core.esm-bundler-B8D2lM98.js";import{n as h}from"./app-CIvn5Z1l.js";import{c as g}from"./AppIcon-BVHFLm12.js";import{t as _}from"./lock-4X8Kfof0.js";import{t as v}from"./plus-cKZvz4wH.js";import{t as y}from"./button-SRYY3-ko.js";import{t as b}from"./Panel-xPHuwfuu.js";import{t as x}from"./NewPageDialog-BbIzQTb2.js";var S={key:0,class:`-mx-5 divide-y border-t`},C={class:`text-xs text-muted-foreground`},w=[`title`],T={key:1,class:`text-sm text-muted-foreground`},E={__name:`EditorialPages`,props:{pages:{type:Array,required:!0},canCreate:{type:Boolean,default:!1}},setup(E){let D=p(!1),O={published:{label:`Veröffentlicht`,class:`bg-emerald-100 text-emerald-800 dark:bg-emerald-900/50 dark:text-emerald-200`},draft:{label:`Entwurf`,class:`bg-brand-soft text-brand-soft-foreground`},scheduled:{label:`Geplant`,class:`bg-amber-100 text-amber-800 dark:bg-amber-900/50 dark:text-amber-200`},new:{label:`Neu`,class:`bg-muted text-muted-foreground`}};return(p,k)=>(c(),f(b,{title:`Seiten`},{actions:u(()=>[E.canCreate?(c(),f(n(y),{key:0,size:`sm`,variant:`outline`,onClick:k[0]||=e=>D.value=!0},{default:u(()=>[e(n(v)),k[2]||=t(` Neue Seite`,-1)]),_:1})):m(``,!0)]),default:u(()=>[E.pages.length?(c(),a(`ul`,S,[(c(!0),a(l,null,o(E.pages,o=>(c(),a(`li`,{key:o.id,class:`flex items-center gap-3 py-2.5 pr-5`,style:s({paddingLeft:`${1.25+Math.min(o.depth,4)*1.25}rem`})},[i(`div`,{class:r([`min-w-0 flex-1`,o.depth?`border-l pl-3`:``])},[e(n(h),{href:o.edit_url,class:`block truncate text-sm font-medium hover:underline`},{default:u(()=>[t(d(o.title),1)]),_:2},1032,[`href`]),i(`p`,C,[t(d(o.url),1),o.changed_at?(c(),a(l,{key:0},[t(` · `+d(n(g)(o.changed_at)),1)],64)):m(``,!0)])],2),o.locked_by?(c(),a(`span`,{key:0,class:`inline-flex items-center gap-1 text-xs text-muted-foreground`,title:`${o.locked_by} bearbeitet gerade`},[e(n(_),{class:`size-3.5`}),t(` `+d(o.locked_by),1)],8,w)):m(``,!0),i(`span`,{class:r([`shrink-0 rounded px-1.5 py-0.5 text-[11px] font-medium`,O[o.status].class])},d(O[o.status].label),3)],4))),128))])):(c(),a(`p`,T,`Sie dürfen noch keine Seiten bearbeiten.`)),e(x,{open:D.value,"onUpdate:open":k[1]||=e=>D.value=e},null,8,[`open`])]),_:1}))}};export{E as default};

View file

@ -1 +0,0 @@
import{_ as e,b as t,g as n,mt as r,tr as i}from"./runtime-core.esm-bundler-B8D2lM98.js";import{t as a}from"./format-2iB7L6ww.js";var o={class:`grid w-12 shrink-0 place-items-center rounded-md bg-muted py-1.5 leading-none`},s={class:`text-xl font-semibold`},c={class:`mt-1 text-[10px] font-semibold tracking-wide text-accent2-text`},l={__name:`EventDateBlock`,props:{date:{type:String,required:!0}},setup(l){let u=l,d=n(()=>a(u.date));return(n,a)=>(r(),t(`div`,o,[e(`span`,s,i(d.value.day),1),e(`span`,c,i(d.value.month),1)]))}};export{l as t};

View file

@ -0,0 +1 @@
import{_ as e,b as t,g as n,mt as r,tr as i}from"./runtime-core.esm-bundler-B8D2lM98.js";import{i as a}from"./AppIcon-BVHFLm12.js";var o={class:`grid w-12 shrink-0 place-items-center rounded-md bg-muted py-1.5 leading-none`},s={class:`text-xl font-semibold`},c={class:`mt-1 text-[10px] font-semibold tracking-wide text-accent2-text`},l={__name:`EventDateBlock`,props:{date:{type:String,required:!0}},setup(l){let u=l,d=n(()=>a(u.date));return(n,a)=>(r(),t(`div`,o,[e(`span`,s,i(d.value.day),1),e(`span`,c,i(d.value.month),1)]))}};export{l as t};

View file

@ -1 +0,0 @@
import{D as e,On as t,_ as n,b as r,mt as i,qt as a,tr as o,v as s,y as c}from"./runtime-core.esm-bundler-B8D2lM98.js";import{n as l}from"./app-DutZVOiO.js";import{r as u}from"./format-2iB7L6ww.js";import{t as d}from"./EventDateBlock-BNB1SIga.js";var f={class:`min-w-0 pt-0.5`},p={class:`line-clamp-2 text-sm leading-snug font-semibold group-hover:underline`},m={class:`mt-0.5 text-xs text-muted-foreground`},h={key:0,class:`truncate text-xs text-muted-foreground`},g={__name:`EventListItem`,props:{event:{type:Object,required:!0}},setup(g){return(_,v)=>(i(),s(t(l),{href:`/termine/${g.event.id}`,class:`group flex items-start gap-3.5 py-3`},{default:a(()=>[e(d,{date:g.event.starts_at},null,8,[`date`]),n(`div`,f,[n(`h3`,p,o(g.event.title),1),n(`p`,m,o(t(u)(g.event)),1),g.event.location?(i(),r(`p`,h,o(g.event.location),1)):c(``,!0)])]),_:1},8,[`href`]))}};export{g as t};

View file

@ -0,0 +1 @@
import{D as e,On as t,_ as n,b as r,mt as i,qt as a,tr as o,v as s,y as c}from"./runtime-core.esm-bundler-B8D2lM98.js";import{n as l}from"./app-CIvn5Z1l.js";import{o as u}from"./AppIcon-BVHFLm12.js";import{t as d}from"./EventDateBlock-Cxz_hY6g.js";var f={class:`min-w-0 pt-0.5`},p={class:`line-clamp-2 text-sm leading-snug font-semibold group-hover:underline`},m={class:`mt-0.5 text-xs text-muted-foreground`},h={key:0,class:`truncate text-xs text-muted-foreground`},g={__name:`EventListItem`,props:{event:{type:Object,required:!0}},setup(g){return(_,v)=>(i(),s(t(l),{href:`/termine/${g.event.id}`,class:`group flex items-start gap-3.5 py-3`},{default:a(()=>[e(d,{date:g.event.starts_at},null,8,[`date`]),n(`div`,f,[n(`h3`,p,o(g.event.title),1),n(`p`,m,o(t(u)(g.event)),1),g.event.location?(i(),r(`p`,h,o(g.event.location),1)):c(``,!0)])]),_:1},8,[`href`]))}};export{g as t};

View file

@ -0,0 +1 @@
import{Zn as e,b as t,g as n,mt as r,tr as i,v as a,wt as o,y as s}from"./runtime-core.esm-bundler-B8D2lM98.js";import{j as c}from"./dist-CleIz2GP.js";import{$ as l}from"./AppIcon-BVHFLm12.js";var u=c({name:`file-archive`,size:24,node:[[`path`,{d:`M13.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v11.5`,key:`4pqfef`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M8 12v-1`,key:`1ej8lb`}],[`path`,{d:`M8 18v-2`,key:`qcmpov`}],[`path`,{d:`M8 7V6`,key:`1nbb54`}],[`circle`,{cx:`8`,cy:`20`,r:`2`,key:`ckkr5m`}]]}),d=c({name:`file-image`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`circle`,{cx:`10`,cy:`12`,r:`2`,key:`737tya`}],[`path`,{d:`m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22`,key:`wt3hpn`}]]}),f=c({name:`file-spreadsheet`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M8 13h2`,key:`yr2amv`}],[`path`,{d:`M14 13h2`,key:`un5t4a`}],[`path`,{d:`M8 17h2`,key:`2yhykz`}],[`path`,{d:`M14 17h2`,key:`10kma7`}]]}),p=c({name:`file`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]}),m=c({name:`presentation`,size:24,node:[[`path`,{d:`M2 3h20`,key:`91anmk`}],[`path`,{d:`M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3`,key:`2k9sn8`}],[`path`,{d:`m7 21 5-5 5 5`,key:`bip4we`}]]}),h=[`title`],g={key:0,class:`absolute -bottom-1.5 rounded-[3px] bg-card px-1 text-[9px] leading-tight font-bold tracking-wide text-current ring-1 ring-border`},_={__name:`FileIcon`,props:{extension:{type:String,default:``},size:{type:String,default:`md`}},setup(c){let _=c,v={icon:l},y={icon:f},b={PDF:{...v,class:`bg-red-50 text-red-700 dark:bg-red-950/50 dark:text-red-300`},DOC:{...v,class:`bg-sky-50 text-sky-700 dark:bg-sky-950/50 dark:text-sky-300`},DOCX:{...v,class:`bg-sky-50 text-sky-700 dark:bg-sky-950/50 dark:text-sky-300`},ODT:{...v,class:`bg-sky-50 text-sky-700 dark:bg-sky-950/50 dark:text-sky-300`},RTF:{...v,class:`bg-sky-50 text-sky-700 dark:bg-sky-950/50 dark:text-sky-300`},TXT:{...v,class:`bg-muted text-muted-foreground`},XLS:{...y,class:`bg-emerald-50 text-emerald-700 dark:bg-emerald-950/50 dark:text-emerald-300`},XLSX:{...y,class:`bg-emerald-50 text-emerald-700 dark:bg-emerald-950/50 dark:text-emerald-300`},CSV:{...y,class:`bg-emerald-50 text-emerald-700 dark:bg-emerald-950/50 dark:text-emerald-300`},ODS:{...y,class:`bg-emerald-50 text-emerald-700 dark:bg-emerald-950/50 dark:text-emerald-300`},PPT:{icon:m,class:`bg-orange-50 text-orange-700 dark:bg-orange-950/50 dark:text-orange-300`},PPTX:{icon:m,class:`bg-orange-50 text-orange-700 dark:bg-orange-950/50 dark:text-orange-300`},JPG:{icon:d,class:`bg-violet-50 text-violet-700 dark:bg-violet-950/50 dark:text-violet-300`},JPEG:{icon:d,class:`bg-violet-50 text-violet-700 dark:bg-violet-950/50 dark:text-violet-300`},PNG:{icon:d,class:`bg-violet-50 text-violet-700 dark:bg-violet-950/50 dark:text-violet-300`},ZIP:{icon:u,class:`bg-amber-50 text-amber-700 dark:bg-amber-950/50 dark:text-amber-300`}},x=n(()=>b[_.extension?.toUpperCase()]??{icon:p,class:`bg-muted text-muted-foreground`}),S=n(()=>({sm:`size-8 rounded-md`,md:`size-10 rounded-md`,lg:`size-14 rounded-lg`})[_.size]),C=n(()=>({sm:`size-4`,md:`size-5`,lg:`size-7`})[_.size]);return(n,l)=>(r(),t(`span`,{class:e([`relative grid shrink-0 place-items-center`,[S.value,x.value.class]]),title:c.extension||void 0},[(r(),a(o(x.value.icon),{class:e(C.value),"stroke-width":1.75},null,8,[`class`])),c.extension&&c.size!==`sm`?(r(),t(`span`,g,i(c.extension),1)):s(``,!0)],10,h))}};export{_ as t};

View file

@ -1 +0,0 @@
import{Zn as e,b as t,g as n,mt as r,tr as i,v as a,wt as o,y as s}from"./runtime-core.esm-bundler-B8D2lM98.js";import{j as c}from"./dist-CleIz2GP.js";import{t as l}from"./file-text-4udxc_PB.js";var u=c({name:`file-archive`,size:24,node:[[`path`,{d:`M13.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v11.5`,key:`4pqfef`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M8 12v-1`,key:`1ej8lb`}],[`path`,{d:`M8 18v-2`,key:`qcmpov`}],[`path`,{d:`M8 7V6`,key:`1nbb54`}],[`circle`,{cx:`8`,cy:`20`,r:`2`,key:`ckkr5m`}]]}),d=c({name:`file-image`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`circle`,{cx:`10`,cy:`12`,r:`2`,key:`737tya`}],[`path`,{d:`m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22`,key:`wt3hpn`}]]}),f=c({name:`file-spreadsheet`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M8 13h2`,key:`yr2amv`}],[`path`,{d:`M14 13h2`,key:`un5t4a`}],[`path`,{d:`M8 17h2`,key:`2yhykz`}],[`path`,{d:`M14 17h2`,key:`10kma7`}]]}),p=c({name:`file`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]}),m=c({name:`presentation`,size:24,node:[[`path`,{d:`M2 3h20`,key:`91anmk`}],[`path`,{d:`M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3`,key:`2k9sn8`}],[`path`,{d:`m7 21 5-5 5 5`,key:`bip4we`}]]}),h={key:0,class:`absolute -bottom-1 rounded bg-card px-1 text-[9px] leading-tight font-bold text-current ring-1 ring-border`},g={__name:`FileIcon`,props:{extension:{type:String,default:``}},setup(c){let g=c,_={PDF:{icon:l,class:`bg-red-50 text-red-700 dark:bg-red-950/50 dark:text-red-300`},DOC:{icon:l,class:`bg-sky-50 text-sky-700 dark:bg-sky-950/50 dark:text-sky-300`},DOCX:{icon:l,class:`bg-sky-50 text-sky-700 dark:bg-sky-950/50 dark:text-sky-300`},ODT:{icon:l,class:`bg-sky-50 text-sky-700 dark:bg-sky-950/50 dark:text-sky-300`},XLS:{icon:f,class:`bg-emerald-50 text-emerald-700 dark:bg-emerald-950/50 dark:text-emerald-300`},XLSX:{icon:f,class:`bg-emerald-50 text-emerald-700 dark:bg-emerald-950/50 dark:text-emerald-300`},CSV:{icon:f,class:`bg-emerald-50 text-emerald-700 dark:bg-emerald-950/50 dark:text-emerald-300`},ODS:{icon:f,class:`bg-emerald-50 text-emerald-700 dark:bg-emerald-950/50 dark:text-emerald-300`},PPT:{icon:m,class:`bg-orange-50 text-orange-700 dark:bg-orange-950/50 dark:text-orange-300`},PPTX:{icon:m,class:`bg-orange-50 text-orange-700 dark:bg-orange-950/50 dark:text-orange-300`},JPG:{icon:d,class:`bg-violet-50 text-violet-700 dark:bg-violet-950/50 dark:text-violet-300`},JPEG:{icon:d,class:`bg-violet-50 text-violet-700 dark:bg-violet-950/50 dark:text-violet-300`},PNG:{icon:d,class:`bg-violet-50 text-violet-700 dark:bg-violet-950/50 dark:text-violet-300`},ZIP:{icon:u,class:`bg-amber-50 text-amber-700 dark:bg-amber-950/50 dark:text-amber-300`}},v=n(()=>_[g.extension?.toUpperCase()]??{icon:p,class:`bg-muted text-muted-foreground`});return(n,l)=>(r(),t(`span`,{class:e([`relative grid size-10 shrink-0 place-items-center rounded-md`,v.value.class])},[(r(),a(o(v.value.icon),{class:`size-5`})),c.extension?(r(),t(`span`,h,i(c.extension),1)):s(``,!0)],2))}};export{g as t};

View file

@ -1 +1 @@
import{D as e,E as t,On as n,_ as r,b as i,bt as a,mt as o,o as s,qt as c,tr as l,y as u}from"./runtime-core.esm-bundler-B8D2lM98.js";import{n as d}from"./app-DutZVOiO.js";import{t as f}from"./chevron-right-DR4LjgDm.js";import{t as p}from"./download-cH_7CRKx.js";import{t as m}from"./FileIcon-CNi3Ow6K.js";var h={key:0},g={key:0,class:`mb-3 flex items-center justify-between gap-4`},_={class:`text-lg font-semibold`},v={class:`divide-y rounded-lg border bg-card`},y=[`href`],b={class:`min-w-0 flex-1`},x={class:`block truncate text-sm font-medium group-hover:underline`},S={key:0,class:`block truncate text-[13px] text-muted-foreground`},C={class:`block text-xs text-muted-foreground`},w={key:0,class:`px-4 py-3 text-sm text-muted-foreground`},T={__name:`FolderBlock`,props:{block:{type:Object,required:!0}},setup(T){let E=e=>e>=1048576?`${(e/1024/1024).toFixed(1).replace(`.`,`,`)} MB`:`${Math.max(1,Math.round(e/1024))} KB`;return(D,O)=>T.block.props?(o(),i(`section`,h,[T.block.data.title?(o(),i(`div`,g,[r(`h3`,_,l(T.block.data.title),1),e(n(d),{href:T.block.props.folder_url,class:`inline-flex items-center gap-0.5 text-[13px] font-medium text-brand-text hover:underline`},{default:c(()=>[O[0]||=t(`Zum Ordner `,-1),e(n(f),{class:`size-3.5`})]),_:1},8,[`href`])])):u(``,!0),r(`ul`,v,[(o(!0),i(s,null,a(T.block.props.documents,t=>(o(),i(`li`,{key:t.id},[r(`a`,{href:t.download_url,class:`group flex items-center gap-3 px-4 py-3 hover:bg-accent/50`},[e(m,{extension:t.extension},null,8,[`extension`]),r(`span`,b,[r(`span`,x,l(t.title),1),T.block.data.show_description&&t.description?(o(),i(`span`,S,l(t.description),1)):u(``,!0),r(`span`,C,l(t.extension)+` · `+l(E(t.size)),1)]),e(n(p),{class:`size-4 shrink-0 text-muted-foreground`})],8,y)]))),128)),T.block.props.documents.length?u(``,!0):(o(),i(`li`,w,`Keine Dokumente in diesem Ordner.`))])])):u(``,!0)}};export{T as default};
import{D as e,E as t,On as n,_ as r,b as i,bt as a,mt as o,o as s,qt as c,tr as l,y as u}from"./runtime-core.esm-bundler-B8D2lM98.js";import{n as d}from"./app-CIvn5Z1l.js";import{t as f}from"./chevron-right-DR4LjgDm.js";import{t as p}from"./download-cH_7CRKx.js";import{t as m}from"./FileIcon-BHQ0ftg2.js";var h={key:0},g={key:0,class:`mb-3 flex items-center justify-between gap-4`},_={class:`text-lg font-semibold`},v={class:`divide-y rounded-lg border bg-card`},y=[`href`],b={class:`min-w-0 flex-1`},x={class:`block truncate text-sm font-medium group-hover:underline`},S={key:0,class:`block truncate text-[13px] text-muted-foreground`},C={class:`block text-xs text-muted-foreground`},w={key:0,class:`px-4 py-3 text-sm text-muted-foreground`},T={__name:`FolderBlock`,props:{block:{type:Object,required:!0}},setup(T){let E=e=>e>=1048576?`${(e/1024/1024).toFixed(1).replace(`.`,`,`)} MB`:`${Math.max(1,Math.round(e/1024))} KB`;return(D,O)=>T.block.props?(o(),i(`section`,h,[T.block.data.title?(o(),i(`div`,g,[r(`h3`,_,l(T.block.data.title),1),e(n(d),{href:T.block.props.folder_url,class:`inline-flex items-center gap-0.5 text-[13px] font-medium text-brand-text hover:underline`},{default:c(()=>[O[0]||=t(`Zum Ordner `,-1),e(n(f),{class:`size-3.5`})]),_:1},8,[`href`])])):u(``,!0),r(`ul`,v,[(o(!0),i(s,null,a(T.block.props.downloads,t=>(o(),i(`li`,{key:t.id},[r(`a`,{href:t.download_url,class:`group flex items-center gap-3 px-4 py-3 hover:bg-accent/50`},[e(m,{extension:t.extension},null,8,[`extension`]),r(`span`,b,[r(`span`,x,l(t.title),1),T.block.data.show_description&&t.description?(o(),i(`span`,S,l(t.description),1)):u(``,!0),r(`span`,C,l(t.extension)+` · `+l(E(t.size)),1)]),e(n(p),{class:`size-4 shrink-0 text-muted-foreground`})],8,y)]))),128)),T.block.props.downloads.length?u(``,!0):(o(),i(`li`,w,`Keine Dateien in diesem Ordner.`))])])):u(``,!0)}};export{T as default};

View file

@ -1 +1 @@
import{D as e,E as t,On as n,_ as r,b as i,mt as a,qt as o,tr as s,v as c,y as l}from"./runtime-core.esm-bundler-B8D2lM98.js";import{w as u}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{n as d,r as f}from"./app-DutZVOiO.js";import{A as p}from"./dist-CleIz2GP.js";import{t as m}from"./arrow-left-nZZEveo4.js";import{t as h}from"./FormField-BcJMyuzX.js";import{t as g}from"./button-SRYY3-ko.js";import{t as _}from"./Input-CgjHXzkf.js";import{t as v}from"./GuestLayout-DsZqMQXS.js";var y={key:0,class:`mb-6 rounded-md border border-brand-200 bg-brand-soft px-4 py-3 text-sm text-brand-soft-foreground`},b={__name:`ForgotPassword`,props:{status:{type:String,default:null}},setup(b){let x=f({email:``});return(f,S)=>(a(),c(v,{title:`Passwort vergessen`,description:`Wir senden Ihnen einen Link, mit dem Sie ein neues Passwort festlegen können.`},{default:o(()=>[b.status?(a(),i(`div`,y,s(b.status),1)):l(``,!0),r(`form`,{class:`grid gap-5`,onSubmit:S[1]||=u(e=>n(x).post(`/forgot-password`),[`prevent`])},[e(h,{id:`email`,label:`E-Mail-Adresse`,error:n(x).errors.email},{default:o(()=>[e(n(_),{id:`email`,modelValue:n(x).email,"onUpdate:modelValue":S[0]||=e=>n(x).email=e,type:`email`,autocomplete:`username`,autofocus:``,class:`h-10`},null,8,[`modelValue`])]),_:1},8,[`error`]),e(n(g),{type:`submit`,size:`lg`,class:`h-10 w-full`,disabled:n(x).processing},{default:o(()=>[n(x).processing?(a(),c(n(p),{key:0,class:`animate-spin`})):l(``,!0),S[2]||=t(` Link senden `,-1)]),_:1},8,[`disabled`]),e(n(d),{href:`/login`,class:`inline-flex items-center justify-center gap-1.5 text-sm font-medium text-muted-foreground hover:text-foreground`},{default:o(()=>[e(n(m),{class:`size-4`}),S[3]||=t(` Zurück zur Anmeldung `,-1)]),_:1})],32)]),_:1}))}};export{b as default};
import{D as e,E as t,On as n,_ as r,b as i,mt as a,qt as o,tr as s,v as c,y as l}from"./runtime-core.esm-bundler-B8D2lM98.js";import{w as u}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{n as d,r as f}from"./app-CIvn5Z1l.js";import{A as p}from"./dist-CleIz2GP.js";import{t as m}from"./arrow-left-nZZEveo4.js";import{t as h}from"./FormField-BcJMyuzX.js";import{t as g}from"./button-SRYY3-ko.js";import{t as _}from"./Input-CgjHXzkf.js";import{t as v}from"./GuestLayout-DAusAB2K.js";var y={key:0,class:`mb-6 rounded-md border border-brand-200 bg-brand-soft px-4 py-3 text-sm text-brand-soft-foreground`},b={__name:`ForgotPassword`,props:{status:{type:String,default:null}},setup(b){let x=f({email:``});return(f,S)=>(a(),c(v,{title:`Passwort vergessen`,description:`Wir senden Ihnen einen Link, mit dem Sie ein neues Passwort festlegen können.`},{default:o(()=>[b.status?(a(),i(`div`,y,s(b.status),1)):l(``,!0),r(`form`,{class:`grid gap-5`,onSubmit:S[1]||=u(e=>n(x).post(`/forgot-password`),[`prevent`])},[e(h,{id:`email`,label:`E-Mail-Adresse`,error:n(x).errors.email},{default:o(()=>[e(n(_),{id:`email`,modelValue:n(x).email,"onUpdate:modelValue":S[0]||=e=>n(x).email=e,type:`email`,autocomplete:`username`,autofocus:``,class:`h-10`},null,8,[`modelValue`])]),_:1},8,[`error`]),e(n(g),{type:`submit`,size:`lg`,class:`h-10 w-full`,disabled:n(x).processing},{default:o(()=>[n(x).processing?(a(),c(n(p),{key:0,class:`animate-spin`})):l(``,!0),S[2]||=t(` Link senden `,-1)]),_:1},8,[`disabled`]),e(n(d),{href:`/login`,class:`inline-flex items-center justify-center gap-1.5 text-sm font-medium text-muted-foreground hover:text-foreground`},{default:o(()=>[e(n(m),{class:`size-4`}),S[3]||=t(` Zurück zur Anmeldung `,-1)]),_:1})],32)]),_:1}))}};export{b as default};

Some files were not shown because too many files have changed in this diff Show more