Formulare, WordPress-Import und E-Mail-Versand
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 2m0s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 2m7s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 2m11s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 2m7s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 2m52s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 3m2s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 2m31s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 2m27s
CI / Build-Artefakte aktuell (pull_request) Successful in 53s
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 2m0s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 2m7s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 2m11s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 2m7s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 2m52s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 3m2s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 2m31s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 2m27s
CI / Build-Artefakte aktuell (pull_request) Successful in 53s
- Formular-Plugin: Baukasten mit 13 Feldtypen, Bedingungen, Vorbelegung aus dem Profil, Datei-Uploads (geschützt), anonyme Formulare, „nur einmal“, Einsendeschluss, Sichtbarkeit, Löschfrist; Einsendungen im Backend und per Mail (optional ohne Angaben, Kopie an die Person); Rechte je Formular und Rolle für Ansehen/Export und Löschen; CSV für Excel; Pagebuilder-Block - WordPress-Import (Plugin): WXR-Datei einlesen, Kategorien/Personen zuordnen, Beiträge mit Status, Datum, Beitragsbild und Bildern im Text übernehmen, optional Seiten mit Hierarchie; in Portionen, wiederholbar ohne Doppelungen - E-Mail-Versand im Admin (SMTP, verschlüsseltes Passwort, Test-Mail) - Speichertest unabhängig vom Verbrauch der Test-Suite Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
f3987e8386
commit
11123fecc0
118 changed files with 4446 additions and 169 deletions
11
CHANGELOG.md
11
CHANGELOG.md
|
|
@ -4,6 +4,17 @@ 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.6.0
|
||||
|
||||
- Formulare: Anträge, Anmeldungen, Umfragen und Meldungen im Baukasten zusammenstellen – Textfelder, Auswahllisten, Mehrfachauswahl, Datum, Zahlen, Datei-Upload, Zustimmung, Zwischenüberschriften und Hinweise
|
||||
- Felder lassen sich abhängig von anderen Antworten ein- und ausblenden und aus dem Profil vorbelegen
|
||||
- Einsendungen landen im Backend und per E-Mail bei festen Empfängern; auf Wunsch eine Kopie an die ausfüllende Person
|
||||
- Zugriff auf die Ergebnisse je Formular und Rolle – ansehen und exportieren (CSV für Excel) bzw. löschen getrennt vergebbar
|
||||
- Anonyme Formulare, „nur einmal ausfüllen“, Einsendeschluss, Sichtbarkeit und automatische Löschfrist
|
||||
- Formulare lassen sich mit dem Pagebuilder in Seiten einbinden
|
||||
- WordPress-Import: Beiträge mit Kategorien, Autorinnen und Autoren, Beitragsbildern und Bildern im Text übernehmen, auf Wunsch auch Seiten – wiederholbar, ohne Doppelungen
|
||||
- E-Mail-Versand im Admin einrichten (SMTP), mit Test-Mail
|
||||
|
||||
## 0.5.0
|
||||
|
||||
- Seiten: eigener Seitenbaum für Bereiche, Abteilungen und Gremien – mit Seitennavigation, Brotkrumen und optional in der Hauptnavigation
|
||||
|
|
|
|||
109
app/Filament/Pages/MailSettingsPage.php
Normal file
109
app/Filament/Pages/MailSettingsPage.php
Normal file
|
|
@ -0,0 +1,109 @@
|
|||
<?php
|
||||
|
||||
namespace App\Filament\Pages;
|
||||
|
||||
use App\Support\Audit;
|
||||
use App\Support\MailSettings;
|
||||
use BackedEnum;
|
||||
use Filament\Actions\Action;
|
||||
use Filament\Forms\Components\Select;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
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\Facades\Mail;
|
||||
use Throwable;
|
||||
use UnitEnum;
|
||||
|
||||
/**
|
||||
* SMTP-Zugang für Benachrichtigungen, Formulare und „Passwort vergessen“.
|
||||
*/
|
||||
class MailSettingsPage extends Page
|
||||
{
|
||||
protected string $view = 'filament.pages.settings-form';
|
||||
|
||||
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedEnvelope;
|
||||
|
||||
protected static string|UnitEnum|null $navigationGroup = 'System';
|
||||
|
||||
protected static ?int $navigationSort = 5;
|
||||
|
||||
protected static ?string $navigationLabel = 'E-Mail-Versand';
|
||||
|
||||
protected static ?string $title = 'E-Mail-Versand';
|
||||
|
||||
protected static ?string $slug = 'e-mail';
|
||||
|
||||
/** @var array<string, mixed>|null */
|
||||
public ?array $data = [];
|
||||
|
||||
public static function canAccess(): bool
|
||||
{
|
||||
return auth()->user()?->can('mail.manage') ?? false;
|
||||
}
|
||||
|
||||
public function mount(MailSettings $mail): void
|
||||
{
|
||||
$this->form->fill([...$mail->values(), 'password' => null]);
|
||||
}
|
||||
|
||||
public function form(Schema $schema): Schema
|
||||
{
|
||||
$smtp = fn (Get $get) => $get('mailer') === 'smtp';
|
||||
|
||||
return $schema
|
||||
->components([
|
||||
Section::make('Versand')
|
||||
->description('Die Zugangsdaten erhalten Sie von Ihrem Hoster oder Ihrer IT (z. B. Microsoft 365: smtp.office365.com, Port 587, TLS).')
|
||||
->columns(2)
|
||||
->schema([
|
||||
Select::make('mailer')->label('Versandart')->options(MailSettings::MAILERS)->required()->live()->native(false)->columnSpanFull(),
|
||||
TextInput::make('host')->label('SMTP-Server')->required($smtp)->visible($smtp)->maxLength(255),
|
||||
TextInput::make('port')->label('Port')->numeric()->required($smtp)->visible($smtp)->minValue(1)->maxValue(65535),
|
||||
Select::make('encryption')->label('Verschlüsselung')->visible($smtp)->native(false)
|
||||
->options(['tls' => 'STARTTLS (meist Port 587)', 'ssl' => 'SSL/TLS (meist Port 465)', 'none' => 'Keine']),
|
||||
TextInput::make('username')->label('Benutzername')->visible($smtp)->maxLength(255)->autocomplete('off'),
|
||||
TextInput::make('password')->label('Passwort')->password()->revealable()->visible($smtp)->maxLength(255)
|
||||
->helperText('Leer lassen, um das gespeicherte Passwort zu behalten.')->autocomplete('new-password'),
|
||||
]),
|
||||
Section::make('Absender')
|
||||
->columns(2)
|
||||
->schema([
|
||||
TextInput::make('from_address')->label('Absenderadresse')->email()->required()->maxLength(255)->placeholder('intranet@firma.de'),
|
||||
TextInput::make('from_name')->label('Absendername')->maxLength(100)->placeholder('Name des Portals'),
|
||||
]),
|
||||
])
|
||||
->statePath('data');
|
||||
}
|
||||
|
||||
public function save(MailSettings $mail): void
|
||||
{
|
||||
$mail->save($this->form->getState());
|
||||
Audit::log('mail.settings_updated');
|
||||
|
||||
Notification::make()->success()->title('E-Mail-Versand gespeichert')->send();
|
||||
}
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
Action::make('test')
|
||||
->label('Test-Mail senden')
|
||||
->icon(Heroicon::OutlinedPaperAirplane)
|
||||
->color('gray')
|
||||
->action(function () {
|
||||
$to = auth()->user()->email;
|
||||
|
||||
try {
|
||||
Mail::raw('Diese Test-Mail bestätigt, dass der E-Mail-Versand des Portals funktioniert.', fn ($m) => $m->to($to)->subject('Test-Mail aus dem Portal'));
|
||||
Notification::make()->success()->title('Test-Mail an '.$to.' gesendet')->send();
|
||||
} catch (Throwable $e) {
|
||||
Notification::make()->danger()->title('Versand fehlgeschlagen')->body($e->getMessage())->persistent()->send();
|
||||
}
|
||||
}),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
@ -42,6 +42,7 @@ class HandleInertiaRequests extends Middleware
|
|||
'notifications' => fn () => $user ? ['unread' => $user->unreadNotifications()->count()] : null,
|
||||
'flash' => [
|
||||
'status' => fn () => $request->session()->get('status'),
|
||||
'form_submitted' => fn () => $request->session()->get('form_submitted'),
|
||||
],
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ use App\Support\BackgroundTasks;
|
|||
use App\Support\Branding;
|
||||
use App\Support\Installation;
|
||||
use App\Support\License\LicenseStore;
|
||||
use App\Support\MailSettings;
|
||||
use App\Support\Navigation;
|
||||
use App\Support\Permissions\PermissionResource;
|
||||
use App\Support\Permissions\Permissions;
|
||||
|
|
@ -42,6 +43,7 @@ class AppServiceProvider extends ServiceProvider
|
|||
}
|
||||
|
||||
$this->app->singleton(Settings::class);
|
||||
$this->app->singleton(MailSettings::class);
|
||||
$this->app->singleton(Branding::class);
|
||||
$this->app->singleton(Avatars::class);
|
||||
$this->app->singleton(QuickLinks::class);
|
||||
|
|
@ -84,5 +86,9 @@ class AppServiceProvider extends ServiceProvider
|
|||
});
|
||||
|
||||
Password::defaults(fn () => Password::min(10)->letters()->numbers());
|
||||
|
||||
if (Installation::isInstalled()) {
|
||||
$this->app->make(MailSettings::class)->apply();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ class Abilities
|
|||
$this->define('plugins.manage', 'Plugins verwalten und installieren', 'System');
|
||||
$this->define('appearance.manage', 'Erscheinungsbild und Schnellzugriffe', 'System');
|
||||
$this->define('updates.manage', 'Aktualisierungen, Lizenz und Systemzustand', 'System');
|
||||
$this->define('mail.manage', 'E-Mail-Versand einrichten', 'System');
|
||||
$this->define('feedback.send', 'Rückmeldungen an den Hersteller senden', 'System');
|
||||
}
|
||||
|
||||
|
|
|
|||
100
app/Support/MailSettings.php
Normal file
100
app/Support/MailSettings.php
Normal file
|
|
@ -0,0 +1,100 @@
|
|||
<?php
|
||||
|
||||
namespace App\Support;
|
||||
|
||||
use Illuminate\Support\Facades\Crypt;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
use Throwable;
|
||||
|
||||
/**
|
||||
* E-Mail-Versand aus den Einstellungen („Administration → E-Mail-Versand“).
|
||||
* Auf Shared Hosting gibt es meist nur SMTP-Zugangsdaten des Hosters – ohne
|
||||
* Zugriff auf die .env. Die Werte hier haben Vorrang vor der .env.
|
||||
*/
|
||||
class MailSettings
|
||||
{
|
||||
public const MAILERS = [
|
||||
'smtp' => 'SMTP-Server',
|
||||
'sendmail' => 'Sendmail des Servers',
|
||||
'log' => 'Nicht senden (nur ins Protokoll schreiben)',
|
||||
];
|
||||
|
||||
public function __construct(private readonly Settings $settings) {}
|
||||
|
||||
public function configured(): bool
|
||||
{
|
||||
return $this->settings->get('mail.mailer') !== null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function values(): array
|
||||
{
|
||||
return [
|
||||
'mailer' => $this->settings->get('mail.mailer', 'log'),
|
||||
'host' => $this->settings->get('mail.host'),
|
||||
'port' => $this->settings->get('mail.port', 587),
|
||||
'encryption' => $this->settings->get('mail.encryption', 'tls'),
|
||||
'username' => $this->settings->get('mail.username'),
|
||||
'from_address' => $this->settings->get('mail.from_address'),
|
||||
'from_name' => $this->settings->get('mail.from_name'),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $values
|
||||
*/
|
||||
public function save(array $values): void
|
||||
{
|
||||
$data = [
|
||||
'mail.mailer' => $values['mailer'],
|
||||
'mail.host' => $values['host'] ?? null,
|
||||
'mail.port' => isset($values['port']) ? (int) $values['port'] : null,
|
||||
'mail.encryption' => $values['encryption'] ?? 'tls',
|
||||
'mail.username' => $values['username'] ?? null,
|
||||
'mail.from_address' => $values['from_address'] ?? null,
|
||||
'mail.from_name' => $values['from_name'] ?? null,
|
||||
];
|
||||
|
||||
// Leeres Passwortfeld = gespeichertes behalten.
|
||||
if (filled($values['password'] ?? null)) {
|
||||
$data['mail.password'] = Crypt::encryptString($values['password']);
|
||||
}
|
||||
|
||||
$this->settings->setMany($data);
|
||||
$this->apply();
|
||||
}
|
||||
|
||||
public function apply(): void
|
||||
{
|
||||
if (! $this->configured()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$values = $this->values();
|
||||
|
||||
try {
|
||||
$password = $this->settings->get('mail.password') ? Crypt::decryptString($this->settings->get('mail.password')) : null;
|
||||
} catch (Throwable) {
|
||||
$password = null; // APP_KEY geändert – Passwort muss neu eingegeben werden
|
||||
}
|
||||
|
||||
config([
|
||||
'mail.default' => $values['mailer'],
|
||||
'mail.mailers.smtp.host' => $values['host'],
|
||||
'mail.mailers.smtp.port' => (int) $values['port'],
|
||||
'mail.mailers.smtp.scheme' => $values['encryption'] === 'ssl' ? 'smtps' : 'smtp',
|
||||
'mail.mailers.smtp.username' => $values['username'],
|
||||
'mail.mailers.smtp.password' => $password,
|
||||
'mail.mailers.smtp.timeout' => 15,
|
||||
'mail.from.address' => $values['from_address'] ?: config('mail.from.address'),
|
||||
'mail.from.name' => $values['from_name'] ?: app(Branding::class)->portalName(),
|
||||
]);
|
||||
|
||||
// Bereits erzeugte Mailer mit alter Konfiguration verwerfen.
|
||||
app()->forgetInstance('mail.manager');
|
||||
app()->forgetInstance('mailer');
|
||||
Mail::clearResolvedInstance('mail.manager');
|
||||
}
|
||||
}
|
||||
|
|
@ -9,5 +9,5 @@ namespace App;
|
|||
*/
|
||||
final class Version
|
||||
{
|
||||
public const VERSION = '0.5.0';
|
||||
public const VERSION = '0.6.0';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -81,6 +81,32 @@ Die Anmeldung mit Passwort bleibt für Notfälle erhalten (z. B. wenn Entra ID
|
|||
nicht erreichbar ist). Den geheimen Clientschlüssel vor Ablauf erneuern – er
|
||||
ist bei Microsoft befristet.
|
||||
|
||||
## E-Mail-Versand
|
||||
|
||||
Unter **Administration → E-Mail-Versand** den SMTP-Zugang eintragen (vom
|
||||
Hoster oder der IT, z. B. Microsoft 365: `smtp.office365.com`, Port 587,
|
||||
STARTTLS) und mit **Test-Mail senden** prüfen. Das Passwort wird verschlüsselt
|
||||
gespeichert. Gebraucht wird der Versand für „Passwort vergessen“ und
|
||||
Formular-Benachrichtigungen. Mails werden über die Hintergrundaufgaben
|
||||
verschickt – ohne Cron oder Web-Cron also mit etwas Verzögerung.
|
||||
|
||||
## Umstieg von WordPress
|
||||
|
||||
1. In WordPress unter **Werkzeuge → Daten exportieren** „Alle Inhalte“ wählen
|
||||
und die XML-Datei herunterladen.
|
||||
2. Im Portal unter **Administration → Inhalte → WordPress-Import** hochladen
|
||||
und **Datei prüfen**.
|
||||
3. Kategorien zuordnen (neu anlegen, vorhandene nutzen oder weglassen),
|
||||
Autorinnen und Autoren prüfen (Zuordnung über die E-Mail-Adresse) und
|
||||
entscheiden, ob Entwürfe und WordPress-Seiten mitkommen.
|
||||
4. **Import starten** – die Seite geöffnet lassen, der Import läuft in Portionen.
|
||||
|
||||
Bilder werden von der alten Website geladen, sie muss dafür noch erreichbar
|
||||
sein. Ein erneuter Import legt nichts doppelt an; auf Wunsch aktualisiert er
|
||||
bereits übernommene Einträge. Kommentare, Schlagwörter und Inhalte anderer
|
||||
WordPress-Plugins werden nicht übernommen. Nach dem Umstieg kann das Plugin
|
||||
„WordPress-Import“ deaktiviert werden.
|
||||
|
||||
## Hintergrundaufgaben
|
||||
|
||||
Rückmeldungen, geplante Inhalte und Aufräumarbeiten laufen im Hintergrund. Die
|
||||
|
|
|
|||
|
|
@ -452,8 +452,8 @@ Entwickler, ohne Build, direkt im Admin unter „Erscheinungsbild“.
|
|||
|
||||
## 13. Mitgelieferte Plugins
|
||||
|
||||
**Start:** Dashboard, News/Feed mit Kategorien, CMS-Seiten, Verzeichnis &
|
||||
Organigramm, Dokumente, App-Launcher.
|
||||
**Start:** Dashboard, News/Feed mit Kategorien, CMS-Seiten, Formulare,
|
||||
WordPress-Import, Verzeichnis & Organigramm, Dokumente, App-Launcher.
|
||||
|
||||
**Später:** Events, Umfragen, Geburtstage/Jubiläen, Onboarding, Raumbuchung,
|
||||
Kantinenplan, Ideenbox, Urlaubsanträge.
|
||||
|
|
@ -482,6 +482,7 @@ Kantinenplan, Ideenbox, Urlaubsanträge.
|
|||
| **2 – Plugin-System & Rechte** ✅ | Plugin-Loader, Hooks/Filter, Registries, Recovery-Modus, Import-Map-Frontend; Rollen, Grants, Zielgruppen, Rechte-Cache, Rechte-Prüfer |
|
||||
| **3 – Entra ID** ✅ | OIDC-Login, JIT, Gruppen-/App-Rollen-Mapping (additiv), Graph-Profil- & Foto-Sync mit frei zuordenbaren Attributen (inkl. Erweiterungsattributen) und eigenen Profilfeldern, Delta-Sync |
|
||||
| **4 – CMS** ✅ | Seitenbaum, Pagebuilder (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 (Baukasten, Bedingungen, Uploads, anonyme Formulare, Mail + Backend, Ergebnis-Rechte je Formular und Rolle, CSV, Löschfristen, Pagebuilder-Block); WordPress-Import (Beiträge, Kategorien, Bilder, Seiten); E-Mail-Versand im Admin |
|
||||
| **5 – Branding & Theming** | Vollständige Seite „Erscheinungsbild“: Logo-Varianten, Farben inkl. Farbtreue & Kontrastprüfung, Schriften, Form, Login-Seite, E-Mails, Live-Vorschau, Entwurf/Veröffentlichen, Export/Import |
|
||||
| **6 – Weitere Plugins & IdPs** | Verzeichnis/Organigramm, Dokumente, Events …; OIDC generisch, LDAP, SAML; Lasttests 5.000 User |
|
||||
| **7 – Plugin-SDK öffentlich** | Doku, Generator, Beispiel-Plugins (kein Plugin-Verzeichnis) |
|
||||
|
|
|
|||
|
|
@ -0,0 +1,57 @@
|
|||
<?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
|
||||
{
|
||||
Schema::create('forms', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('title');
|
||||
$table->string('slug', 120)->unique();
|
||||
$table->text('description')->nullable();
|
||||
$table->json('fields');
|
||||
$table->json('settings')->nullable();
|
||||
$table->boolean('is_open')->default(true);
|
||||
$table->timestamp('closes_at')->nullable();
|
||||
$table->foreignId('created_by')->nullable()->constrained('users')->nullOnDelete();
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Schema::create('form_submissions', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('form_id')->constrained('forms')->cascadeOnDelete();
|
||||
// Bei anonymen Formularen leer; „nur einmal ausfüllen“ prüft dann user_hash.
|
||||
$table->foreignId('user_id')->nullable()->constrained('users')->nullOnDelete();
|
||||
$table->string('user_hash', 64)->nullable();
|
||||
$table->json('data');
|
||||
$table->timestamp('read_at')->nullable();
|
||||
$table->timestamps();
|
||||
|
||||
$table->index(['form_id', 'created_at']);
|
||||
$table->index(['form_id', 'user_hash']);
|
||||
$table->index(['form_id', 'user_id']);
|
||||
});
|
||||
|
||||
Schema::create('form_files', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('submission_id')->constrained('form_submissions')->cascadeOnDelete();
|
||||
$table->string('field', 80);
|
||||
$table->string('name');
|
||||
$table->string('path');
|
||||
$table->string('mime', 150)->nullable();
|
||||
$table->unsignedBigInteger('size')->default(0);
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('form_files');
|
||||
Schema::dropIfExists('form_submissions');
|
||||
Schema::dropIfExists('forms');
|
||||
}
|
||||
};
|
||||
13
plugins-core/forms/plugin.json
Normal file
13
plugins-core/forms/plugin.json
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"slug": "forms",
|
||||
"name": "Formulare",
|
||||
"version": "1.0.0",
|
||||
"description": "Formulare zusammenstellen – Anträge, Anmeldungen, Umfragen, Meldungen. Ergebnisse per E-Mail und im Backend, Zugriff je Formular und Rolle.",
|
||||
"author": "Inhaus",
|
||||
"namespace": "Inhaus\\Plugins\\Forms\\",
|
||||
"class": "Inhaus\\Plugins\\Forms\\FormsPlugin",
|
||||
"requires": {
|
||||
"core": ">=0.6.0",
|
||||
"php": ">=8.3"
|
||||
}
|
||||
}
|
||||
21
plugins-core/forms/resources/js/blocks/FormBlock.vue
Normal file
21
plugins-core/forms/resources/js/blocks/FormBlock.vue
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
<script setup>
|
||||
import { inject } from 'vue';
|
||||
import FormRenderer from '../components/FormRenderer.vue';
|
||||
|
||||
defineProps({ block: { type: Object, required: true } });
|
||||
|
||||
const editing = inject('pagebuilder:editing', false);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<section v-if="block.props" class="rounded-lg border bg-card p-5 @3xl:p-8">
|
||||
<template v-if="block.data.show_title">
|
||||
<h3 class="text-xl font-semibold tracking-tight">{{ block.props.title }}</h3>
|
||||
<p v-if="block.props.description" class="mt-2 mb-6 text-sm leading-relaxed whitespace-pre-line text-muted-foreground">{{ block.props.description }}</p>
|
||||
</template>
|
||||
<div :class="{ 'pointer-events-none opacity-80': editing }">
|
||||
<FormRenderer :key="block.props.id" :form="block.props" />
|
||||
</div>
|
||||
</section>
|
||||
<p v-else-if="editing" class="rounded-lg border border-dashed p-4 text-sm text-muted-foreground">Bitte rechts ein Formular auswählen.</p>
|
||||
</template>
|
||||
199
plugins-core/forms/resources/js/components/FormRenderer.vue
Normal file
199
plugins-core/forms/resources/js/components/FormRenderer.vue
Normal file
|
|
@ -0,0 +1,199 @@
|
|||
<script setup>
|
||||
import { computed } from 'vue';
|
||||
import { useForm, usePage } from '@inertiajs/vue3';
|
||||
import { CircleCheck, EyeOff, LoaderCircle, Paperclip, Send, X } from '@lucide/vue';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Input } from '@/components/ui/input';
|
||||
import { Textarea } from '@/components/ui/textarea';
|
||||
import NativeSelect from '@/components/NativeSelect.vue';
|
||||
|
||||
/**
|
||||
* Stellt ein Formular dar (Formularseite und Pagebuilder-Block).
|
||||
* Bedingungen werden hier für die Anzeige und auf dem Server für die Prüfung ausgewertet.
|
||||
*/
|
||||
const props = defineProps({
|
||||
form: { type: Object, required: true },
|
||||
compact: { type: Boolean, default: false },
|
||||
});
|
||||
|
||||
const page = usePage();
|
||||
const inputTypes = ['text', 'textarea', 'email', 'phone', 'number', 'date', 'select', 'radio', 'checkboxes', 'checkbox', 'file'];
|
||||
|
||||
function initial(field) {
|
||||
const prefilled = props.form.prefill?.[field.key];
|
||||
|
||||
if (field.type === 'checkboxes' || field.type === 'file') return [];
|
||||
if (field.type === 'checkbox') return false;
|
||||
|
||||
return prefilled ?? '';
|
||||
}
|
||||
|
||||
const data = useForm({
|
||||
answers: Object.fromEntries(props.form.fields.filter((f) => inputTypes.includes(f.type)).map((f) => [f.key, initial(f)])),
|
||||
});
|
||||
|
||||
const submitted = computed(() => page.props.flash?.form_submitted === props.form.id);
|
||||
|
||||
function isVisible(field, depth = 0) {
|
||||
if (!field.condition || depth > 10) return true;
|
||||
|
||||
const other = props.form.fields.find((f) => f.key === field.condition.field);
|
||||
|
||||
if (!other || !isVisible(other, depth + 1)) return false;
|
||||
|
||||
const raw = data.answers[field.condition.field];
|
||||
const values = (Array.isArray(raw) ? raw : raw === true ? ['1'] : raw === false || raw === '' || raw == null ? [] : [String(raw)]).map(String);
|
||||
const expected = field.condition.value ?? '';
|
||||
|
||||
switch (field.condition.operator) {
|
||||
case 'not_equals': return !values.includes(expected);
|
||||
case 'filled': return values.length > 0;
|
||||
case 'empty': return values.length === 0;
|
||||
default: return values.includes(expected);
|
||||
}
|
||||
}
|
||||
|
||||
const visibleFields = computed(() => props.form.fields.filter((field) => isVisible(field)));
|
||||
|
||||
function error(field) {
|
||||
return data.errors[`answers.${field.key}`] ?? Object.entries(data.errors).find(([key]) => key.startsWith(`answers.${field.key}.`))?.[1];
|
||||
}
|
||||
|
||||
function toggleOption(field, option) {
|
||||
const values = new Set(data.answers[field.key]);
|
||||
values.has(option) ? values.delete(option) : values.add(option);
|
||||
data.answers[field.key] = [...values];
|
||||
}
|
||||
|
||||
function addFiles(field, event) {
|
||||
const files = [...(event.target.files ?? [])];
|
||||
data.answers[field.key] = field.multiple ? [...data.answers[field.key], ...files].slice(0, 10) : files.slice(0, 1);
|
||||
event.target.value = '';
|
||||
}
|
||||
|
||||
function removeFile(field, index) {
|
||||
data.answers[field.key] = data.answers[field.key].filter((_, i) => i !== index);
|
||||
}
|
||||
|
||||
function submit() {
|
||||
const visibleKeys = new Set(visibleFields.value.map((f) => f.key));
|
||||
|
||||
data.transform((values) => ({
|
||||
answers: Object.fromEntries(Object.entries(values.answers).filter(([key]) => visibleKeys.has(key))),
|
||||
})).post(props.form.url, {
|
||||
forceFormData: true,
|
||||
preserveScroll: true,
|
||||
onSuccess: () => {
|
||||
if (page.props.flash?.form_submitted === props.form.id) data.reset();
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
const formatSize = (bytes) => (bytes > 1024 * 1024 ? `${(bytes / 1024 / 1024).toFixed(1).replace('.', ',')} MB` : `${Math.max(1, Math.round(bytes / 1024))} KB`);
|
||||
const fieldId = (field) => `f${props.form.id}-${field.key}`;
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div v-if="submitted" class="flex gap-3 rounded-lg border border-emerald-200 bg-emerald-50 p-5 text-emerald-950 dark:border-emerald-900 dark:bg-emerald-950/40 dark:text-emerald-100" role="status">
|
||||
<CircleCheck class="mt-0.5 size-5 shrink-0 text-emerald-600" />
|
||||
<div>
|
||||
<p class="font-medium whitespace-pre-line">{{ form.confirmation }}</p>
|
||||
<p v-if="form.send_copy" class="mt-1 text-sm opacity-80">Eine Kopie Ihrer Angaben ist per E-Mail unterwegs.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p v-else-if="form.already_submitted" class="rounded-lg border bg-muted px-5 py-4 text-sm">Sie haben dieses Formular bereits ausgefüllt. Vielen Dank!</p>
|
||||
|
||||
<p v-else-if="!form.open" class="rounded-lg border bg-muted px-5 py-4 text-sm">Dieses Formular nimmt keine Einsendungen mehr an.</p>
|
||||
|
||||
<form v-else class="grid gap-5 @xl:grid-cols-2" novalidate @submit.prevent="submit">
|
||||
<p v-if="form.anonymous" class="flex items-start gap-2 rounded-md bg-muted px-3 py-2 text-[13px] text-muted-foreground @xl:col-span-2">
|
||||
<EyeOff class="mt-0.5 size-4 shrink-0" /> Anonym: Ihr Name und Ihre E-Mail-Adresse werden nicht gespeichert.
|
||||
</p>
|
||||
<p v-if="data.errors.form" class="rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive @xl:col-span-2">{{ data.errors.form }}</p>
|
||||
|
||||
<template v-for="field in visibleFields" :key="field.key">
|
||||
<h3 v-if="field.type === 'heading'" class="pt-2 text-lg font-semibold @xl:col-span-2">{{ field.text }}</h3>
|
||||
<p v-else-if="field.type === 'paragraph'" class="text-sm leading-relaxed whitespace-pre-line text-muted-foreground @xl:col-span-2">{{ field.text }}</p>
|
||||
|
||||
<div v-else class="grid content-start gap-1.5" :class="field.width === 'half' ? '' : '@xl:col-span-2'">
|
||||
<template v-if="field.type === 'checkbox'">
|
||||
<label :for="fieldId(field)" class="flex items-start gap-2.5 text-sm">
|
||||
<input :id="fieldId(field)" v-model="data.answers[field.key]" type="checkbox" class="mt-0.5 size-4 shrink-0 accent-[var(--brand)]" :aria-invalid="!!error(field)" />
|
||||
<span>{{ field.label }}<span v-if="field.required" class="text-destructive"> *</span></span>
|
||||
</label>
|
||||
</template>
|
||||
<template v-else>
|
||||
<component :is="['radio', 'checkboxes'].includes(field.type) ? 'span' : 'label'" :for="fieldId(field)" class="text-[13px] font-medium" :id="`${fieldId(field)}-label`">
|
||||
{{ field.label }}<span v-if="field.required" class="text-destructive"> *</span>
|
||||
</component>
|
||||
|
||||
<Textarea v-if="field.type === 'textarea'" :id="fieldId(field)" v-model="data.answers[field.key]" :rows="field.rows ?? 4" :maxlength="field.max" :aria-invalid="!!error(field)" />
|
||||
<NativeSelect v-else-if="field.type === 'select'" :id="fieldId(field)" v-model="data.answers[field.key]" :options="field.options.map((o) => ({ value: o, label: o }))" placeholder="Bitte wählen …" />
|
||||
|
||||
<div v-else-if="field.type === 'radio' || field.type === 'checkboxes'" class="grid gap-1.5" role="group" :aria-labelledby="`${fieldId(field)}-label`">
|
||||
<label v-for="option in field.options" :key="option" class="flex items-center gap-2.5 text-sm">
|
||||
<input
|
||||
v-if="field.type === 'radio'"
|
||||
v-model="data.answers[field.key]"
|
||||
type="radio"
|
||||
:name="fieldId(field)"
|
||||
:value="option"
|
||||
class="size-4 accent-[var(--brand)]"
|
||||
/>
|
||||
<input
|
||||
v-else
|
||||
type="checkbox"
|
||||
:checked="data.answers[field.key].includes(option)"
|
||||
class="size-4 accent-[var(--brand)]"
|
||||
@change="toggleOption(field, option)"
|
||||
/>
|
||||
{{ option }}
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div v-else-if="field.type === 'file'" class="grid gap-2">
|
||||
<ul v-if="data.answers[field.key].length" class="grid gap-1">
|
||||
<li v-for="(file, index) in data.answers[field.key]" :key="index" class="flex items-center gap-2 rounded-md border bg-card px-3 py-1.5 text-sm">
|
||||
<Paperclip class="size-4 shrink-0 text-muted-foreground" />
|
||||
<span class="min-w-0 flex-1 truncate">{{ file.name }}</span>
|
||||
<span class="text-xs text-muted-foreground">{{ formatSize(file.size) }}</span>
|
||||
<button type="button" class="grid size-6 place-items-center rounded hover:bg-accent" :aria-label="`${file.name} entfernen`" @click="removeFile(field, index)"><X class="size-3.5" /></button>
|
||||
</li>
|
||||
</ul>
|
||||
<label v-if="field.multiple || !data.answers[field.key].length" class="flex h-10 cursor-pointer items-center justify-center gap-2 rounded-md border border-dashed text-sm text-muted-foreground hover:border-brand-300 hover:text-foreground">
|
||||
<Paperclip class="size-4" /> {{ field.multiple ? 'Dateien auswählen' : 'Datei auswählen' }}
|
||||
<input :id="fieldId(field)" type="file" class="sr-only" :accept="field.accept" :multiple="field.multiple" @change="addFiles(field, $event)" />
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<Input
|
||||
v-else
|
||||
:id="fieldId(field)"
|
||||
v-model="data.answers[field.key]"
|
||||
:type="{ email: 'email', phone: 'tel', number: 'number', date: 'date' }[field.type] ?? 'text'"
|
||||
:placeholder="field.placeholder"
|
||||
:maxlength="field.type === 'text' ? field.max : undefined"
|
||||
:min="field.type === 'number' ? field.min : undefined"
|
||||
:max="field.type === 'number' ? field.max : undefined"
|
||||
:aria-invalid="!!error(field)"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<p v-if="error(field)" class="text-[13px] text-destructive">{{ error(field) }}</p>
|
||||
<p v-else-if="field.help" class="text-[13px] text-muted-foreground">
|
||||
{{ field.help }}<template v-if="field.type === 'file' && field.max_size"> (höchstens {{ field.max_size }} MB)</template>
|
||||
</p>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<div class="flex items-center gap-4 border-t pt-5 @xl:col-span-2">
|
||||
<Button type="submit" :disabled="data.processing">
|
||||
<LoaderCircle v-if="data.processing" class="animate-spin" />
|
||||
<Send v-else />
|
||||
{{ form.submit_label }}
|
||||
</Button>
|
||||
<span class="text-xs text-muted-foreground">* Pflichtfeld</span>
|
||||
</div>
|
||||
</form>
|
||||
</template>
|
||||
33
plugins-core/forms/resources/js/pages/Index.vue
Normal file
33
plugins-core/forms/resources/js/pages/Index.vue
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
<script setup>
|
||||
import { Link } from '@inertiajs/vue3';
|
||||
import { ChevronRight, ClipboardList } from '@lucide/vue';
|
||||
import EmptyState from '@/components/EmptyState.vue';
|
||||
import AppLayout from '@/layouts/AppLayout.vue';
|
||||
import { formatDate } from '@/lib/format';
|
||||
|
||||
defineProps({
|
||||
forms: { type: Array, required: true },
|
||||
});
|
||||
</script>
|
||||
|
||||
<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>
|
||||
|
||||
<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">
|
||||
<span class="grid size-10 shrink-0 place-items-center rounded-lg bg-brand-soft text-brand-text"><ClipboardList class="size-5" /></span>
|
||||
<span class="min-w-0 flex-1">
|
||||
<span class="block font-semibold group-hover:underline">{{ form.title }}</span>
|
||||
<span v-if="form.description" class="mt-1 line-clamp-2 block text-sm text-muted-foreground">{{ form.description }}</span>
|
||||
<span v-if="form.closes_at" class="mt-2 block text-xs text-muted-foreground">Bis {{ formatDate(form.closes_at) }}</span>
|
||||
</span>
|
||||
<ChevronRight class="mt-2.5 size-4 shrink-0 text-muted-foreground" />
|
||||
</Link>
|
||||
</div>
|
||||
<div v-else class="rounded-lg border bg-card"><EmptyState :icon="ClipboardList" title="Keine Formulare" text="Derzeit sind keine Formulare für Sie freigegeben." /></div>
|
||||
</AppLayout>
|
||||
</template>
|
||||
29
plugins-core/forms/resources/js/pages/Show.vue
Normal file
29
plugins-core/forms/resources/js/pages/Show.vue
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
<script setup>
|
||||
import { Link } from '@inertiajs/vue3';
|
||||
import { ArrowLeft, CalendarClock } from '@lucide/vue';
|
||||
import AppLayout from '@/layouts/AppLayout.vue';
|
||||
import { formatDate } from '@/lib/format';
|
||||
import FormRenderer from '../components/FormRenderer.vue';
|
||||
|
||||
defineProps({
|
||||
form: { type: Object, required: true },
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<AppLayout :title="form.title">
|
||||
<div class="mx-auto max-w-3xl">
|
||||
<Link href="/formulare" class="mb-6 inline-flex items-center gap-1.5 text-sm font-medium text-muted-foreground hover:text-foreground">
|
||||
<ArrowLeft class="size-4" /> Alle Formulare
|
||||
</Link>
|
||||
<h1 class="text-3xl font-semibold tracking-tight">{{ form.title }}</h1>
|
||||
<p v-if="form.description" class="mt-3 leading-relaxed whitespace-pre-line text-muted-foreground">{{ form.description }}</p>
|
||||
<p v-if="form.closes_at && form.open" class="mt-3 inline-flex items-center gap-1.5 text-[13px] text-muted-foreground">
|
||||
<CalendarClock class="size-4" /> Einsendeschluss: {{ formatDate(form.closes_at) }}
|
||||
</p>
|
||||
<div class="@container mt-8 rounded-lg border bg-card p-5 sm:p-8">
|
||||
<FormRenderer :form="form" />
|
||||
</div>
|
||||
</div>
|
||||
</AppLayout>
|
||||
</template>
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
<x-filament-panels::page>
|
||||
@if ($this->record->isAnonymous())
|
||||
<p class="text-sm text-gray-500">Anonymes Formular – Namen werden nicht gespeichert.</p>
|
||||
@endif
|
||||
{{ $this->table }}
|
||||
</x-filament-panels::page>
|
||||
37
plugins-core/forms/resources/views/mail/submitted.blade.php
Normal file
37
plugins-core/forms/resources/views/mail/submitted.blade.php
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
<!doctype html>
|
||||
<html lang="de">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width"></head>
|
||||
<body style="margin:0;background:#f4f5f7;font-family:-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;color:#1a1d21">
|
||||
<div style="max-width:640px;margin:0 auto;padding:24px">
|
||||
<p style="margin:0 0 16px;font-size:13px;color:#5f6670">{{ $portalName }}</p>
|
||||
<div style="background:#fff;border:1px solid #e3e5e8;border-radius:8px;padding:24px">
|
||||
<h1 style="margin:0 0 4px;font-size:20px">{{ $form->title }}</h1>
|
||||
<p style="margin:0 0 20px;font-size:14px;color:#5f6670">
|
||||
@if ($copy)
|
||||
Vielen Dank! Hier eine Kopie Ihrer Angaben vom {{ $submission->created_at->timezone(config('app.timezone'))->format('d.m.Y, H:i') }} Uhr.
|
||||
@else
|
||||
Eingegangen am {{ $submission->created_at->timezone(config('app.timezone'))->format('d.m.Y, H:i') }} Uhr
|
||||
– {{ $person ? 'von '.$person->name.' ('.$person->email.')' : 'anonym' }}.
|
||||
@endif
|
||||
</p>
|
||||
|
||||
@if ($answers !== null)
|
||||
<table style="width:100%;border-collapse:collapse;font-size:14px">
|
||||
@foreach ($answers as $answer)
|
||||
<tr>
|
||||
<td style="padding:8px 12px 8px 0;border-top:1px solid #e3e5e8;vertical-align:top;color:#5f6670;width:40%">{{ $answer['label'] }}</td>
|
||||
<td style="padding:8px 0;border-top:1px solid #e3e5e8;vertical-align:top;white-space:pre-line">{{ $answer['value'] !== '' ? $answer['value'] : '–' }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</table>
|
||||
@else
|
||||
<p style="font-size:14px">Die Angaben sind aus Datenschutzgründen nicht in dieser E-Mail enthalten.</p>
|
||||
@endif
|
||||
|
||||
@if ($resultsUrl)
|
||||
<p style="margin:24px 0 0"><a href="{{ $resultsUrl }}" style="display:inline-block;background:#1a1d21;color:#fff;text-decoration:none;padding:10px 16px;border-radius:6px;font-size:14px">Ergebnisse im Portal öffnen</a></p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
14
plugins-core/forms/routes/web.php
Normal file
14
plugins-core/forms/routes/web.php
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Inhaus\Plugins\Forms\Http\Controllers\FormController;
|
||||
use Inhaus\Plugins\Forms\Http\Controllers\FormResultsController;
|
||||
|
||||
Route::middleware('auth')->group(function () {
|
||||
Route::get('/formulare', [FormController::class, 'index'])->name('forms.index');
|
||||
Route::get('/formulare/{form:slug}', [FormController::class, 'show'])->name('forms.show');
|
||||
Route::post('/formulare/{form:slug}', [FormController::class, 'submit'])->middleware('throttle:20,1')->name('forms.submit');
|
||||
|
||||
Route::get('/formulare/dateien/{file}', [FormResultsController::class, 'file'])->name('forms.file');
|
||||
Route::get('/admin/formulare/{form}/export', [FormResultsController::class, 'export'])->name('forms.export');
|
||||
});
|
||||
256
plugins-core/forms/src/Filament/Resources/Forms/FormResource.php
Normal file
256
plugins-core/forms/src/Filament/Resources/Forms/FormResource.php
Normal file
|
|
@ -0,0 +1,256 @@
|
|||
<?php
|
||||
|
||||
namespace Inhaus\Plugins\Forms\Filament\Resources\Forms;
|
||||
|
||||
use App\Filament\Components\AudienceSection;
|
||||
use App\Filament\Components\RoleGrantSelect;
|
||||
use BackedEnum;
|
||||
use Filament\Actions\Action;
|
||||
use Filament\Actions\DeleteAction;
|
||||
use Filament\Actions\EditAction;
|
||||
use Filament\Forms\Components\Builder;
|
||||
use Filament\Forms\Components\Builder\Block;
|
||||
use Filament\Forms\Components\DateTimePicker;
|
||||
use Filament\Forms\Components\Select;
|
||||
use Filament\Forms\Components\TagsInput;
|
||||
use Filament\Forms\Components\Textarea;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Forms\Components\Toggle;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Schemas\Components\Fieldset;
|
||||
use Filament\Schemas\Components\Section;
|
||||
use Filament\Schemas\Components\Tabs;
|
||||
use Filament\Schemas\Components\Tabs\Tab;
|
||||
use Filament\Schemas\Components\Utilities\Get;
|
||||
use Filament\Schemas\Schema;
|
||||
use Filament\Support\Icons\Heroicon;
|
||||
use Filament\Tables\Columns\IconColumn;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Table;
|
||||
use Illuminate\Database\Eloquent\Builder as EloquentBuilder;
|
||||
use Inhaus\Plugins\Forms\Filament\Resources\Forms\Pages\CreateForm;
|
||||
use Inhaus\Plugins\Forms\Filament\Resources\Forms\Pages\EditForm;
|
||||
use Inhaus\Plugins\Forms\Filament\Resources\Forms\Pages\FormResults;
|
||||
use Inhaus\Plugins\Forms\Filament\Resources\Forms\Pages\ListForms;
|
||||
use Inhaus\Plugins\Forms\FormFields;
|
||||
use Inhaus\Plugins\Forms\Models\Form;
|
||||
use Inhaus\Plugins\Forms\Models\FormSubmission;
|
||||
use UnitEnum;
|
||||
|
||||
class FormResource extends Resource
|
||||
{
|
||||
protected static ?string $model = Form::class;
|
||||
|
||||
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedClipboardDocumentList;
|
||||
|
||||
protected static string|UnitEnum|null $navigationGroup = 'Inhalte';
|
||||
|
||||
protected static ?int $navigationSort = 5;
|
||||
|
||||
protected static ?string $modelLabel = 'Formular';
|
||||
|
||||
protected static ?string $pluralModelLabel = 'Formulare';
|
||||
|
||||
protected static ?string $slug = 'formulare';
|
||||
|
||||
protected static ?string $recordTitleAttribute = 'title';
|
||||
|
||||
public static function form(Schema $schema): Schema
|
||||
{
|
||||
return $schema->columns(1)->components([
|
||||
Tabs::make()->persistTabInQueryString()->tabs([
|
||||
Tab::make('Felder')->icon(Heroicon::OutlinedQueueList)->schema([
|
||||
TextInput::make('title')->label('Titel')->required()->maxLength(200),
|
||||
Textarea::make('description')->label('Einleitung')->rows(2)->maxLength(2000),
|
||||
Builder::make('fields')
|
||||
->label('Felder')
|
||||
->blocks(static::fieldBlocks())
|
||||
->addActionLabel('Feld hinzufügen')
|
||||
->blockPickerColumns(3)
|
||||
->blockNumbers(false)
|
||||
->collapsible()
|
||||
->collapsed(fn (string $operation) => $operation === 'edit')
|
||||
->cloneable()
|
||||
->reorderableWithButtons()
|
||||
->minItems(1)
|
||||
->default([]),
|
||||
]),
|
||||
Tab::make('Einstellungen')->icon(Heroicon::OutlinedCog6Tooth)->columns(2)->schema([
|
||||
Toggle::make('is_open')->label('Nimmt Einsendungen an')->default(true),
|
||||
DateTimePicker::make('closes_at')->label('Einsendeschluss')->native(false)->seconds(false)->displayFormat('d.m.Y H:i'),
|
||||
TextInput::make('settings.submit_label')->label('Beschriftung des Absende-Knopfs')->placeholder('Absenden')->maxLength(60),
|
||||
Toggle::make('settings.once_per_user')->label('Jede Person nur einmal')->inline(false),
|
||||
Textarea::make('settings.confirmation')->label('Bestätigung nach dem Absenden')->placeholder('Vielen Dank! Ihre Angaben sind eingegangen.')->rows(2)->maxLength(1000)->columnSpanFull(),
|
||||
Toggle::make('settings.anonymous')->label('Anonym')
|
||||
->helperText('Name und E-Mail-Adresse werden nicht gespeichert und nicht mitgeschickt – z. B. für Umfragen oder vertrauliche Meldungen an die MAV.')
|
||||
->columnSpanFull(),
|
||||
TextInput::make('settings.retention_days')->label('Einsendungen automatisch löschen nach')->numeric()->minValue(1)->maxValue(3650)->suffix('Tagen')
|
||||
->helperText('Leer = nicht automatisch löschen.'),
|
||||
]),
|
||||
Tab::make('Benachrichtigung')->icon(Heroicon::OutlinedEnvelope)->schema([
|
||||
TagsInput::make('settings.notify_emails')->label('E-Mail an')->placeholder('personal@firma.de')
|
||||
->nestedRecursiveRules(['email'])
|
||||
->helperText('Bei jeder Einsendung. Auch Funktionspostfächer möglich.'),
|
||||
Toggle::make('settings.notify_viewers')->label('Alle mit Zugriff auf die Ergebnisse benachrichtigen (E-Mail und Glocke im Portal)'),
|
||||
Toggle::make('settings.mail_answers')->label('Angaben in die E-Mail aufnehmen')->default(true)
|
||||
->helperText('Aus, wenn die Angaben vertraulich sind – die E-Mail enthält dann nur einen Link zu den Ergebnissen.'),
|
||||
Toggle::make('settings.send_copy')->label('Kopie an die ausfüllende Person'),
|
||||
]),
|
||||
Tab::make('Zugriff')->icon(Heroicon::OutlinedLockClosed)->schema([
|
||||
Section::make('Ergebnisse')
|
||||
->description('Welche Rollen die Einsendungen dieses Formulars sehen – z. B. nur die Personalabteilung.')
|
||||
->columns(3)
|
||||
->visible(fn () => auth()->user()->can('forms.manage') || auth()->user()->can('roles.manage'))
|
||||
->schema([
|
||||
RoleGrantSelect::make('result_viewers', 'Ansehen und exportieren', 'forms.results', 'form'),
|
||||
RoleGrantSelect::make('result_deleters', 'Löschen', 'forms.results.delete', 'form'),
|
||||
RoleGrantSelect::make('editors', 'Formular bearbeiten', 'forms.edit', 'form'),
|
||||
]),
|
||||
AudienceSection::make('form', 'Wer das Formular ausfüllen darf. Leer lassen = alle.'),
|
||||
]),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list<Block>
|
||||
*/
|
||||
public static function fieldBlocks(): array
|
||||
{
|
||||
$common = fn (array $extra = [], bool $prefill = false) => [
|
||||
TextInput::make('label')->label('Bezeichnung')->required()->maxLength(200)->live(onBlur: true)->columnSpan(2),
|
||||
Toggle::make('required')->label('Pflichtfeld')->inline(false),
|
||||
...$extra,
|
||||
TextInput::make('help')->label('Hinweis unter dem Feld')->maxLength(300)->columnSpan(2),
|
||||
Select::make('width')->label('Breite')->options(['full' => 'Volle Breite', 'half' => 'Halbe Breite'])->default('full')->native(false),
|
||||
...($prefill ? [Select::make('prefill')->label('Vorbelegen mit')->options(fn () => FormFields::prefillOptions())->placeholder('–')->native(false)] : []),
|
||||
static::conditionFieldset(),
|
||||
TextInput::make('key')->label('Technischer Schlüssel')->helperText('Für Export und Bedingungen. Leer = aus der Bezeichnung.')->maxLength(60)->alphaDash(),
|
||||
];
|
||||
|
||||
$options = TagsInput::make('options')->label('Auswahlmöglichkeiten')->placeholder('Eintrag eingeben und Enter')->required()->reorderable()->columnSpanFull();
|
||||
|
||||
return [
|
||||
Block::make('text')->label(static::blockLabel('text'))->icon(Heroicon::OutlinedPencil)->columns(3)
|
||||
->schema($common([TextInput::make('placeholder')->label('Platzhalter')->maxLength(100), TextInput::make('max')->label('Höchstlänge')->numeric()->minValue(1)->maxValue(255)], prefill: true)),
|
||||
Block::make('textarea')->label(static::blockLabel('textarea'))->icon(Heroicon::OutlinedBars3BottomLeft)->columns(3)
|
||||
->schema($common([TextInput::make('rows')->label('Zeilen')->numeric()->minValue(2)->maxValue(20)->default(4), TextInput::make('max')->label('Höchstlänge')->numeric()->minValue(1)->maxValue(10000)])),
|
||||
Block::make('email')->label(static::blockLabel('email'))->icon(Heroicon::OutlinedAtSymbol)->columns(3)->schema($common(prefill: true)),
|
||||
Block::make('phone')->label(static::blockLabel('phone'))->icon(Heroicon::OutlinedPhone)->columns(3)->schema($common(prefill: true)),
|
||||
Block::make('number')->label(static::blockLabel('number'))->icon(Heroicon::OutlinedHashtag)->columns(3)
|
||||
->schema($common([TextInput::make('min')->label('Mindestens')->numeric(), TextInput::make('max')->label('Höchstens')->numeric()])),
|
||||
Block::make('date')->label(static::blockLabel('date'))->icon(Heroicon::OutlinedCalendarDays)->columns(3)->schema($common()),
|
||||
Block::make('select')->label(static::blockLabel('select'))->icon(Heroicon::OutlinedChevronUpDown)->columns(3)->schema($common([$options])),
|
||||
Block::make('radio')->label(static::blockLabel('radio'))->icon(Heroicon::OutlinedStop)->columns(3)->schema($common([$options])),
|
||||
Block::make('checkboxes')->label(static::blockLabel('checkboxes'))->icon(Heroicon::OutlinedCheckCircle)->columns(3)
|
||||
->schema($common([$options, TextInput::make('min')->label('Mindestens … auswählen')->numeric()->minValue(0), TextInput::make('max')->label('Höchstens … auswählen')->numeric()->minValue(1)])),
|
||||
Block::make('checkbox')->label(static::blockLabel('checkbox'))->icon(Heroicon::OutlinedCheck)->columns(3)
|
||||
->schema($common()),
|
||||
Block::make('file')->label(static::blockLabel('file'))->icon(Heroicon::OutlinedPaperClip)->columns(3)
|
||||
->schema($common([
|
||||
Select::make('accept')->label('Erlaubte Dateien')->options(['documents' => 'Dokumente (PDF, Office …)', 'images' => 'Bilder', 'any' => 'Dokumente und Bilder'])->default('any')->native(false),
|
||||
TextInput::make('max_size')->label('Höchstgröße')->numeric()->minValue(1)->maxValue(50)->default(10)->suffix('MB'),
|
||||
Toggle::make('multiple')->label('Mehrere Dateien (bis 10)')->inline(false),
|
||||
])),
|
||||
Block::make('heading')->label(static::blockLabel('heading'))->icon(Heroicon::OutlinedH2)
|
||||
->schema([TextInput::make('text')->label('Text')->required()->maxLength(200), static::conditionFieldset()]),
|
||||
Block::make('paragraph')->label(static::blockLabel('paragraph'))->icon(Heroicon::OutlinedInformationCircle)
|
||||
->schema([Textarea::make('text')->label('Text')->required()->rows(3)->maxLength(3000), static::conditionFieldset()]),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Titel eines Feldes im Baukasten: Typ und Bezeichnung (auch zugeklappt lesbar).
|
||||
*/
|
||||
private static function blockLabel(string $type): \Closure
|
||||
{
|
||||
return function (?array $state) use ($type) {
|
||||
$text = $state['label'] ?? $state['text'] ?? null;
|
||||
$suffix = ($state['required'] ?? false) ? ' *' : '';
|
||||
$conditional = filled($state['condition_field'] ?? null) ? ' (bedingt)' : '';
|
||||
|
||||
return FormFields::TYPES[$type].($text ? ': '.mb_strimwidth((string) $text, 0, 70, '…') : '').$suffix.$conditional;
|
||||
};
|
||||
}
|
||||
|
||||
private static function conditionFieldset(): Fieldset
|
||||
{
|
||||
return Fieldset::make('Nur anzeigen, wenn …')->columns(3)->columnSpanFull()->schema([
|
||||
Select::make('condition_field')->label('Feld')->placeholder('– immer anzeigen –')->native(false)
|
||||
->options(function (Get $get) {
|
||||
// Alle Eingabefelder des Formulars (Bezeichnung → Schlüssel).
|
||||
$fields = FormFields::normalize((array) $get('../../../fields'));
|
||||
|
||||
return collect($fields)->reject(fn ($f) => in_array($f['type'], FormFields::LAYOUT_TYPES, true))
|
||||
->mapWithKeys(fn ($f) => [$f['data']['key'] => ($f['data']['label'] ?? $f['data']['key'])])->all();
|
||||
})
|
||||
->live(),
|
||||
Select::make('condition_operator')->label('Bedingung')->native(false)->default('equals')
|
||||
->options(['equals' => 'ist gleich', 'not_equals' => 'ist nicht', 'contains' => 'enthält (Mehrfachauswahl)', 'filled' => 'ist ausgefüllt', 'empty' => 'ist leer'])
|
||||
->visible(fn (Get $get) => filled($get('condition_field'))),
|
||||
TextInput::make('condition_value')->label('Wert')->maxLength(200)
|
||||
->visible(fn (Get $get) => filled($get('condition_field')) && ! in_array($get('condition_operator'), ['filled', 'empty'], true))
|
||||
->helperText('Bei Kontrollkästchen: 1 für „angehakt“.'),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sichtbar sind Formulare, die man bearbeiten oder deren Ergebnisse man sehen darf.
|
||||
*/
|
||||
public static function getEloquentQuery(): EloquentBuilder
|
||||
{
|
||||
$user = auth()->user();
|
||||
|
||||
if (! $user || $user->can('forms.manage')) {
|
||||
return parent::getEloquentQuery();
|
||||
}
|
||||
|
||||
$ids = collect([$user->permissions()->ids('forms.edit', 'form'), $user->permissions()->ids('forms.results', 'form')]);
|
||||
|
||||
// Streng vergleichen: eine ID-Liste ist nicht „alle“.
|
||||
return $ids->contains(fn ($value) => $value === true)
|
||||
? parent::getEloquentQuery()
|
||||
: parent::getEloquentQuery()->whereIn('id', $ids->flatten()->unique()->values()->all());
|
||||
}
|
||||
|
||||
public static function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->defaultSort('title')
|
||||
->columns([
|
||||
TextColumn::make('title')->label('Titel')->searchable()->weight('medium')
|
||||
->description(fn (Form $record) => $record->url()),
|
||||
TextColumn::make('submissions_count')->label('Einsendungen')->counts('submissions')->sortable()
|
||||
->badge()->color(fn (Form $record) => static::unread($record) ? 'primary' : 'gray')
|
||||
->formatStateUsing(fn ($state, Form $record) => ($unread = static::unread($record)) ? "{$state} ({$unread} neu)" : $state),
|
||||
IconColumn::make('is_open')->label('Offen')->boolean(),
|
||||
IconColumn::make('settings.anonymous')->label('Anonym')->boolean()->trueIcon(Heroicon::OutlinedEyeSlash)->falseIcon(false),
|
||||
TextColumn::make('closes_at')->label('Einsendeschluss')->dateTime('d.m.Y H:i')->placeholder('–'),
|
||||
])
|
||||
->recordActions([
|
||||
Action::make('results')->label('Ergebnisse')->icon(Heroicon::OutlinedTableCells)
|
||||
->url(fn (Form $record) => static::getUrl('results', ['record' => $record]))
|
||||
->visible(fn (Form $record) => auth()->user()->can('viewResults', $record)),
|
||||
EditAction::make()->visible(fn (Form $record) => auth()->user()->can('update', $record)),
|
||||
DeleteAction::make()->modalDescription('Das Formular und alle Einsendungen samt Dateien werden gelöscht.'),
|
||||
])
|
||||
->recordUrl(fn (Form $record) => auth()->user()->can('update', $record)
|
||||
? static::getUrl('edit', ['record' => $record])
|
||||
: static::getUrl('results', ['record' => $record]));
|
||||
}
|
||||
|
||||
private static function unread(Form $form): int
|
||||
{
|
||||
return once(fn () => FormSubmission::query()->whereNull('read_at')->selectRaw('form_id, count(*) as c')->groupBy('form_id')->pluck('c', 'form_id')->all())[$form->id] ?? 0;
|
||||
}
|
||||
|
||||
public static function getPages(): array
|
||||
{
|
||||
return [
|
||||
'index' => ListForms::route('/'),
|
||||
'create' => CreateForm::route('/neu'),
|
||||
'edit' => EditForm::route('/{record}/bearbeiten'),
|
||||
'results' => FormResults::route('/{record}/ergebnisse'),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
|
||||
namespace Inhaus\Plugins\Forms\Filament\Resources\Forms\Pages;
|
||||
|
||||
use Filament\Resources\Pages\CreateRecord;
|
||||
use Inhaus\Plugins\Forms\Filament\Resources\Forms\FormResource;
|
||||
|
||||
class CreateForm extends CreateRecord
|
||||
{
|
||||
protected static string $resource = FormResource::class;
|
||||
|
||||
protected function mutateFormDataBeforeCreate(array $data): array
|
||||
{
|
||||
return [...$data, 'created_by' => auth()->id()];
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
<?php
|
||||
|
||||
namespace Inhaus\Plugins\Forms\Filament\Resources\Forms\Pages;
|
||||
|
||||
use Filament\Actions\Action;
|
||||
use Filament\Actions\DeleteAction;
|
||||
use Filament\Resources\Pages\EditRecord;
|
||||
use Filament\Support\Icons\Heroicon;
|
||||
use Inhaus\Plugins\Forms\Filament\Resources\Forms\FormResource;
|
||||
|
||||
class EditForm extends EditRecord
|
||||
{
|
||||
protected static string $resource = FormResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
Action::make('view')->label('Ansehen')->icon(Heroicon::OutlinedEye)->color('gray')
|
||||
->url(fn () => $this->record->url())->openUrlInNewTab(),
|
||||
Action::make('results')->label('Ergebnisse')->icon(Heroicon::OutlinedTableCells)->color('gray')
|
||||
->url(fn () => FormResource::getUrl('results', ['record' => $this->record]))
|
||||
->visible(fn () => auth()->user()->can('viewResults', $this->record)),
|
||||
DeleteAction::make()->modalDescription('Das Formular und alle Einsendungen samt Dateien werden gelöscht.'),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,141 @@
|
|||
<?php
|
||||
|
||||
namespace Inhaus\Plugins\Forms\Filament\Resources\Forms\Pages;
|
||||
|
||||
use App\Support\Audit;
|
||||
use Filament\Actions\Action;
|
||||
use Filament\Actions\BulkAction;
|
||||
use Filament\Actions\DeleteAction;
|
||||
use Filament\Resources\Pages\Concerns\InteractsWithRecord;
|
||||
use Filament\Resources\Pages\Page;
|
||||
use Filament\Support\Icons\Heroicon;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Concerns\InteractsWithTable;
|
||||
use Filament\Tables\Contracts\HasTable;
|
||||
use Filament\Tables\Filters\TernaryFilter;
|
||||
use Filament\Tables\Table;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\HtmlString;
|
||||
use Illuminate\Support\Str;
|
||||
use Inhaus\Plugins\Forms\Filament\Resources\Forms\FormResource;
|
||||
use Inhaus\Plugins\Forms\FormFields;
|
||||
use Inhaus\Plugins\Forms\Models\Form;
|
||||
use Inhaus\Plugins\Forms\Models\FormSubmission;
|
||||
|
||||
/**
|
||||
* Einsendungen eines Formulars – nur für Rollen mit „Ergebnisse ansehen“ für dieses Formular.
|
||||
*/
|
||||
class FormResults extends Page implements HasTable
|
||||
{
|
||||
use InteractsWithRecord;
|
||||
use InteractsWithTable;
|
||||
|
||||
protected static string $resource = FormResource::class;
|
||||
|
||||
protected string $view = 'forms::filament.results';
|
||||
|
||||
public function mount(int|string $record): void
|
||||
{
|
||||
$this->record = $this->resolveRecord($record);
|
||||
abort_unless(auth()->user()->can('viewResults', $this->record), 403);
|
||||
}
|
||||
|
||||
public function getTitle(): string
|
||||
{
|
||||
return 'Ergebnisse: '.$this->record->title;
|
||||
}
|
||||
|
||||
public function getBreadcrumbs(): array
|
||||
{
|
||||
return [FormResource::getUrl() => 'Formulare', 'Ergebnisse'];
|
||||
}
|
||||
|
||||
public function table(Table $table): Table
|
||||
{
|
||||
/** @var Form $form */
|
||||
$form = $this->record;
|
||||
$inputs = array_slice(FormFields::inputs($form), 0, 4, true);
|
||||
$canDelete = auth()->user()->can('deleteResults', $form);
|
||||
|
||||
return $table
|
||||
->query(FormSubmission::query()->where('form_id', $form->id)->with(['user:id,name,email', 'files']))
|
||||
->defaultSort('created_at', 'desc')
|
||||
->columns([
|
||||
TextColumn::make('created_at')->label('Eingegangen')->dateTime('d.m.Y H:i')->sortable()
|
||||
->weight(fn (FormSubmission $s) => $s->read_at ? null : 'bold')
|
||||
->description(fn (FormSubmission $s) => $s->read_at ? null : 'neu'),
|
||||
TextColumn::make('user.name')->label('Person')->placeholder('anonym')->searchable()->visible(! $form->isAnonymous()),
|
||||
...collect($inputs)->map(fn ($label, $key) => TextColumn::make('answer_'.$key)
|
||||
->label(Str::limit($label, 30))
|
||||
->state(fn (FormSubmission $s) => Str::limit($s->display($key), 60))
|
||||
->wrap())->values()->all(),
|
||||
])
|
||||
->filters([
|
||||
TernaryFilter::make('read_at')->label('Gelesen')->nullable()->trueLabel('Gelesen')->falseLabel('Neu'),
|
||||
])
|
||||
->recordActions([
|
||||
Action::make('view')->label('Ansehen')->icon(Heroicon::OutlinedEye)
|
||||
->modalHeading(fn (FormSubmission $s) => 'Einsendung vom '.$s->created_at->format('d.m.Y, H:i').' Uhr')
|
||||
->modalContent(fn (FormSubmission $s) => $this->details($s))
|
||||
->modalSubmitAction(false)
|
||||
->modalCancelActionLabel('Schließen')
|
||||
->mountUsing(fn (FormSubmission $s) => $s->read_at ?? $s->forceFill(['read_at' => now()])->save()),
|
||||
DeleteAction::make()->visible($canDelete)->after(fn (FormSubmission $s) => Audit::log('forms.submission_deleted', ['form' => $form->id, 'submission' => $s->id])),
|
||||
])
|
||||
->toolbarActions([
|
||||
BulkAction::make('markRead')->label('Als gelesen markieren')->icon(Heroicon::OutlinedCheck)
|
||||
->action(fn (Collection $records) => FormSubmission::query()->whereIn('id', $records->modelKeys())->whereNull('read_at')->update(['read_at' => now()]))
|
||||
->deselectRecordsAfterCompletion(),
|
||||
BulkAction::make('delete')->label('Löschen')->icon(Heroicon::OutlinedTrash)->color('danger')->requiresConfirmation()
|
||||
->visible($canDelete)
|
||||
->action(function (Collection $records) use ($form) {
|
||||
$records->each->delete();
|
||||
Audit::log('forms.submissions_deleted', ['form' => $form->id, 'count' => $records->count()]);
|
||||
})
|
||||
->deselectRecordsAfterCompletion(),
|
||||
])
|
||||
->emptyStateHeading('Noch keine Einsendungen')
|
||||
->emptyStateIcon(Heroicon::OutlinedInboxStack);
|
||||
}
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
Action::make('export')->label('Als CSV exportieren')->icon(Heroicon::OutlinedArrowDownTray)
|
||||
->url(fn () => route('forms.export', $this->record)),
|
||||
Action::make('edit')->label('Formular bearbeiten')->icon(Heroicon::OutlinedPencilSquare)->color('gray')
|
||||
->url(fn () => FormResource::getUrl('edit', ['record' => $this->record]))
|
||||
->visible(fn () => auth()->user()->can('update', $this->record)),
|
||||
];
|
||||
}
|
||||
|
||||
private function details(FormSubmission $submission): HtmlString
|
||||
{
|
||||
$rows = '';
|
||||
|
||||
if (! $this->record->isAnonymous()) {
|
||||
$rows .= self::row('Person', e($submission->user ? $submission->user->name.' ('.$submission->user->email.')' : 'gelöschtes Konto'));
|
||||
}
|
||||
|
||||
foreach ($submission->data as $key => $answer) {
|
||||
if (($answer['type'] ?? null) === 'file') {
|
||||
$value = collect($submission->files->where('field', $key))
|
||||
->map(fn ($file) => '<a href="'.e($file->url()).'" style="color: rgb(var(--primary-600, 37 99 235)); text-decoration: underline">'.e($file->name).'</a>')
|
||||
->implode('<br>') ?: '–';
|
||||
} else {
|
||||
$value = nl2br(e($submission->display($key) ?: '–'));
|
||||
}
|
||||
|
||||
$rows .= self::row(e($answer['label']), $value);
|
||||
}
|
||||
|
||||
return new HtmlString('<table style="width: 100%; border-collapse: collapse; font-size: 0.875rem">'.$rows.'</table>');
|
||||
}
|
||||
|
||||
private static function row(string $label, string $value): string
|
||||
{
|
||||
$cell = 'padding: 0.5rem 0; border-top: 1px solid rgba(127, 127, 127, 0.2); vertical-align: top;';
|
||||
|
||||
return '<tr><th style="'.$cell.' width: 40%; padding-right: 1rem; text-align: left; font-weight: 500; opacity: 0.7">'.$label.'</th><td style="'.$cell.'">'.$value.'</td></tr>';
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
namespace Inhaus\Plugins\Forms\Filament\Resources\Forms\Pages;
|
||||
|
||||
use Filament\Actions\CreateAction;
|
||||
use Filament\Resources\Pages\ListRecords;
|
||||
use Inhaus\Plugins\Forms\Filament\Resources\Forms\FormResource;
|
||||
|
||||
class ListForms extends ListRecords
|
||||
{
|
||||
protected static string $resource = FormResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [CreateAction::make()->label('Formular anlegen')];
|
||||
}
|
||||
}
|
||||
295
plugins-core/forms/src/FormFields.php
Normal file
295
plugins-core/forms/src/FormFields.php
Normal file
|
|
@ -0,0 +1,295 @@
|
|||
<?php
|
||||
|
||||
namespace Inhaus\Plugins\Forms;
|
||||
|
||||
use App\Models\User;
|
||||
use App\Support\ProfileFields;
|
||||
use Illuminate\Http\UploadedFile;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Validation\Rule;
|
||||
use Illuminate\Validation\Rules\File;
|
||||
use Inhaus\Plugins\Forms\Models\Form;
|
||||
|
||||
/**
|
||||
* Felder eines Formulars: Typen, Bedingungen, Validierung und Aufbereitung.
|
||||
*
|
||||
* Gespeichert wird das Format des Formularbaukastens im Admin:
|
||||
* [['type' => 'text', 'data' => ['label' => 'Name', 'key' => 'name', 'required' => true, …]], …]
|
||||
*/
|
||||
class FormFields
|
||||
{
|
||||
public const TYPES = [
|
||||
'text' => 'Textzeile',
|
||||
'textarea' => 'Mehrzeiliger Text',
|
||||
'email' => 'E-Mail-Adresse',
|
||||
'phone' => 'Telefonnummer',
|
||||
'number' => 'Zahl',
|
||||
'date' => 'Datum',
|
||||
'select' => 'Auswahlliste',
|
||||
'radio' => 'Einfachauswahl',
|
||||
'checkboxes' => 'Mehrfachauswahl',
|
||||
'checkbox' => 'Kontrollkästchen (Ja/Nein)',
|
||||
'file' => 'Datei-Upload',
|
||||
'heading' => 'Zwischenüberschrift',
|
||||
'paragraph' => 'Hinweistext',
|
||||
];
|
||||
|
||||
/** Nur Gestaltung, kein Eingabefeld. */
|
||||
public const LAYOUT_TYPES = ['heading', 'paragraph'];
|
||||
|
||||
public const FILE_TYPES = [
|
||||
'documents' => ['pdf', 'doc', 'docx', 'xls', 'xlsx', 'odt', 'ods', 'ppt', 'pptx', 'txt', 'csv', 'rtf'],
|
||||
'images' => ['jpg', 'jpeg', 'png', 'webp', 'gif', 'heic'],
|
||||
'any' => ['pdf', 'doc', 'docx', 'xls', 'xlsx', 'odt', 'ods', 'ppt', 'pptx', 'txt', 'csv', 'rtf', 'jpg', 'jpeg', 'png', 'webp', 'gif', 'heic', 'zip', 'msg', 'eml'],
|
||||
];
|
||||
|
||||
public const PREFILL = [
|
||||
'name' => 'Name',
|
||||
'first_name' => 'Vorname',
|
||||
'last_name' => 'Nachname',
|
||||
'email' => 'E-Mail-Adresse',
|
||||
'phone' => 'Telefon',
|
||||
'mobile' => 'Mobil',
|
||||
'job_title' => 'Funktion',
|
||||
'department' => 'Abteilung',
|
||||
'location' => 'Standort',
|
||||
];
|
||||
|
||||
/**
|
||||
* Schlüssel ergänzen und eindeutig machen, unbekannte Typen entfernen.
|
||||
*
|
||||
* @param array<mixed> $fields
|
||||
* @return list<array{type: string, data: array<string, mixed>}>
|
||||
*/
|
||||
public static function normalize(array $fields): array
|
||||
{
|
||||
$result = [];
|
||||
$used = [];
|
||||
|
||||
foreach (array_values($fields) as $index => $field) {
|
||||
$type = $field['type'] ?? null;
|
||||
|
||||
if (! is_array($field) || ! isset(self::TYPES[$type])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$data = is_array($field['data'] ?? null) ? $field['data'] : [];
|
||||
$base = Str::slug((string) (($data['key'] ?? '') ?: ($data['label'] ?? $data['text'] ?? '') ?: $type.'-'.($index + 1)), '_', 'de') ?: $type;
|
||||
$base = mb_substr($base, 0, 60);
|
||||
$key = $base;
|
||||
|
||||
for ($i = 2; in_array($key, $used, true); $i++) {
|
||||
$key = $base.'_'.$i;
|
||||
}
|
||||
|
||||
$used[] = $key;
|
||||
$data['key'] = $key;
|
||||
$result[] = ['type' => $type, 'data' => $data];
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Beschreibung für das Formular im Portal (ohne interne Einstellungen).
|
||||
*
|
||||
* @return list<array<string, mixed>>
|
||||
*/
|
||||
public static function forFrontend(Form $form): array
|
||||
{
|
||||
return array_map(function (array $field) {
|
||||
$d = $field['data'];
|
||||
|
||||
return array_filter([
|
||||
'type' => $field['type'],
|
||||
'key' => $d['key'],
|
||||
'label' => $d['label'] ?? null,
|
||||
'text' => $d['text'] ?? null,
|
||||
'help' => $d['help'] ?? null,
|
||||
'placeholder' => $d['placeholder'] ?? null,
|
||||
'required' => (bool) ($d['required'] ?? false),
|
||||
'options' => array_values(array_filter(array_map('strval', (array) ($d['options'] ?? [])), 'strlen')) ?: null,
|
||||
'width' => $d['width'] ?? 'full',
|
||||
'min' => $d['min'] ?? null,
|
||||
'max' => $d['max'] ?? null,
|
||||
'rows' => $d['rows'] ?? null,
|
||||
'multiple' => (bool) ($d['multiple'] ?? false),
|
||||
'accept' => isset($d['accept']) ? implode(',', array_map(fn ($ext) => '.'.$ext, self::FILE_TYPES[$d['accept']] ?? self::FILE_TYPES['any'])) : null,
|
||||
'max_size' => $d['max_size'] ?? null,
|
||||
'condition' => filled($d['condition_field'] ?? null) ? [
|
||||
'field' => $d['condition_field'],
|
||||
'operator' => $d['condition_operator'] ?? 'equals',
|
||||
'value' => (string) ($d['condition_value'] ?? ''),
|
||||
] : null,
|
||||
], fn ($value) => $value !== null && $value !== false && $value !== '');
|
||||
}, $form->fields ?? []);
|
||||
}
|
||||
|
||||
/**
|
||||
* Vorbelegung aus dem Profil der Person.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public static function prefill(Form $form, User $user): array
|
||||
{
|
||||
$values = [];
|
||||
|
||||
foreach ($form->fields ?? [] as $field) {
|
||||
$source = $field['data']['prefill'] ?? null;
|
||||
|
||||
if (! $source) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$values[$field['data']['key']] = str_starts_with($source, 'custom.')
|
||||
? (string) (($user->custom_fields ?? [])[substr($source, 7)] ?? '')
|
||||
: (string) ($user->{$source} ?? '');
|
||||
}
|
||||
|
||||
return $values;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public static function prefillOptions(): array
|
||||
{
|
||||
return self::PREFILL + collect(app(ProfileFields::class)->options())->mapWithKeys(fn ($label, $key) => ['custom.'.$key => $label])->all();
|
||||
}
|
||||
|
||||
/**
|
||||
* Ist das Feld bei diesen Antworten sichtbar? (Bedingungen, auch verkettet)
|
||||
*
|
||||
* @param array<string, mixed> $answers
|
||||
*/
|
||||
public static function visible(Form $form, array $field, array $answers, int $depth = 0): bool
|
||||
{
|
||||
$d = $field['data'];
|
||||
|
||||
if (blank($d['condition_field'] ?? null) || $depth > 10) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$other = collect($form->fields)->first(fn ($f) => $f['data']['key'] === $d['condition_field']);
|
||||
|
||||
if (! $other || ! self::visible($form, $other, $answers, $depth + 1)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$value = $answers[$d['condition_field']] ?? null;
|
||||
$expected = (string) ($d['condition_value'] ?? '');
|
||||
$values = array_map('strval', is_array($value) ? $value : ($value === null || $value === '' ? [] : [$value === true ? '1' : (string) $value]));
|
||||
|
||||
return match ($d['condition_operator'] ?? 'equals') {
|
||||
'not_equals' => ! in_array($expected, $values, true),
|
||||
'contains' => in_array($expected, $values, true),
|
||||
'filled' => $values !== [] && $values !== ['0'],
|
||||
'empty' => $values === [] || $values === ['0'],
|
||||
default => in_array($expected, $values, true),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Validierungsregeln für die sichtbaren Felder.
|
||||
*
|
||||
* @param array<string, mixed> $answers
|
||||
* @return array{0: array<string, mixed>, 1: array<string, string>, 2: array<string, string>}
|
||||
*/
|
||||
public static function rules(Form $form, array $answers): array
|
||||
{
|
||||
$rules = [];
|
||||
$attributes = [];
|
||||
$messages = [];
|
||||
|
||||
foreach ($form->fields ?? [] as $field) {
|
||||
if (in_array($field['type'], self::LAYOUT_TYPES, true) || ! self::visible($form, $field, $answers)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$d = $field['data'];
|
||||
$name = 'answers.'.$d['key'];
|
||||
$required = (bool) ($d['required'] ?? false);
|
||||
$attributes[$name] = $d['label'] ?? $d['key'];
|
||||
$options = array_values(array_filter(array_map('strval', (array) ($d['options'] ?? [])), 'strlen'));
|
||||
$max = isset($d['max']) && $d['max'] !== '' ? (int) $d['max'] : null;
|
||||
$min = isset($d['min']) && $d['min'] !== '' ? (int) $d['min'] : null;
|
||||
|
||||
$rules[$name] = match ($field['type']) {
|
||||
'text' => [$required ? 'required' : 'nullable', 'string', 'max:'.($max ?: 255)],
|
||||
'textarea' => [$required ? 'required' : 'nullable', 'string', 'max:'.($max ?: 10000)],
|
||||
'email' => [$required ? 'required' : 'nullable', 'email', 'max:255'],
|
||||
'phone' => [$required ? 'required' : 'nullable', 'string', 'max:50', 'regex:/^[0-9+()\/\-.\s]{3,50}$/'],
|
||||
'number' => [$required ? 'required' : 'nullable', 'numeric', ...($min !== null ? ['min:'.$min] : []), ...($max !== null ? ['max:'.$max] : [])],
|
||||
'date' => [$required ? 'required' : 'nullable', 'date'],
|
||||
'select', 'radio' => [$required ? 'required' : 'nullable', 'string', Rule::in($options)],
|
||||
'checkboxes' => [$required ? 'required' : 'nullable', 'array', ...($min ? ['min:'.$min] : []), ...($max ? ['max:'.$max] : [])],
|
||||
'checkbox' => $required ? ['accepted'] : ['nullable', 'boolean'],
|
||||
'file' => [$required ? 'required' : 'nullable', 'array', 'max:'.(($d['multiple'] ?? false) ? 10 : 1)],
|
||||
};
|
||||
|
||||
if ($field['type'] === 'checkbox') {
|
||||
$messages[$name.'.accepted'] = 'Bitte bestätigen.';
|
||||
}
|
||||
|
||||
if ($field['type'] === 'checkboxes') {
|
||||
$rules[$name.'.*'] = ['string', Rule::in($options)];
|
||||
}
|
||||
|
||||
if ($field['type'] === 'file') {
|
||||
$rules[$name.'.*'] = [File::types(self::FILE_TYPES[$d['accept'] ?? 'any'] ?? self::FILE_TYPES['any'])->max(min(50, max(1, (int) ($d['max_size'] ?? 10))) * 1024)];
|
||||
$attributes[$name.'.*'] = $attributes[$name];
|
||||
}
|
||||
}
|
||||
|
||||
return [$rules, $attributes, $messages];
|
||||
}
|
||||
|
||||
/**
|
||||
* Antworten zum Speichern aufbereiten – nur sichtbare Felder.
|
||||
*
|
||||
* @param array<string, mixed> $answers validierte Eingaben
|
||||
* @return array{0: array<string, array{label: string, type: string, value: mixed}>, 1: array<string, list<UploadedFile>>}
|
||||
*/
|
||||
public static function collect(Form $form, array $answers): array
|
||||
{
|
||||
$data = [];
|
||||
$files = [];
|
||||
|
||||
foreach ($form->fields ?? [] as $field) {
|
||||
if (in_array($field['type'], self::LAYOUT_TYPES, true) || ! self::visible($form, $field, $answers)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$key = $field['data']['key'];
|
||||
$value = $answers[$key] ?? null;
|
||||
|
||||
if ($field['type'] === 'file') {
|
||||
$files[$key] = array_values(array_filter((array) $value, fn ($f) => $f instanceof UploadedFile));
|
||||
$value = [];
|
||||
} elseif ($field['type'] === 'checkbox') {
|
||||
$value = (bool) $value;
|
||||
} elseif ($field['type'] === 'checkboxes') {
|
||||
$value = array_values(array_map('strval', (array) $value));
|
||||
} elseif ($value !== null) {
|
||||
$value = trim((string) $value);
|
||||
}
|
||||
|
||||
$data[$key] = ['label' => (string) ($field['data']['label'] ?? $key), 'type' => $field['type'], 'value' => $value];
|
||||
}
|
||||
|
||||
return [$data, $files];
|
||||
}
|
||||
|
||||
/**
|
||||
* Eingabefelder (ohne Gestaltungselemente): Schlüssel => Bezeichnung.
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public static function inputs(Form $form): array
|
||||
{
|
||||
return collect($form->fields ?? [])
|
||||
->reject(fn ($f) => in_array($f['type'], self::LAYOUT_TYPES, true))
|
||||
->mapWithKeys(fn ($f) => [$f['data']['key'] => (string) ($f['data']['label'] ?? $f['data']['key'])])
|
||||
->all();
|
||||
}
|
||||
}
|
||||
36
plugins-core/forms/src/FormPresenter.php
Normal file
36
plugins-core/forms/src/FormPresenter.php
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
|
||||
namespace Inhaus\Plugins\Forms;
|
||||
|
||||
use App\Models\User;
|
||||
use Inhaus\Plugins\Forms\Models\Form;
|
||||
|
||||
/**
|
||||
* Daten eines Formulars für das Portal (Seite und Pagebuilder-Block).
|
||||
*/
|
||||
final class FormPresenter
|
||||
{
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public static function present(Form $form, User $user): array
|
||||
{
|
||||
$once = (bool) $form->setting('once_per_user');
|
||||
|
||||
return [
|
||||
'id' => $form->id,
|
||||
'title' => $form->title,
|
||||
'description' => $form->description,
|
||||
'url' => $form->url(),
|
||||
'fields' => FormFields::forFrontend($form),
|
||||
'prefill' => FormFields::prefill($form, $user),
|
||||
'submit_label' => $form->setting('submit_label') ?: 'Absenden',
|
||||
'confirmation' => $form->setting('confirmation') ?: 'Vielen Dank! Ihre Angaben sind eingegangen.',
|
||||
'anonymous' => $form->isAnonymous(),
|
||||
'send_copy' => (bool) $form->setting('send_copy'),
|
||||
'open' => $form->acceptsSubmissions(),
|
||||
'closes_at' => $form->closes_at?->toIso8601String(),
|
||||
'already_submitted' => $once && $form->alreadySubmittedBy($user),
|
||||
];
|
||||
}
|
||||
}
|
||||
50
plugins-core/forms/src/FormsPlugin.php
Normal file
50
plugins-core/forms/src/FormsPlugin.php
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
<?php
|
||||
|
||||
namespace Inhaus\Plugins\Forms;
|
||||
|
||||
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 Illuminate\Support\Facades\Schedule;
|
||||
use Inhaus\Plugins\Forms\Models\Form;
|
||||
use Inhaus\Plugins\Forms\Policies\FormPolicy;
|
||||
|
||||
class FormsPlugin extends Plugin
|
||||
{
|
||||
public function register(): void
|
||||
{
|
||||
$this->app->make(Navigation::class)->add('forms', 'Formulare', '/formulare', active: ['forms.index', 'forms.show'], sort: 60);
|
||||
|
||||
$abilities = $this->app->make(Abilities::class);
|
||||
$abilities->define('forms.manage', 'Formulare: alle Formulare und Ergebnisse verwalten', 'Formulare');
|
||||
$abilities->define('forms.edit', 'Formular bearbeiten', 'Formulare', resource: 'form');
|
||||
$abilities->define('forms.results', 'Ergebnisse ansehen und exportieren', 'Formulare', resource: 'form');
|
||||
$abilities->define('forms.results.delete', 'Ergebnisse löschen', 'Formulare', resource: 'form');
|
||||
$abilities->resourceType('form', 'Formular', fn () => Form::query()->orderBy('title')->pluck('title', 'id')->all());
|
||||
|
||||
Gate::policy(Form::class, FormPolicy::class);
|
||||
|
||||
$this->app->make(Blocks::class)->add(BlockType::make('forms.form', 'Formular', 'clipboard-list', 'dynamic', 'forms::FormBlock')
|
||||
->description('Ein Formular direkt auf der Seite ausfüllen lassen.')
|
||||
->fields([
|
||||
Field::select('form', 'Formular', fn () => Form::query()->orderBy('title')->pluck('title', 'id')->mapWithKeys(fn ($t, $id) => [(string) $id => $t])->all()),
|
||||
Field::toggle('show_title', 'Titel und Beschreibung anzeigen', true),
|
||||
])
|
||||
->resolveUsing(function (array $data, ?User $user) {
|
||||
$form = $data['form'] ? Form::query()->find($data['form']) : null;
|
||||
|
||||
return $form && $user && $form->isVisibleTo($user) ? FormPresenter::present($form, $user) : null;
|
||||
}));
|
||||
}
|
||||
|
||||
public function boot(): void
|
||||
{
|
||||
// Löschfristen: alte Einsendungen samt Dateien entfernen.
|
||||
Schedule::call(fn () => app(Retention::class)->purge())->dailyAt('03:15')->name('forms-retention')->withoutOverlapping(30);
|
||||
}
|
||||
}
|
||||
72
plugins-core/forms/src/Http/Controllers/FormController.php
Normal file
72
plugins-core/forms/src/Http/Controllers/FormController.php
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
<?php
|
||||
|
||||
namespace Inhaus\Plugins\Forms\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use Inertia\Inertia;
|
||||
use Inertia\Response;
|
||||
use Inhaus\Plugins\Forms\FormFields;
|
||||
use Inhaus\Plugins\Forms\FormPresenter;
|
||||
use Inhaus\Plugins\Forms\Models\Form;
|
||||
use Inhaus\Plugins\Forms\Submissions;
|
||||
|
||||
class FormController extends Controller
|
||||
{
|
||||
public function index(Request $request): Response
|
||||
{
|
||||
$forms = Form::query()->visibleTo($request->user())
|
||||
->where('is_open', true)
|
||||
->where(fn ($q) => $q->whereNull('closes_at')->orWhere('closes_at', '>', now()))
|
||||
->orderBy('title')
|
||||
->get(['id', 'title', 'slug', 'description', 'closes_at']);
|
||||
|
||||
return Inertia::render('forms::Index', [
|
||||
'forms' => $forms->map(fn (Form $form) => [
|
||||
'id' => $form->id,
|
||||
'title' => $form->title,
|
||||
'description' => $form->description,
|
||||
'url' => $form->url(),
|
||||
'closes_at' => $form->closes_at?->toIso8601String(),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
|
||||
public function show(Request $request, Form $form): Response
|
||||
{
|
||||
abort_unless($form->isVisibleTo($request->user()), 404);
|
||||
|
||||
return Inertia::render('forms::Show', [
|
||||
'form' => FormPresenter::present($form, $request->user()),
|
||||
]);
|
||||
}
|
||||
|
||||
public function submit(Request $request, Form $form, Submissions $submissions): RedirectResponse
|
||||
{
|
||||
$user = $request->user();
|
||||
abort_unless($form->isVisibleTo($user), 404);
|
||||
|
||||
if (! $form->acceptsSubmissions()) {
|
||||
return back()->withErrors(['form' => 'Dieses Formular nimmt keine Einsendungen mehr an.']);
|
||||
}
|
||||
|
||||
if ($form->setting('once_per_user') && $form->alreadySubmittedBy($user)) {
|
||||
return back()->withErrors(['form' => 'Sie haben dieses Formular bereits ausgefüllt.']);
|
||||
}
|
||||
|
||||
$answers = (array) $request->input('answers', []);
|
||||
|
||||
foreach ($request->allFiles()['answers'] ?? [] as $key => $files) {
|
||||
$answers[$key] = is_array($files) ? $files : [$files];
|
||||
}
|
||||
|
||||
[$rules, $attributes, $messages] = FormFields::rules($form, $answers);
|
||||
$validated = Validator::make(['answers' => $answers], $rules, $messages, $attributes)->validate();
|
||||
|
||||
$submissions->store($form, $user, $validated['answers'] ?? []);
|
||||
|
||||
return back()->with('form_submitted', $form->id);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,78 @@
|
|||
<?php
|
||||
|
||||
namespace Inhaus\Plugins\Forms\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Support\Audit;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Gate;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Support\Str;
|
||||
use Inhaus\Plugins\Forms\FormFields;
|
||||
use Inhaus\Plugins\Forms\Models\Form;
|
||||
use Inhaus\Plugins\Forms\Models\FormFile;
|
||||
use Symfony\Component\HttpFoundation\StreamedResponse;
|
||||
|
||||
class FormResultsController extends Controller
|
||||
{
|
||||
public function file(FormFile $file): StreamedResponse
|
||||
{
|
||||
Gate::authorize('viewResults', $file->submission->form);
|
||||
|
||||
return Storage::disk(FormFile::DISK)->download($file->path, $file->name, [
|
||||
'Content-Type' => $file->mime ?: 'application/octet-stream',
|
||||
'X-Content-Type-Options' => 'nosniff',
|
||||
'Cache-Control' => 'private, no-store',
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* CSV für Excel: UTF-8 mit BOM, Semikolon als Trenner.
|
||||
*/
|
||||
public function export(Request $request, Form $form): StreamedResponse
|
||||
{
|
||||
Gate::authorize('viewResults', $form);
|
||||
Audit::log('forms.exported', ['form' => $form->id, 'title' => $form->title]);
|
||||
|
||||
$columns = FormFields::inputs($form);
|
||||
$anonymous = $form->isAnonymous();
|
||||
|
||||
return response()->streamDownload(function () use ($form, $columns, $anonymous) {
|
||||
$out = fopen('php://output', 'w');
|
||||
fwrite($out, "\xEF\xBB\xBF");
|
||||
|
||||
$known = $columns;
|
||||
|
||||
// Felder, die es nur noch in älteren Einsendungen gibt, hinten anhängen.
|
||||
$form->submissions()->select(['id', 'data'])->chunkById(500, function ($chunk) use (&$known) {
|
||||
foreach ($chunk as $submission) {
|
||||
foreach ($submission->data as $key => $answer) {
|
||||
$known[$key] ??= $answer['label'];
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
fputcsv($out, ['Eingegangen am', ...($anonymous ? [] : ['Name', 'E-Mail']), ...array_values($known)], ';', '"', '');
|
||||
|
||||
$form->submissions()->with('user:id,name,email')->orderBy('id')->chunkById(500, function ($chunk) use ($out, $known, $anonymous) {
|
||||
foreach ($chunk as $submission) {
|
||||
fputcsv($out, [
|
||||
$submission->created_at->timezone(config('app.timezone'))->format('d.m.Y H:i'),
|
||||
...($anonymous ? [] : [$submission->user?->name ?? '', $submission->user?->email ?? '']),
|
||||
...array_map(fn ($key) => self::cell($submission->display($key)), array_keys($known)),
|
||||
], ';', '"', '');
|
||||
}
|
||||
});
|
||||
|
||||
fclose($out);
|
||||
}, Str::slug($form->title).'-'.now()->format('Y-m-d').'.csv', ['Content-Type' => 'text/csv; charset=UTF-8']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Schutz vor Formel-Einschleusung in Tabellenprogrammen.
|
||||
*/
|
||||
private static function cell(string $value): string
|
||||
{
|
||||
return preg_match('/^[=+\-@\t\r]/', $value) ? "'".$value : $value;
|
||||
}
|
||||
}
|
||||
54
plugins-core/forms/src/Mail/FormSubmitted.php
Normal file
54
plugins-core/forms/src/Mail/FormSubmitted.php
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
<?php
|
||||
|
||||
namespace Inhaus\Plugins\Forms\Mail;
|
||||
|
||||
use App\Models\User;
|
||||
use App\Support\Branding;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Mail\Mailables\Content;
|
||||
use Illuminate\Mail\Mailables\Envelope;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Inhaus\Plugins\Forms\Models\Form;
|
||||
use Inhaus\Plugins\Forms\Models\FormSubmission;
|
||||
|
||||
/**
|
||||
* Benachrichtigung über eine Einsendung – an die Empfänger des Formulars oder
|
||||
* als Kopie an die Person selbst. Dateien werden nicht angehängt, sondern nur
|
||||
* nach Anmeldung abrufbar verlinkt.
|
||||
*/
|
||||
class FormSubmitted extends Mailable implements ShouldQueue
|
||||
{
|
||||
use Queueable;
|
||||
use SerializesModels;
|
||||
|
||||
public function __construct(
|
||||
public Form $form,
|
||||
public FormSubmission $submission,
|
||||
public ?User $person,
|
||||
public bool $copy,
|
||||
) {}
|
||||
|
||||
public function envelope(): Envelope
|
||||
{
|
||||
return new Envelope(
|
||||
subject: ($this->copy ? 'Ihre Angaben: ' : 'Neue Einsendung: ').$this->form->title,
|
||||
replyTo: ! $this->copy && $this->person ? [$this->person->email] : [],
|
||||
);
|
||||
}
|
||||
|
||||
public function content(): Content
|
||||
{
|
||||
$includeAnswers = $this->copy || $this->form->setting('mail_answers', true);
|
||||
|
||||
return new Content(view: 'forms::mail.submitted', with: [
|
||||
'portalName' => app(Branding::class)->portalName(),
|
||||
'answers' => $includeAnswers ? collect($this->submission->data)->map(fn ($answer, $key) => [
|
||||
'label' => $answer['label'],
|
||||
'value' => $this->submission->display($key),
|
||||
])->values()->all() : null,
|
||||
'resultsUrl' => $this->copy ? null : url('/admin/formulare/'.$this->form->id.'/ergebnisse'),
|
||||
]);
|
||||
}
|
||||
}
|
||||
116
plugins-core/forms/src/Models/Form.php
Normal file
116
plugins-core/forms/src/Models/Form.php
Normal file
|
|
@ -0,0 +1,116 @@
|
|||
<?php
|
||||
|
||||
namespace Inhaus\Plugins\Forms\Models;
|
||||
|
||||
use App\Models\User;
|
||||
use App\Support\Permissions\Audiences;
|
||||
use Illuminate\Database\Eloquent\Attributes\Fillable;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Support\Str;
|
||||
use Inhaus\Plugins\Forms\FormFields;
|
||||
|
||||
/**
|
||||
* Ein Formular. „fields“ ist die Liste der Felder aus dem Formularbaukasten
|
||||
* (siehe FormFields), „settings“ Benachrichtigung, Anonymität, Löschfrist u. a.
|
||||
*/
|
||||
#[Fillable(['title', 'slug', 'description', 'fields', 'settings', 'is_open', 'closes_at', 'created_by'])]
|
||||
class Form extends Model
|
||||
{
|
||||
protected static function booted(): void
|
||||
{
|
||||
static::saving(function (Form $form) {
|
||||
if (blank($form->slug)) {
|
||||
$base = Str::slug($form->title, language: 'de') ?: 'formular';
|
||||
$slug = $base;
|
||||
|
||||
for ($i = 2; static::query()->where('slug', $slug)->whereKeyNot($form->id)->exists(); $i++) {
|
||||
$slug = "{$base}-{$i}";
|
||||
}
|
||||
|
||||
$form->slug = $slug;
|
||||
}
|
||||
|
||||
$form->fields = FormFields::normalize((array) $form->fields);
|
||||
});
|
||||
|
||||
static::deleting(fn (Form $form) => $form->submissions()->with('files')->get()->each->delete());
|
||||
}
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'fields' => 'array',
|
||||
'settings' => 'array',
|
||||
'is_open' => 'boolean',
|
||||
'closes_at' => 'datetime',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array{0: string, 1: int}
|
||||
*/
|
||||
public function permissionResource(): array
|
||||
{
|
||||
return ['form', $this->id];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return HasMany<FormSubmission, $this>
|
||||
*/
|
||||
public function submissions(): HasMany
|
||||
{
|
||||
return $this->hasMany(FormSubmission::class);
|
||||
}
|
||||
|
||||
public function setting(string $key, mixed $default = null): mixed
|
||||
{
|
||||
return $this->settings[$key] ?? $default;
|
||||
}
|
||||
|
||||
public function isAnonymous(): bool
|
||||
{
|
||||
return (bool) $this->setting('anonymous', false);
|
||||
}
|
||||
|
||||
public function acceptsSubmissions(): bool
|
||||
{
|
||||
return $this->is_open && ($this->closes_at === null || $this->closes_at->isFuture());
|
||||
}
|
||||
|
||||
public function url(): string
|
||||
{
|
||||
return '/formulare/'.$this->slug;
|
||||
}
|
||||
|
||||
/**
|
||||
* Kennung für „nur einmal ausfüllen“, ohne bei anonymen Formularen die Person zu speichern.
|
||||
*/
|
||||
public function userHash(User $user): string
|
||||
{
|
||||
return hash_hmac('sha256', $this->id.':'.$user->id, (string) config('app.key'));
|
||||
}
|
||||
|
||||
public function alreadySubmittedBy(User $user): bool
|
||||
{
|
||||
return $this->submissions()
|
||||
->where(fn ($q) => $q->where('user_hash', $this->userHash($user))->orWhere('user_id', $user->id))
|
||||
->exists();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Builder<Form> $query
|
||||
*/
|
||||
public function scopeVisibleTo(Builder $query, ?User $user): void
|
||||
{
|
||||
if (! $user?->can('forms.manage')) {
|
||||
Audiences::constrain($query, 'form', 'forms.id', $user);
|
||||
}
|
||||
}
|
||||
|
||||
public function isVisibleTo(?User $user): bool
|
||||
{
|
||||
return $user?->can('forms.manage') || Audiences::allows('form', $this->id, $user);
|
||||
}
|
||||
}
|
||||
36
plugins-core/forms/src/Models/FormFile.php
Normal file
36
plugins-core/forms/src/Models/FormFile.php
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
|
||||
namespace Inhaus\Plugins\Forms\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Attributes\Fillable;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
/**
|
||||
* Hochgeladene Datei zu einem Formular. Liegt außerhalb von public/; ausgeliefert
|
||||
* nur an Personen mit Zugriff auf die Ergebnisse des Formulars.
|
||||
*/
|
||||
#[Fillable(['submission_id', 'field', 'name', 'path', 'mime', 'size'])]
|
||||
class FormFile extends Model
|
||||
{
|
||||
public const DISK = 'local';
|
||||
|
||||
protected static function booted(): void
|
||||
{
|
||||
static::deleted(fn (FormFile $file) => Storage::disk(self::DISK)->delete($file->path));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return BelongsTo<FormSubmission, $this>
|
||||
*/
|
||||
public function submission(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(FormSubmission::class, 'submission_id');
|
||||
}
|
||||
|
||||
public function url(): string
|
||||
{
|
||||
return route('forms.file', $this);
|
||||
}
|
||||
}
|
||||
74
plugins-core/forms/src/Models/FormSubmission.php
Normal file
74
plugins-core/forms/src/Models/FormSubmission.php
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
<?php
|
||||
|
||||
namespace Inhaus\Plugins\Forms\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\HasMany;
|
||||
use Illuminate\Support\Carbon;
|
||||
|
||||
/**
|
||||
* Ein ausgefülltes Formular. „data“ enthält je Feld Bezeichnung, Typ und Wert –
|
||||
* so bleiben Ergebnisse lesbar, auch wenn das Formular später geändert wird.
|
||||
*/
|
||||
#[Fillable(['form_id', 'user_id', 'user_hash', 'data', 'read_at'])]
|
||||
class FormSubmission extends Model
|
||||
{
|
||||
protected static function booted(): void
|
||||
{
|
||||
static::deleting(fn (FormSubmission $submission) => $submission->files->each->delete());
|
||||
}
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return ['data' => 'array', 'read_at' => 'datetime'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return BelongsTo<Form, $this>
|
||||
*/
|
||||
public function form(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Form::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return HasMany<FormFile, $this>
|
||||
*/
|
||||
public function files(): HasMany
|
||||
{
|
||||
return $this->hasMany(FormFile::class, 'submission_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Wert als Text (Listen mit Komma, Ja/Nein, Dateinamen).
|
||||
*/
|
||||
public function display(string $key): string
|
||||
{
|
||||
$answer = $this->data[$key] ?? null;
|
||||
|
||||
if ($answer === null) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$value = $answer['value'] ?? null;
|
||||
|
||||
return match (true) {
|
||||
($answer['type'] ?? null) === 'checkbox' => $value ? 'Ja' : 'Nein',
|
||||
($answer['type'] ?? null) === 'file' => implode(', ', array_column((array) $value, 'name')),
|
||||
($answer['type'] ?? null) === 'date' && is_string($value) && preg_match('/^\d{4}-\d{2}-\d{2}$/', $value) => Carbon::parse($value)->format('d.m.Y'),
|
||||
is_array($value) => implode(', ', $value),
|
||||
default => (string) $value,
|
||||
};
|
||||
}
|
||||
}
|
||||
53
plugins-core/forms/src/Policies/FormPolicy.php
Normal file
53
plugins-core/forms/src/Policies/FormPolicy.php
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
<?php
|
||||
|
||||
namespace Inhaus\Plugins\Forms\Policies;
|
||||
|
||||
use App\Models\User;
|
||||
use Inhaus\Plugins\Forms\Models\Form;
|
||||
|
||||
/**
|
||||
* „Formulare verwalten“ gilt für alle Formulare. Je Formular vergibt man
|
||||
* „Bearbeiten“, „Ergebnisse ansehen“ und „Ergebnisse löschen“ an Rollen –
|
||||
* z. B. sieht nur die Personalabteilung die Anträge auf Fortbildung.
|
||||
*/
|
||||
class FormPolicy
|
||||
{
|
||||
public function viewAny(User $user): bool
|
||||
{
|
||||
$permissions = $user->permissions();
|
||||
|
||||
return $user->can('forms.manage')
|
||||
|| $permissions->ids('forms.edit', 'form') !== []
|
||||
|| $permissions->ids('forms.results', 'form') !== [];
|
||||
}
|
||||
|
||||
public function create(User $user): bool
|
||||
{
|
||||
return $user->can('forms.manage');
|
||||
}
|
||||
|
||||
public function update(User $user, Form $form): bool
|
||||
{
|
||||
return $user->can('forms.manage') || $user->can('forms.edit', ['form', $form->id]);
|
||||
}
|
||||
|
||||
public function delete(User $user, Form $form): bool
|
||||
{
|
||||
return $user->can('forms.manage');
|
||||
}
|
||||
|
||||
public function viewResults(User $user, Form $form): bool
|
||||
{
|
||||
return $user->can('forms.manage') || $user->can('forms.results', ['form', $form->id]);
|
||||
}
|
||||
|
||||
public function deleteResults(User $user, Form $form): bool
|
||||
{
|
||||
return $user->can('forms.manage') || $user->can('forms.results.delete', ['form', $form->id]);
|
||||
}
|
||||
|
||||
public function submit(User $user, Form $form): bool
|
||||
{
|
||||
return $form->acceptsSubmissions() && $form->isVisibleTo($user);
|
||||
}
|
||||
}
|
||||
32
plugins-core/forms/src/Retention.php
Normal file
32
plugins-core/forms/src/Retention.php
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
|
||||
namespace Inhaus\Plugins\Forms;
|
||||
|
||||
use Inhaus\Plugins\Forms\Models\Form;
|
||||
|
||||
/**
|
||||
* Löscht Einsendungen, deren Aufbewahrungsfrist abgelaufen ist (Einstellung je Formular).
|
||||
*/
|
||||
class Retention
|
||||
{
|
||||
public function purge(): int
|
||||
{
|
||||
$deleted = 0;
|
||||
|
||||
foreach (Form::query()->get() as $form) {
|
||||
$days = (int) $form->setting('retention_days', 0);
|
||||
|
||||
if ($days <= 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$form->submissions()->with('files')->where('created_at', '<', now()->subDays($days))
|
||||
->chunkById(100, function ($submissions) use (&$deleted) {
|
||||
$submissions->each->delete();
|
||||
$deleted += $submissions->count();
|
||||
});
|
||||
}
|
||||
|
||||
return $deleted;
|
||||
}
|
||||
}
|
||||
118
plugins-core/forms/src/Submissions.php
Normal file
118
plugins-core/forms/src/Submissions.php
Normal file
|
|
@ -0,0 +1,118 @@
|
|||
<?php
|
||||
|
||||
namespace Inhaus\Plugins\Forms;
|
||||
|
||||
use App\Models\User;
|
||||
use App\Notifications\PortalNotification;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
use Illuminate\Support\Facades\Notification;
|
||||
use Illuminate\Support\Str;
|
||||
use Inhaus\Plugins\Forms\Mail\FormSubmitted;
|
||||
use Inhaus\Plugins\Forms\Models\Form;
|
||||
use Inhaus\Plugins\Forms\Models\FormFile;
|
||||
use Inhaus\Plugins\Forms\Models\FormSubmission;
|
||||
use Throwable;
|
||||
|
||||
/**
|
||||
* Speichert eine Einsendung und verschickt die Benachrichtigungen.
|
||||
*/
|
||||
class Submissions
|
||||
{
|
||||
/**
|
||||
* @param array<string, mixed> $answers validierte Eingaben
|
||||
*/
|
||||
public function store(Form $form, User $user, array $answers): FormSubmission
|
||||
{
|
||||
[$data, $uploads] = FormFields::collect($form, $answers);
|
||||
$anonymous = $form->isAnonymous();
|
||||
|
||||
$submission = DB::transaction(function () use ($form, $user, $data, $uploads, $anonymous) {
|
||||
$submission = $form->submissions()->create([
|
||||
'user_id' => $anonymous ? null : $user->id,
|
||||
'user_hash' => $form->setting('once_per_user') ? $form->userHash($user) : null,
|
||||
'data' => $data,
|
||||
]);
|
||||
|
||||
foreach ($uploads as $key => $files) {
|
||||
$stored = [];
|
||||
|
||||
foreach ($files as $upload) {
|
||||
$name = Str::limit(preg_replace('/[^\pL\pN ._()\-]+/u', '_', $upload->getClientOriginalName()) ?: 'datei', 180, '');
|
||||
$file = $submission->files()->create([
|
||||
'field' => $key,
|
||||
'name' => $name,
|
||||
'path' => $upload->storeAs('forms/'.$form->id, Str::random(40).'.'.strtolower($upload->getClientOriginalExtension() ?: 'bin'), FormFile::DISK),
|
||||
'mime' => $upload->getMimeType(),
|
||||
'size' => $upload->getSize(),
|
||||
]);
|
||||
$stored[] = ['id' => $file->id, 'name' => $name, 'size' => $file->size];
|
||||
}
|
||||
|
||||
$data[$key]['value'] = $stored;
|
||||
}
|
||||
|
||||
$submission->update(['data' => $data]);
|
||||
|
||||
return $submission;
|
||||
});
|
||||
|
||||
$this->notify($form, $submission, $user);
|
||||
|
||||
return $submission;
|
||||
}
|
||||
|
||||
private function notify(Form $form, FormSubmission $submission, User $user): void
|
||||
{
|
||||
$recipients = collect((array) $form->setting('notify_emails', []))
|
||||
->map(fn ($email) => strtolower(trim((string) $email)))
|
||||
->filter(fn ($email) => filter_var($email, FILTER_VALIDATE_EMAIL));
|
||||
|
||||
$viewers = $form->setting('notify_viewers') ? $this->resultViewers($form) : collect();
|
||||
|
||||
try {
|
||||
foreach ($recipients->merge($viewers->pluck('email'))->unique() as $email) {
|
||||
Mail::to($email)->queue(new FormSubmitted($form, $submission, $form->isAnonymous() ? null : $user, copy: false));
|
||||
}
|
||||
|
||||
if ($form->setting('send_copy')) {
|
||||
Mail::to($user->email)->queue(new FormSubmitted($form, $submission, $user, copy: true));
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// Die Einsendung ist gespeichert – ein Versandfehler darf sie nicht verwerfen.
|
||||
Log::error("Formular {$form->id}: Benachrichtigung fehlgeschlagen: ".$e->getMessage());
|
||||
}
|
||||
|
||||
if ($viewers->isNotEmpty()) {
|
||||
Notification::send($viewers, new PortalNotification(
|
||||
'Neue Einsendung: '.$form->title,
|
||||
$form->isAnonymous() ? 'Anonyme Einsendung' : 'Von '.$user->name,
|
||||
route('filament.admin.resources.formulare.results', ['record' => $form]),
|
||||
'file-check',
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Personen mit Zugriff auf die Ergebnisse dieses Formulars.
|
||||
*
|
||||
* @return Collection<int, User>
|
||||
*/
|
||||
public function resultViewers(Form $form): Collection
|
||||
{
|
||||
$roleIds = DB::table('grants')
|
||||
->where(function ($q) use ($form) {
|
||||
$q->whereIn('ability', ['*', 'forms.manage'])->whereNull('resource_type');
|
||||
$q->orWhere(fn ($q) => $q->where('ability', 'forms.results')->where('resource_type', 'form')
|
||||
->where(fn ($q) => $q->whereNull('resource_id')->orWhere('resource_id', $form->id)));
|
||||
})
|
||||
->pluck('role_id');
|
||||
|
||||
return User::query()->active()
|
||||
->whereIn('id', DB::table('role_user')->whereIn('role_id', $roleIds)->select('user_id'))
|
||||
->limit(100)
|
||||
->get();
|
||||
}
|
||||
}
|
||||
|
|
@ -16,6 +16,7 @@ class PageRevision extends Model
|
|||
'published' => 'Veröffentlicht',
|
||||
'scheduled' => 'Zeitgesteuert veröffentlicht',
|
||||
'restored' => 'Wiederhergestellt',
|
||||
'imported' => 'Importiert',
|
||||
];
|
||||
|
||||
protected function casts(): array
|
||||
|
|
|
|||
|
|
@ -0,0 +1,60 @@
|
|||
<?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
|
||||
{
|
||||
Schema::create('wp_imports', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('user_id')->nullable()->constrained('users')->nullOnDelete();
|
||||
$table->string('file');
|
||||
$table->string('site_title')->nullable();
|
||||
$table->string('site_url')->nullable();
|
||||
// analyzed → running → done (oder failed)
|
||||
$table->string('status', 20)->default('analyzed');
|
||||
$table->json('options')->nullable();
|
||||
$table->json('stats')->nullable();
|
||||
$table->longText('log')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
// Zwischenablage der Exportdatei: je Eintrag eine Zeile, abgearbeitet in Portionen.
|
||||
Schema::create('wp_import_items', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('import_id')->constrained('wp_imports')->cascadeOnDelete();
|
||||
$table->string('type', 20); // category, author, attachment, post, page
|
||||
$table->unsignedBigInteger('wp_id')->default(0);
|
||||
$table->unsignedBigInteger('wp_parent')->default(0);
|
||||
$table->string('status', 12)->default('pending'); // pending, done, skipped, failed
|
||||
$table->longText('data');
|
||||
$table->string('message', 500)->nullable();
|
||||
|
||||
$table->index(['import_id', 'type', 'status']);
|
||||
$table->index(['import_id', 'type', 'wp_id']);
|
||||
});
|
||||
|
||||
// Was schon übernommen wurde – ein erneuter Import legt nichts doppelt an.
|
||||
Schema::create('wp_import_refs', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('source', 191);
|
||||
$table->string('type', 20); // post, page, category, media
|
||||
$table->string('wp_key', 191);
|
||||
$table->string('local_type', 60);
|
||||
$table->string('local_value', 500);
|
||||
$table->timestamps();
|
||||
|
||||
$table->unique(['source', 'type', 'wp_key']);
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('wp_import_refs');
|
||||
Schema::dropIfExists('wp_import_items');
|
||||
Schema::dropIfExists('wp_imports');
|
||||
}
|
||||
};
|
||||
14
plugins-core/wordpress-import/plugin.json
Normal file
14
plugins-core/wordpress-import/plugin.json
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"slug": "wordpress-import",
|
||||
"name": "WordPress-Import",
|
||||
"version": "1.0.0",
|
||||
"description": "Übernimmt Beiträge, Kategorien, Bilder und Seiten aus einer WordPress-Exportdatei – für den Umstieg auf das Portal.",
|
||||
"author": "Inhaus",
|
||||
"namespace": "Inhaus\\Plugins\\WordpressImport\\",
|
||||
"class": "Inhaus\\Plugins\\WordpressImport\\WordpressImportPlugin",
|
||||
"requires": {
|
||||
"core": ">=0.6.0",
|
||||
"php": ">=8.3",
|
||||
"plugins": ["news"]
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,79 @@
|
|||
@php($import = $this->getImport())
|
||||
<x-filament-panels::page>
|
||||
@if (! $import)
|
||||
<form wire:submit="analyze" class="grid gap-6">
|
||||
{{ $this->uploadForm }}
|
||||
<div>
|
||||
<x-filament::button type="submit" icon="heroicon-o-magnifying-glass">Datei prüfen</x-filament::button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@if ($this->history()->isNotEmpty())
|
||||
<x-filament::section heading="Bisherige Importe">
|
||||
<ul class="divide-y divide-gray-100 text-sm dark:divide-white/5">
|
||||
@foreach ($this->history() as $past)
|
||||
<li class="flex flex-wrap justify-between gap-2 py-2">
|
||||
<span>{{ $past->site_title ?: $past->site_url }} · {{ $past->created_at->format('d.m.Y H:i') }}</span>
|
||||
<span class="text-gray-500">
|
||||
{{ $past->status === 'done' ? 'abgeschlossen' : 'abgebrochen' }}:
|
||||
{{ $past->stats['created'] ?? 0 }} neu, {{ $past->stats['updated'] ?? 0 }} aktualisiert, {{ $past->stats['skipped'] ?? 0 }} übersprungen, {{ $past->stats['failed'] ?? 0 }} Fehler
|
||||
</span>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</x-filament::section>
|
||||
@endif
|
||||
@elseif ($import->status === 'analyzed')
|
||||
@php($found = $import->stats['found'] ?? [])
|
||||
<x-filament::section :heading="'Gefunden in „'.($import->site_title ?: 'WordPress').'“'" :description="$import->site_url">
|
||||
<dl class="grid grid-cols-2 gap-4 text-sm sm:grid-cols-5">
|
||||
@foreach (['post' => 'Beiträge', 'page' => 'Seiten', 'category' => 'Kategorien', 'author' => 'Autor:innen', 'attachment' => 'Medien'] as $key => $label)
|
||||
<div class="rounded-lg bg-gray-50 p-3 dark:bg-white/5">
|
||||
<dt class="text-gray-500">{{ $label }}</dt>
|
||||
<dd class="text-2xl font-semibold">{{ $found[$key] ?? 0 }}</dd>
|
||||
</div>
|
||||
@endforeach
|
||||
</dl>
|
||||
@if (($found['drafts'] ?? 0) > 0)
|
||||
<p class="mt-3 text-sm text-gray-500">Davon {{ $found['drafts'] }} Entwürfe. Kommentare, Schlagwörter und Einträge anderer Plugins werden nicht übernommen.</p>
|
||||
@endif
|
||||
</x-filament::section>
|
||||
|
||||
<form wire:submit="start" class="grid gap-6">
|
||||
{{ $this->optionsForm }}
|
||||
<div class="flex gap-3">
|
||||
<x-filament::button type="submit" icon="heroicon-o-arrow-down-tray">Import starten</x-filament::button>
|
||||
<x-filament::button color="gray" wire:click="discard" type="button">Verwerfen</x-filament::button>
|
||||
</div>
|
||||
</form>
|
||||
@else
|
||||
@php($stats = $import->stats ?? [])
|
||||
<x-filament::section :heading="$import->status === 'running' ? 'Import läuft …' : ($import->status === 'done' ? 'Import abgeschlossen' : 'Import abgebrochen')">
|
||||
<div @if ($import->status === 'running') wire:poll.750ms="step" @endif class="grid gap-4">
|
||||
<div class="h-2 overflow-hidden rounded-full bg-gray-100 dark:bg-white/10">
|
||||
<div class="h-full bg-primary-600 transition-all" style="width: {{ $import->progress() }}%"></div>
|
||||
</div>
|
||||
<p class="text-sm">
|
||||
{{ $stats['processed'] ?? 0 }} von {{ $stats['total'] ?? 0 }} Einträgen ·
|
||||
{{ $stats['created'] ?? 0 }} neu · {{ $stats['updated'] ?? 0 }} aktualisiert ·
|
||||
{{ $stats['skipped'] ?? 0 }} übersprungen · {{ $stats['failed'] ?? 0 }} Fehler
|
||||
</p>
|
||||
@if ($import->status === 'running')
|
||||
<p class="text-sm text-gray-500">Bitte die Seite geöffnet lassen – der Import läuft in Portionen weiter.</p>
|
||||
<div><x-filament::button color="gray" wire:click="cancel" size="sm">Abbrechen</x-filament::button></div>
|
||||
@else
|
||||
<div class="flex gap-3">
|
||||
<x-filament::button tag="a" href="/admin/neuigkeiten" icon="heroicon-o-newspaper">Zu den Neuigkeiten</x-filament::button>
|
||||
<x-filament::button color="gray" wire:click="discard">Neuer Import</x-filament::button>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</x-filament::section>
|
||||
|
||||
@if ($import->log)
|
||||
<x-filament::section heading="Protokoll" collapsible>
|
||||
<pre class="max-h-96 overflow-y-auto text-xs whitespace-pre-wrap">{{ $import->log }}</pre>
|
||||
</x-filament::section>
|
||||
@endif
|
||||
@endif
|
||||
</x-filament-panels::page>
|
||||
85
plugins-core/wordpress-import/src/Analyzer.php
Normal file
85
plugins-core/wordpress-import/src/Analyzer.php
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
<?php
|
||||
|
||||
namespace Inhaus\Plugins\WordpressImport;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Inhaus\Plugins\WordpressImport\Models\WpImport;
|
||||
|
||||
/**
|
||||
* Erster Schritt: Exportdatei einlesen und in die Zwischenablage schreiben.
|
||||
* Danach zeigt die Admin-Seite, was gefunden wurde, und fragt die Optionen ab.
|
||||
*/
|
||||
class Analyzer
|
||||
{
|
||||
public function __construct(private readonly WxrReader $reader) {}
|
||||
|
||||
public function analyze(string $file, User $user): WpImport
|
||||
{
|
||||
@set_time_limit(300);
|
||||
|
||||
$import = WpImport::query()->create(['user_id' => $user->id, 'file' => $file, 'status' => 'analyzing']);
|
||||
$buffer = [];
|
||||
$counts = ['post' => 0, 'page' => 0, 'attachment' => 0, 'category' => 0, 'author' => 0, 'other' => 0, 'drafts' => 0];
|
||||
|
||||
$flush = function () use (&$buffer) {
|
||||
if ($buffer !== []) {
|
||||
DB::table('wp_import_items')->insert($buffer);
|
||||
$buffer = [];
|
||||
}
|
||||
};
|
||||
|
||||
try {
|
||||
$this->reader->read($file, function (string $kind, array $data) use ($import, &$buffer, &$counts, $flush) {
|
||||
if ($kind === 'site') {
|
||||
$import->forceFill(['site_title' => $data['title'], 'site_url' => $data['url']]);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$type = $kind === 'item' ? $data['type'] : $kind;
|
||||
|
||||
if ($kind === 'item' && ! in_array($type, ['post', 'page', 'attachment'], true)) {
|
||||
$counts['other']++;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if ($kind === 'item' && in_array($data['status'], ['auto-draft', 'inherit', 'trash'], true) && $type !== 'attachment') {
|
||||
return;
|
||||
}
|
||||
|
||||
$counts[$type]++;
|
||||
|
||||
if (in_array($type, ['post', 'page'], true) && in_array($data['status'], ['draft', 'pending'], true)) {
|
||||
$counts['drafts']++;
|
||||
}
|
||||
|
||||
$buffer[] = [
|
||||
'import_id' => $import->id,
|
||||
'type' => $type,
|
||||
'wp_id' => (int) ($data['wp_id'] ?? 0),
|
||||
'wp_parent' => (int) ($data['parent'] ?? 0),
|
||||
// Anhänge werden nicht importiert, nur ihre Adressen gebraucht (Beitragsbilder).
|
||||
'status' => $type === 'attachment' ? 'skipped' : 'pending',
|
||||
'data' => json_encode($data, JSON_UNESCAPED_UNICODE | JSON_INVALID_UTF8_SUBSTITUTE),
|
||||
];
|
||||
|
||||
if (count($buffer) >= 100) {
|
||||
$flush();
|
||||
}
|
||||
});
|
||||
|
||||
$flush();
|
||||
} catch (\Throwable $e) {
|
||||
$import->items()->delete();
|
||||
$import->delete();
|
||||
|
||||
throw $e;
|
||||
}
|
||||
|
||||
$import->forceFill(['status' => 'analyzed', 'stats' => ['found' => $counts]])->save();
|
||||
|
||||
return $import;
|
||||
}
|
||||
}
|
||||
179
plugins-core/wordpress-import/src/ContentConverter.php
Normal file
179
plugins-core/wordpress-import/src/ContentConverter.php
Normal file
|
|
@ -0,0 +1,179 @@
|
|||
<?php
|
||||
|
||||
namespace Inhaus\Plugins\WordpressImport;
|
||||
|
||||
use DOMDocument;
|
||||
use DOMElement;
|
||||
use DOMXPath;
|
||||
|
||||
/**
|
||||
* Wandelt WordPress-Inhalte (klassischer Editor oder Gutenberg) in schlichtes
|
||||
* HTML für das Portal: Absätze, Bildunterschriften, Galerien, Shortcodes und
|
||||
* Bilder (auf Wunsch ins Portal kopiert). Bereinigt wird danach wie immer.
|
||||
*/
|
||||
class ContentConverter
|
||||
{
|
||||
private const BLOCK_TAGS = 'p|div|h[1-6]|ul|ol|li|table|thead|tbody|tr|td|th|blockquote|figure|figcaption|pre|hr|iframe|section|dl|dt|dd|address|form|video|audio';
|
||||
|
||||
/**
|
||||
* @param callable(string): ?string $image alte Bildadresse => neue (null = Bild weglassen)
|
||||
* @param array<int, string> $attachments Anhang-ID => Adresse (für [gallery])
|
||||
*/
|
||||
public function convert(string $content, callable $image, array $attachments = []): string
|
||||
{
|
||||
$html = str_replace(["\r\n", "\r"], "\n", $content);
|
||||
$gutenberg = str_contains($html, '<!-- wp:');
|
||||
|
||||
// Skripte und Stile samt Inhalt entfernen – sie sollen auch nicht als Text übrig bleiben.
|
||||
$html = preg_replace('#<(script|style|noscript)\b[^>]*>.*?</\1>#is', '', $html) ?? $html;
|
||||
|
||||
// Gutenberg-Markierungen entfernen, der HTML-Inhalt bleibt.
|
||||
$html = preg_replace('/<!--\s*\/?wp:.*?-->/s', '', $html) ?? $html;
|
||||
$html = $this->shortcodes($html, $attachments);
|
||||
|
||||
if (! $gutenberg) {
|
||||
$html = $this->autop($html);
|
||||
}
|
||||
|
||||
return $this->rewriteImages($html, $image);
|
||||
}
|
||||
|
||||
/**
|
||||
* Kurzer Anreißer aus Auszug oder Text.
|
||||
*/
|
||||
public function teaser(string $excerpt, string $html, int $length = 280): string
|
||||
{
|
||||
$text = trim(preg_replace('/\s+/u', ' ', html_entity_decode(strip_tags($excerpt !== '' ? $excerpt : $html), ENT_QUOTES)) ?? '');
|
||||
|
||||
if (mb_strlen($text) <= $length) {
|
||||
return $text;
|
||||
}
|
||||
|
||||
$cut = mb_substr($text, 0, $length);
|
||||
|
||||
return rtrim(mb_substr($cut, 0, (int) (mb_strrpos($cut, ' ') ?: $length)), ' ,.;:–-').' …';
|
||||
}
|
||||
|
||||
/**
|
||||
* Vereinfachtes wpautop(): Leerzeilen trennen Absätze, einfache Umbrüche werden <br>.
|
||||
*/
|
||||
private function autop(string $html): string
|
||||
{
|
||||
$chunks = preg_split('/\n\s*\n/', trim($html)) ?: [];
|
||||
|
||||
return implode("\n", array_map(function (string $chunk) {
|
||||
$chunk = trim($chunk);
|
||||
|
||||
if ($chunk === '') {
|
||||
return '';
|
||||
}
|
||||
|
||||
return preg_match('/^<('.self::BLOCK_TAGS.')\b/i', $chunk) ? $chunk : '<p>'.nl2br($chunk, false).'</p>';
|
||||
}, $chunks));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<int, string> $attachments
|
||||
*/
|
||||
private function shortcodes(string $html, array $attachments): string
|
||||
{
|
||||
// [caption]<img …> Text[/caption] → Bild und Unterschrift als eigener Absatz
|
||||
$html = preg_replace_callback('/\[caption[^\]]*\](.*?)\[\/caption\]/is', function ($m) {
|
||||
$inner = trim($m[1]);
|
||||
preg_match('/(<a[^>]*>\s*)?<img[^>]*>(\s*<\/a>)?/is', $inner, $img);
|
||||
$caption = trim(strip_tags(str_replace($img[0] ?? '', '', $inner)));
|
||||
|
||||
return "\n\n".($img[0] ?? '')."\n\n".($caption !== '' ? '<p><em>'.e($caption).'</em></p>' : '')."\n\n";
|
||||
}, $html) ?? $html;
|
||||
|
||||
// [gallery ids="1,2,3"] → Bilder untereinander
|
||||
$html = preg_replace_callback('/\[gallery[^\]]*\]/i', function ($m) use ($attachments) {
|
||||
if (! preg_match('/ids=["\']?([\d,\s]+)/', $m[0], $ids)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$images = array_filter(array_map(fn ($id) => $attachments[(int) trim($id)] ?? null, explode(',', $ids[1])));
|
||||
|
||||
return "\n\n".implode("\n\n", array_map(fn ($url) => '<p><img src="'.e($url).'" alt=""></p>', $images))."\n\n";
|
||||
}, $html) ?? $html;
|
||||
|
||||
// [embed]https://…[/embed] und alleinstehende Video-Links → Link
|
||||
$html = preg_replace('/\[embed[^\]]*\](.*?)\[\/embed\]/is', "\n\n<p><a href=\"$1\">$1</a></p>\n\n", $html) ?? $html;
|
||||
$html = preg_replace('/^\s*(https?:\/\/(www\.)?(youtube\.com|youtu\.be|vimeo\.com)\/\S+)\s*$/mi', '<p><a href="$1">$1</a></p>', $html) ?? $html;
|
||||
|
||||
// Übrige Shortcodes: Klammern entfernen, eingeschlossenen Text behalten.
|
||||
return preg_replace('/\[\/?[a-z][a-z0-9_-]*(?:\s[^\]]*)?\]/i', '', $html) ?? $html;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param callable(string): ?string $image
|
||||
*/
|
||||
private function rewriteImages(string $html, callable $image): string
|
||||
{
|
||||
if (! str_contains($html, '<img') && ! str_contains($html, '<figure')) {
|
||||
return $html;
|
||||
}
|
||||
|
||||
$dom = new DOMDocument;
|
||||
@$dom->loadHTML('<?xml encoding="utf-8"?><div id="wp-root">'.$html.'</div>', LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD | LIBXML_NONET);
|
||||
$xpath = new DOMXPath($dom);
|
||||
|
||||
// Gutenberg-Bilder: <figure><img><figcaption>…</figcaption></figure> → Bild + Unterschrift als Absatz
|
||||
foreach (iterator_to_array($xpath->query('//figure')) as $figure) {
|
||||
/** @var DOMElement $figure */
|
||||
$caption = $xpath->query('.//figcaption', $figure)->item(0);
|
||||
$paragraph = null;
|
||||
|
||||
if ($caption) {
|
||||
$paragraph = $dom->createElement('p');
|
||||
$em = $dom->createElement('em');
|
||||
$em->appendChild($dom->createTextNode(trim($caption->textContent)));
|
||||
$paragraph->appendChild($em);
|
||||
$caption->parentNode->removeChild($caption);
|
||||
}
|
||||
|
||||
while ($figure->firstChild) {
|
||||
$figure->parentNode->insertBefore($figure->firstChild, $figure);
|
||||
}
|
||||
|
||||
if ($paragraph) {
|
||||
$figure->parentNode->insertBefore($paragraph, $figure);
|
||||
}
|
||||
|
||||
$figure->parentNode->removeChild($figure);
|
||||
}
|
||||
|
||||
foreach (iterator_to_array($xpath->query('//img')) as $img) {
|
||||
/** @var DOMElement $img */
|
||||
$src = $img->getAttribute('src');
|
||||
$new = $src !== '' ? $image($src) : null;
|
||||
|
||||
// Verlinkung auf das Originalbild der alten Website entfernen.
|
||||
$link = $img->parentNode;
|
||||
if ($link instanceof DOMElement && $link->nodeName === 'a' && preg_match('/\.(jpe?g|png|gif|webp)(\?.*)?$/i', $link->getAttribute('href'))) {
|
||||
$link->parentNode->replaceChild($img, $link);
|
||||
}
|
||||
|
||||
if ($new === null) {
|
||||
$img->parentNode->removeChild($img);
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach (['srcset', 'sizes', 'class', 'width', 'height', 'style', 'loading', 'decoding'] as $attribute) {
|
||||
$img->removeAttribute($attribute);
|
||||
}
|
||||
|
||||
$img->setAttribute('src', $new);
|
||||
}
|
||||
|
||||
$root = $dom->getElementById('wp-root');
|
||||
$out = '';
|
||||
|
||||
foreach ($root->childNodes as $child) {
|
||||
$out .= $dom->saveHTML($child);
|
||||
}
|
||||
|
||||
return $out;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,226 @@
|
|||
<?php
|
||||
|
||||
namespace Inhaus\Plugins\WordpressImport\Filament\Pages;
|
||||
|
||||
use App\Models\User;
|
||||
use BackedEnum;
|
||||
use Filament\Forms\Components\FileUpload;
|
||||
use Filament\Forms\Components\Select;
|
||||
use Filament\Forms\Components\Toggle;
|
||||
use Filament\Notifications\Notification;
|
||||
use Filament\Pages\Page;
|
||||
use Filament\Schemas\Components\Section;
|
||||
use Filament\Schemas\Schema;
|
||||
use Filament\Support\Icons\Heroicon;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Inhaus\Plugins\News\Models\NewsCategory;
|
||||
use Inhaus\Plugins\Pages\PageTree;
|
||||
use Inhaus\Plugins\WordpressImport\Analyzer;
|
||||
use Inhaus\Plugins\WordpressImport\Importer;
|
||||
use Inhaus\Plugins\WordpressImport\Models\WpImport;
|
||||
use Throwable;
|
||||
use UnitEnum;
|
||||
|
||||
/**
|
||||
* Umstieg von WordPress: Exportdatei hochladen, prüfen, Optionen wählen, importieren.
|
||||
*/
|
||||
class WordpressImport extends Page
|
||||
{
|
||||
protected string $view = 'wordpress-import::import';
|
||||
|
||||
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedArrowDownTray;
|
||||
|
||||
protected static string|UnitEnum|null $navigationGroup = 'Inhalte';
|
||||
|
||||
protected static ?int $navigationSort = 20;
|
||||
|
||||
protected static ?string $navigationLabel = 'WordPress-Import';
|
||||
|
||||
protected static ?string $title = 'WordPress-Import';
|
||||
|
||||
protected static ?string $slug = 'wordpress-import';
|
||||
|
||||
public ?int $importId = null;
|
||||
|
||||
/** @var array<string, mixed>|null */
|
||||
public ?array $upload = [];
|
||||
|
||||
/** @var array<string, mixed>|null */
|
||||
public ?array $options = [];
|
||||
|
||||
public static function canAccess(): bool
|
||||
{
|
||||
return auth()->user()?->can('news.manage') ?? false;
|
||||
}
|
||||
|
||||
public function mount(): void
|
||||
{
|
||||
// Laufenden oder zuletzt geprüften Import fortsetzen.
|
||||
$this->importId = WpImport::query()->whereIn('status', ['analyzed', 'running'])->latest('id')->value('id');
|
||||
$this->uploadForm->fill();
|
||||
$this->fillOptions();
|
||||
}
|
||||
|
||||
public function getImport(): ?WpImport
|
||||
{
|
||||
return $this->importId ? WpImport::query()->find($this->importId) : null;
|
||||
}
|
||||
|
||||
public function uploadForm(Schema $schema): Schema
|
||||
{
|
||||
return $schema->statePath('upload')->components([
|
||||
Section::make('Exportdatei hochladen')
|
||||
->description('In WordPress unter „Werkzeuge → Daten exportieren“ „Alle Inhalte“ wählen und die XML-Datei hier hochladen. Bilder werden anschließend direkt von der alten Website geladen – sie muss also noch erreichbar sein.')
|
||||
->schema([
|
||||
FileUpload::make('file')
|
||||
->hiddenLabel()
|
||||
->disk('local')
|
||||
->directory('wp-import')
|
||||
->acceptedFileTypes(['text/xml', 'application/xml', 'application/rss+xml'])
|
||||
->maxSize(256 * 1024)
|
||||
->required(),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
|
||||
public function optionsForm(Schema $schema): Schema
|
||||
{
|
||||
$import = $this->getImport();
|
||||
$categories = $import ? $import->items()->where('type', 'category')->get()->map(fn ($item) => $item->data) : collect();
|
||||
$authors = $import ? $import->items()->where('type', 'author')->get()->map(fn ($item) => $item->data) : collect();
|
||||
$existing = NewsCategory::query()->orderBy('name')->pluck('name', 'id')->all();
|
||||
|
||||
return $schema->statePath('options')->components([
|
||||
Section::make('Was übernommen wird')
|
||||
->columns(2)
|
||||
->schema([
|
||||
Toggle::make('include_drafts')->label('Auch Entwürfe übernehmen')->helperText('Veröffentlichte und geplante Beiträge werden immer übernommen.'),
|
||||
Toggle::make('download_images')->label('Bilder ins Portal kopieren')->helperText('Beitragsbilder und Bilder im Text. Sonst bleiben Bilder auf der alten Website verlinkt.'),
|
||||
Toggle::make('import_pages')->label('WordPress-Seiten als Seiten übernehmen')->visible(Importer::pagesAvailable())->live(),
|
||||
Toggle::make('publish_pages')->label('Seiten gleich veröffentlichen')->helperText('Sonst als Entwurf zum Durchsehen.')->visible(fn ($get) => Importer::pagesAvailable() && $get('import_pages')),
|
||||
Select::make('pages_parent')->label('Seiten unterhalb von')->placeholder('– oberste Ebene –')
|
||||
->options(fn () => Importer::pagesAvailable() ? app(PageTree::class)->options() : [])
|
||||
->visible(fn ($get) => Importer::pagesAvailable() && $get('import_pages')),
|
||||
Toggle::make('update_existing')->label('Bereits importierte Einträge aktualisieren')->helperText('Sonst werden sie bei einem erneuten Import übersprungen.'),
|
||||
]),
|
||||
Section::make('Kategorien')
|
||||
->description('Beiträge haben im Portal eine Kategorie – bei mehreren gilt die erste.')
|
||||
->columns(2)
|
||||
->visible($categories->isNotEmpty())
|
||||
->schema([
|
||||
...$categories->map(fn (array $c) => Select::make('categories.'.$c['slug'])
|
||||
->label($c['name'])
|
||||
->options(['auto' => 'Übernehmen (neu anlegen oder gleichnamige nutzen)', 'skip' => 'Nicht übernehmen'] + $existing)
|
||||
->native(false)
|
||||
->required())->all(),
|
||||
Select::make('default_category')->label('Kategorie für Beiträge ohne Kategorie')->options($existing)->placeholder('Ohne Kategorie'),
|
||||
]),
|
||||
Section::make('Autorinnen und Autoren')
|
||||
->description('Zuordnung über die E-Mail-Adresse. Wer im Portal nicht gefunden wird, erscheint als unten gewählte Person.')
|
||||
->columns(2)
|
||||
->schema([
|
||||
...$authors->map(fn (array $a) => Select::make('authors.'.$a['login'])
|
||||
->label($a['name'].' ('.$a['email'].')')
|
||||
->placeholder(User::query()->where('email', $a['email'])->exists() ? 'Gefunden über die E-Mail-Adresse' : 'Nicht gefunden – Ersatz verwenden')
|
||||
->searchable()
|
||||
->getSearchResultsUsing(fn (string $search) => User::query()->where('name', 'like', "%{$search}%")->orWhere('email', 'like', "%{$search}%")->limit(20)->pluck('name', 'id')->all())
|
||||
->getOptionLabelUsing(fn ($value) => User::query()->find($value)?->name))->all(),
|
||||
Select::make('fallback_author')->label('Ersatz')
|
||||
->searchable()
|
||||
->getSearchResultsUsing(fn (string $search) => User::query()->where('name', 'like', "%{$search}%")->orWhere('email', 'like', "%{$search}%")->limit(20)->pluck('name', 'id')->all())
|
||||
->getOptionLabelUsing(fn ($value) => User::query()->find($value)?->name)
|
||||
->required(),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
|
||||
protected function getForms(): array
|
||||
{
|
||||
return ['uploadForm', 'optionsForm'];
|
||||
}
|
||||
|
||||
public function analyze(Analyzer $analyzer): void
|
||||
{
|
||||
$state = $this->uploadForm->getState();
|
||||
$file = is_array($state['file']) ? reset($state['file']) : $state['file'];
|
||||
|
||||
try {
|
||||
$import = $analyzer->analyze(Storage::disk('local')->path($file), auth()->user());
|
||||
$import->update(['file' => $file]);
|
||||
|
||||
// Neu laden: Die Optionen hängen von den gefundenen Kategorien und Personen ab.
|
||||
$this->redirect(static::getUrl());
|
||||
} catch (Throwable $e) {
|
||||
Storage::disk('local')->delete($file);
|
||||
Notification::make()->danger()->title('Datei konnte nicht gelesen werden')->body($e->getMessage())->persistent()->send();
|
||||
}
|
||||
}
|
||||
|
||||
public function start(Importer $importer): void
|
||||
{
|
||||
$import = $this->getImport();
|
||||
abort_unless($import?->status === 'analyzed', 404);
|
||||
|
||||
$options = $this->optionsForm->getState();
|
||||
$options['categories'] = array_filter((array) ($options['categories'] ?? []));
|
||||
$options['authors'] = array_filter((array) ($options['authors'] ?? []));
|
||||
$importer->start($import, $options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Wird von der Seite im Sekundentakt aufgerufen, solange der Import läuft.
|
||||
*/
|
||||
public function step(Importer $importer): void
|
||||
{
|
||||
$import = $this->getImport();
|
||||
|
||||
if ($import?->status === 'running' && $importer->step($import)) {
|
||||
Notification::make()->success()->title('Import abgeschlossen')->send();
|
||||
}
|
||||
}
|
||||
|
||||
public function discard(): void
|
||||
{
|
||||
$import = $this->getImport();
|
||||
|
||||
if ($import && $import->status !== 'running') {
|
||||
Storage::disk('local')->delete($import->file);
|
||||
$import->status === 'analyzed' ? $import->delete() : null;
|
||||
}
|
||||
|
||||
$this->importId = null;
|
||||
$this->uploadForm->fill();
|
||||
}
|
||||
|
||||
public function cancel(): void
|
||||
{
|
||||
$import = $this->getImport();
|
||||
$import?->forceFill(['status' => 'failed'])->save();
|
||||
$import?->addLog('Abgebrochen.');
|
||||
$import?->save();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<int, WpImport>
|
||||
*/
|
||||
public function history()
|
||||
{
|
||||
return WpImport::query()->whereIn('status', ['done', 'failed'])->latest('id')->limit(10)->get();
|
||||
}
|
||||
|
||||
private function fillOptions(): void
|
||||
{
|
||||
$import = $this->getImport();
|
||||
|
||||
$this->optionsForm->fill([
|
||||
'include_drafts' => false,
|
||||
'download_images' => true,
|
||||
'import_pages' => false,
|
||||
'publish_pages' => true,
|
||||
'update_existing' => false,
|
||||
'fallback_author' => auth()->id(),
|
||||
'categories' => $import ? $import->items()->where('type', 'category')->get()->mapWithKeys(fn ($item) => [$item->data['slug'] => 'auto'])->all() : [],
|
||||
]);
|
||||
}
|
||||
}
|
||||
409
plugins-core/wordpress-import/src/Importer.php
Normal file
409
plugins-core/wordpress-import/src/Importer.php
Normal file
|
|
@ -0,0 +1,409 @@
|
|||
<?php
|
||||
|
||||
namespace Inhaus\Plugins\WordpressImport;
|
||||
|
||||
use App\Models\User;
|
||||
use App\Pagebuilder\Content;
|
||||
use App\Plugins\PluginManager;
|
||||
use App\Support\Audit;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Support\Str;
|
||||
use Inhaus\Plugins\News\Models\NewsCategory;
|
||||
use Inhaus\Plugins\News\Models\NewsPost;
|
||||
use Inhaus\Plugins\Pages\Models\Page;
|
||||
use Inhaus\Plugins\Pages\PageTree;
|
||||
use Inhaus\Plugins\WordpressImport\Models\WpImport;
|
||||
use Inhaus\Plugins\WordpressImport\Models\WpImportItem;
|
||||
use Throwable;
|
||||
|
||||
/**
|
||||
* Übernimmt die Einträge der Zwischenablage in Portionen: erst Kategorien,
|
||||
* dann Beiträge, dann Seiten (Eltern vor Kindern). Jeder Aufruf arbeitet
|
||||
* höchstens bis zur Frist und macht beim nächsten weiter – so passt der
|
||||
* Import auch in die Laufzeitgrenzen von Shared Hosting.
|
||||
*/
|
||||
class Importer
|
||||
{
|
||||
/** @var array<string, User|null> */
|
||||
private array $authors = [];
|
||||
|
||||
/** @var array<int, string>|null */
|
||||
private ?array $attachments = null;
|
||||
|
||||
public function __construct(
|
||||
private readonly ContentConverter $converter,
|
||||
private readonly MediaDownloader $media,
|
||||
) {}
|
||||
|
||||
public static function pagesAvailable(): bool
|
||||
{
|
||||
return app(PluginManager::class)->isLoaded('pages');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $options
|
||||
*/
|
||||
public function start(WpImport $import, array $options): void
|
||||
{
|
||||
$types = ['category', 'post', ...(($options['import_pages'] ?? false) && self::pagesAvailable() ? ['page'] : [])];
|
||||
|
||||
$import->items()->whereIn('type', ['post', 'page', 'category'])->whereNotIn('type', $types)->update(['status' => 'skipped', 'message' => 'Nicht ausgewählt']);
|
||||
|
||||
$import->forceFill([
|
||||
'status' => 'running',
|
||||
'options' => $options,
|
||||
'stats' => [
|
||||
...($import->stats ?? []),
|
||||
'total' => $import->items()->whereIn('type', $types)->where('status', 'pending')->count(),
|
||||
'processed' => 0,
|
||||
'created' => 0,
|
||||
'updated' => 0,
|
||||
'skipped' => 0,
|
||||
'failed' => 0,
|
||||
],
|
||||
])->save();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool true = fertig
|
||||
*/
|
||||
public function step(WpImport $import, float $seconds = 8.0): bool
|
||||
{
|
||||
if ($import->status !== 'running') {
|
||||
return true;
|
||||
}
|
||||
|
||||
@set_time_limit((int) ceil($seconds) + 30);
|
||||
$deadline = microtime(true) + $seconds;
|
||||
|
||||
foreach (['category', 'post', 'page'] as $type) {
|
||||
while (microtime(true) < $deadline) {
|
||||
$items = $type === 'page' ? $this->nextPages($import) : $import->items()->where('type', $type)->where('status', 'pending')->orderBy('id')->limit(10)->get();
|
||||
|
||||
if ($items->isEmpty()) {
|
||||
break;
|
||||
}
|
||||
|
||||
foreach ($items as $item) {
|
||||
$this->process($import, $item);
|
||||
|
||||
if (microtime(true) >= $deadline) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($import->items()->where('type', $type)->where('status', 'pending')->exists()) {
|
||||
$import->save();
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
$this->finish($import);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private function finish(WpImport $import): void
|
||||
{
|
||||
$import->status = 'done';
|
||||
$import->addLog('Import abgeschlossen.');
|
||||
$import->save();
|
||||
|
||||
if (self::pagesAvailable()) {
|
||||
PageTree::flush(true);
|
||||
}
|
||||
|
||||
// Die hochgeladene Exportdatei wird nicht mehr gebraucht.
|
||||
Storage::disk('local')->delete($import->file);
|
||||
Audit::log('wordpress.imported', ['import' => $import->id, 'stats' => $import->stats], $import->user_id);
|
||||
}
|
||||
|
||||
private function process(WpImport $import, WpImportItem $item): void
|
||||
{
|
||||
try {
|
||||
[$result, $message] = match ($item->type) {
|
||||
'category' => $this->category($import, $item->data),
|
||||
'post' => $this->post($import, $item->data),
|
||||
'page' => $this->page($import, $item->data),
|
||||
};
|
||||
} catch (Throwable $e) {
|
||||
report($e);
|
||||
[$result, $message] = ['failed', $e->getMessage()];
|
||||
}
|
||||
|
||||
$item->forceFill(['status' => $result === 'failed' ? 'failed' : ($result === 'skipped' ? 'skipped' : 'done'), 'message' => $message ? mb_substr($message, 0, 500) : null])->save();
|
||||
|
||||
$stats = $import->stats;
|
||||
$stats['processed'] = ($stats['processed'] ?? 0) + 1;
|
||||
$stats[$result] = ($stats[$result] ?? 0) + 1;
|
||||
$import->stats = $stats;
|
||||
|
||||
if ($message && in_array($result, ['failed', 'skipped'], true) && $item->type !== 'category') {
|
||||
$import->addLog(($result === 'failed' ? 'Fehler' : 'Übersprungen').': „'.($item->data['title'] ?? $item->wp_id).'“ – '.$message);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $data
|
||||
* @return array{0: string, 1: string|null}
|
||||
*/
|
||||
private function category(WpImport $import, array $data): array
|
||||
{
|
||||
$choice = $import->option('categories', [])[$data['slug']] ?? 'auto';
|
||||
|
||||
if ($choice === 'skip') {
|
||||
return ['skipped', null];
|
||||
}
|
||||
|
||||
if (is_numeric($choice) && NewsCategory::query()->whereKey($choice)->exists()) {
|
||||
$this->ref($import, 'category', $data['slug'], 'news_category', (string) $choice);
|
||||
|
||||
return ['updated', null];
|
||||
}
|
||||
|
||||
$slug = Str::slug($data['slug'] ?: $data['name'], language: 'de') ?: 'kategorie';
|
||||
$existing = NewsCategory::query()->where('slug', $slug)->orWhere('name', $data['name'])->first();
|
||||
|
||||
if ($existing) {
|
||||
$this->ref($import, 'category', $data['slug'], 'news_category', (string) $existing->id);
|
||||
|
||||
return ['updated', null];
|
||||
}
|
||||
|
||||
$category = NewsCategory::query()->create([
|
||||
'name' => mb_substr($data['name'] ?: $slug, 0, 60),
|
||||
'slug' => $slug,
|
||||
'sort' => (int) NewsCategory::query()->max('sort') + 1,
|
||||
]);
|
||||
$this->ref($import, 'category', $data['slug'], 'news_category', (string) $category->id);
|
||||
|
||||
return ['created', null];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $data
|
||||
* @return array{0: string, 1: string|null}
|
||||
*/
|
||||
private function post(WpImport $import, array $data): array
|
||||
{
|
||||
if ($reason = $this->statusProblem($import, $data['status'])) {
|
||||
return ['skipped', $reason];
|
||||
}
|
||||
|
||||
$existingId = $this->lookup($import, 'post', (string) $data['wp_id']);
|
||||
$post = $existingId ? NewsPost::query()->find($existingId) : null;
|
||||
|
||||
if ($post && ! $import->option('update_existing', false)) {
|
||||
return ['skipped', 'bereits importiert'];
|
||||
}
|
||||
|
||||
$post ??= new NewsPost;
|
||||
$html = $this->html($import, $data['content'], 'news/inline');
|
||||
|
||||
$post->fill([
|
||||
'title' => mb_substr($data['title'] !== '' ? $data['title'] : 'Ohne Titel', 0, 160),
|
||||
'teaser' => mb_substr($this->converter->teaser($data['excerpt'], $html), 0, 300) ?: null,
|
||||
'body' => $html,
|
||||
'category_id' => $this->categoryFor($import, $data['categories']),
|
||||
]);
|
||||
$post->author_id = $this->author($import, $data['creator'])?->id;
|
||||
|
||||
if (! $post->exists) {
|
||||
$slug = Str::slug(rawurldecode($data['slug']), language: 'de');
|
||||
$post->slug = $slug !== '' && ! NewsPost::query()->where('slug', $slug)->exists() ? $slug : NewsPost::uniqueSlug($post->title);
|
||||
}
|
||||
|
||||
[$status, $publishedAt] = $this->statusFor($data);
|
||||
$post->published_at = $publishedAt;
|
||||
$post->status = $status;
|
||||
|
||||
if ($import->option('download_images', true) && $data['thumbnail_id'] && ($url = $this->attachmentUrl($import, (int) $data['thumbnail_id']))) {
|
||||
$post->cover_path = $this->media->cover($import, $url) ?? $post->cover_path;
|
||||
}
|
||||
|
||||
$created = ! $post->exists;
|
||||
$post->save();
|
||||
|
||||
// save() leitet den Status aus published_at ab – Freigabe-Status erhalten.
|
||||
if ($status === NewsPost::PENDING) {
|
||||
$post->forceFill(['status' => NewsPost::PENDING, 'submitted_at' => now()])->saveQuietly();
|
||||
}
|
||||
|
||||
$this->ref($import, 'post', (string) $data['wp_id'], 'news_post', (string) $post->id);
|
||||
|
||||
return [$created ? 'created' : 'updated', null];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $data
|
||||
* @return array{0: string, 1: string|null}
|
||||
*/
|
||||
private function page(WpImport $import, array $data): array
|
||||
{
|
||||
if ($reason = $this->statusProblem($import, $data['status'])) {
|
||||
return ['skipped', $reason];
|
||||
}
|
||||
|
||||
$existingId = $this->lookup($import, 'page', (string) $data['wp_id']);
|
||||
$page = $existingId ? Page::query()->find($existingId) : null;
|
||||
|
||||
if ($page && ! $import->option('update_existing', false)) {
|
||||
return ['skipped', 'bereits importiert'];
|
||||
}
|
||||
|
||||
$title = mb_substr($data['title'] !== '' ? $data['title'] : 'Ohne Titel', 0, 200);
|
||||
$html = $this->html($import, $data['content'], 'pagebuilder/imported');
|
||||
$content = app(Content::class)->sanitize(['blocks' => $html === '' ? [] : [['type' => 'text', 'data' => ['html' => $html]]]]);
|
||||
$user = $this->author($import, $data['creator']);
|
||||
$created = $page === null;
|
||||
|
||||
if (! $page) {
|
||||
$parentId = $data['parent'] ? $this->lookup($import, 'page', (string) $data['parent']) : null;
|
||||
$page = Page::query()->create([
|
||||
'title' => $title,
|
||||
'slug' => Str::slug(rawurldecode($data['slug']), language: 'de') ?: null,
|
||||
'parent_id' => $parentId ? (int) $parentId : ($import->option('pages_parent') ?: null),
|
||||
'sort' => (int) $data['menu_order'],
|
||||
'created_by' => $user?->id,
|
||||
]);
|
||||
}
|
||||
|
||||
if ($data['status'] === 'publish' && $import->option('publish_pages', true)) {
|
||||
$page->publish($title, $content, $user, 'imported');
|
||||
} else {
|
||||
$page->forceFill(['draft_title' => $title, 'draft' => $content, 'draft_updated_at' => now(), 'draft_updated_by' => $user?->id])->save();
|
||||
}
|
||||
|
||||
$this->ref($import, 'page', (string) $data['wp_id'], 'page', (string) $page->id);
|
||||
|
||||
return [$created ? 'created' : 'updated', null];
|
||||
}
|
||||
|
||||
/**
|
||||
* Seiten in einer Reihenfolge, in der übergeordnete Seiten zuerst kommen.
|
||||
*
|
||||
* @return Collection<int, WpImportItem>
|
||||
*/
|
||||
private function nextPages(WpImport $import)
|
||||
{
|
||||
$pending = $import->items()->where('type', 'page')->where('status', 'pending')->get(['id', 'wp_id', 'wp_parent']);
|
||||
|
||||
if ($pending->isEmpty()) {
|
||||
return collect();
|
||||
}
|
||||
|
||||
$pendingIds = $pending->pluck('wp_id')->all();
|
||||
$ready = $pending->filter(fn ($item) => $item->wp_parent === 0 || ! in_array($item->wp_parent, $pendingIds, true))->take(10);
|
||||
|
||||
// Zirkelbezug (sollte nicht vorkommen): dann eben ohne Reihenfolge.
|
||||
$ids = ($ready->isNotEmpty() ? $ready : $pending->take(10))->pluck('id');
|
||||
|
||||
return WpImportItem::query()->whereIn('id', $ids)->orderBy('id')->get();
|
||||
}
|
||||
|
||||
private function statusProblem(WpImport $import, string $status): ?string
|
||||
{
|
||||
return match ($status) {
|
||||
'publish', 'future' => null,
|
||||
'draft', 'pending' => $import->option('include_drafts', false) ? null : 'Entwurf (nicht ausgewählt)',
|
||||
'private' => 'privater Eintrag',
|
||||
default => 'Status „'.$status.'“',
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $data
|
||||
* @return array{0: string, 1: Carbon|null}
|
||||
*/
|
||||
private function statusFor(array $data): array
|
||||
{
|
||||
$gmt = $data['date_gmt'] && ! str_starts_with($data['date_gmt'], '0000') ? Carbon::parse($data['date_gmt'], 'UTC') : null;
|
||||
$date = $gmt ?? ($data['date'] && ! str_starts_with($data['date'], '0000') ? Carbon::parse($data['date']) : now());
|
||||
|
||||
return match ($data['status']) {
|
||||
'publish', 'future' => [NewsPost::PUBLISHED, $date],
|
||||
'pending' => [NewsPost::PENDING, null],
|
||||
default => [NewsPost::DRAFT, null],
|
||||
};
|
||||
}
|
||||
|
||||
private function html(WpImport $import, string $content, string $directory): string
|
||||
{
|
||||
$download = (bool) $import->option('download_images', true);
|
||||
|
||||
return $this->converter->convert($content, function (string $src) use ($import, $download, $directory) {
|
||||
if (! $download) {
|
||||
return $src;
|
||||
}
|
||||
|
||||
// Bilder der alten Website übernehmen; fremde Bilder weglassen, wenn sie nicht ladbar sind.
|
||||
return $this->media->inline($import, $src, $directory);
|
||||
}, $this->attachments($import));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param list<array{slug: string, name: string}> $categories
|
||||
*/
|
||||
private function categoryFor(WpImport $import, array $categories): ?int
|
||||
{
|
||||
foreach ($categories as $category) {
|
||||
if ($id = $this->lookup($import, 'category', $category['slug'])) {
|
||||
return (int) $id;
|
||||
}
|
||||
}
|
||||
|
||||
$fallback = $import->option('default_category');
|
||||
|
||||
return $fallback ? (int) $fallback : null;
|
||||
}
|
||||
|
||||
private function author(WpImport $import, string $login): ?User
|
||||
{
|
||||
if (array_key_exists($login, $this->authors)) {
|
||||
return $this->authors[$login];
|
||||
}
|
||||
|
||||
$mapped = $import->option('authors', [])[$login] ?? null;
|
||||
$email = $import->items()->where('type', 'author')->get()->first(fn ($a) => $a->data['login'] === $login)?->data['email'];
|
||||
|
||||
$user = ($mapped ? User::query()->find($mapped) : null)
|
||||
?? ($email ? User::query()->where('email', $email)->first() : null)
|
||||
?? User::query()->find($import->option('fallback_author', $import->user_id));
|
||||
|
||||
return $this->authors[$login] = $user;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<int, string>
|
||||
*/
|
||||
private function attachments(WpImport $import): array
|
||||
{
|
||||
return $this->attachments ??= $import->items()->where('type', 'attachment')->get(['wp_id', 'data'])
|
||||
->mapWithKeys(fn ($item) => [(int) $item->wp_id => (string) ($item->data['attachment_url'] ?? '')])
|
||||
->filter()
|
||||
->all();
|
||||
}
|
||||
|
||||
private function attachmentUrl(WpImport $import, int $id): ?string
|
||||
{
|
||||
return $this->attachments($import)[$id] ?? null;
|
||||
}
|
||||
|
||||
private function lookup(WpImport $import, string $type, string $key): ?string
|
||||
{
|
||||
return DB::table('wp_import_refs')->where('source', $import->source())->where('type', $type)->where('wp_key', $key)->value('local_value');
|
||||
}
|
||||
|
||||
private function ref(WpImport $import, string $type, string $key, string $localType, string $value): void
|
||||
{
|
||||
DB::table('wp_import_refs')->updateOrInsert(
|
||||
['source' => $import->source(), 'type' => $type, 'wp_key' => mb_substr($key, 0, 191)],
|
||||
['local_type' => $localType, 'local_value' => $value, 'updated_at' => now(), 'created_at' => now()],
|
||||
);
|
||||
}
|
||||
}
|
||||
114
plugins-core/wordpress-import/src/MediaDownloader.php
Normal file
114
plugins-core/wordpress-import/src/MediaDownloader.php
Normal file
|
|
@ -0,0 +1,114 @@
|
|||
<?php
|
||||
|
||||
namespace Inhaus\Plugins\WordpressImport;
|
||||
|
||||
use App\Support\Images;
|
||||
use Illuminate\Http\UploadedFile;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Support\Str;
|
||||
use Inhaus\Plugins\WordpressImport\Models\WpImport;
|
||||
use Throwable;
|
||||
|
||||
/**
|
||||
* Lädt Bilder der alten Website herunter und legt sie im Portal ab.
|
||||
* Jede Adresse wird nur einmal geladen – auch über mehrere Importläufe hinweg.
|
||||
*/
|
||||
class MediaDownloader
|
||||
{
|
||||
public const MAX_BYTES = 15 * 1024 * 1024;
|
||||
|
||||
public function __construct(private readonly Images $images) {}
|
||||
|
||||
/**
|
||||
* Titelbild: Originaldatei in „news/“ (Varianten erzeugt das Beitragsmodell).
|
||||
*/
|
||||
public function cover(WpImport $import, string $url): ?string
|
||||
{
|
||||
return $this->remember($import, 'cover', $url, function (string $tmp, string $extension) {
|
||||
$path = 'news/wp-'.Str::random(24).'.'.$extension;
|
||||
Storage::disk('uploads')->put($path, (string) file_get_contents($tmp));
|
||||
|
||||
return $path;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Bild im Text: verkleinert als WebP, liefert die neue Adresse.
|
||||
*/
|
||||
public function inline(WpImport $import, string $url, string $directory = 'news/inline'): ?string
|
||||
{
|
||||
$path = $this->remember($import, 'inline:'.$directory, $url, fn (string $tmp, string $extension, string $mime) => $this->images->storeContentImage(
|
||||
new UploadedFile($tmp, 'bild.'.$extension, $mime, null, true),
|
||||
$directory,
|
||||
));
|
||||
|
||||
return $path ? Storage::disk('uploads')->url($path) : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param callable(string $tmp, string $extension, string $mime): string $store
|
||||
*/
|
||||
private function remember(WpImport $import, string $kind, string $url, callable $store): ?string
|
||||
{
|
||||
$url = $this->absolute($import, $url);
|
||||
|
||||
if ($url === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$key = $kind.':'.sha1($url);
|
||||
$known = DB::table('wp_import_refs')->where('source', $import->source())->where('type', 'media')->where('wp_key', $key)->value('local_value');
|
||||
|
||||
if ($known && Storage::disk('uploads')->exists($known)) {
|
||||
return $known;
|
||||
}
|
||||
|
||||
$tmp = tempnam(sys_get_temp_dir(), 'wpimg');
|
||||
|
||||
try {
|
||||
$response = Http::timeout(20)->connectTimeout(10)->get($url);
|
||||
$mime = strtolower(explode(';', (string) $response->header('Content-Type'))[0]);
|
||||
$extension = ['image/jpeg' => 'jpg', 'image/png' => 'png', 'image/gif' => 'gif', 'image/webp' => 'webp'][$mime] ?? null;
|
||||
$body = $response->successful() ? $response->body() : '';
|
||||
|
||||
if (! $extension || $body === '' || strlen($body) > self::MAX_BYTES) {
|
||||
return null;
|
||||
}
|
||||
|
||||
file_put_contents($tmp, $body);
|
||||
unset($body);
|
||||
|
||||
if (@getimagesize($tmp) === false) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$path = $store($tmp, $extension, $mime);
|
||||
|
||||
DB::table('wp_import_refs')->updateOrInsert(
|
||||
['source' => $import->source(), 'type' => 'media', 'wp_key' => $key],
|
||||
['local_type' => 'upload', 'local_value' => $path, 'updated_at' => now(), 'created_at' => now()],
|
||||
);
|
||||
|
||||
return $path;
|
||||
} catch (Throwable) {
|
||||
return null;
|
||||
} finally {
|
||||
@unlink($tmp);
|
||||
}
|
||||
}
|
||||
|
||||
private function absolute(WpImport $import, string $url): ?string
|
||||
{
|
||||
$url = html_entity_decode(trim($url));
|
||||
|
||||
if (str_starts_with($url, '//')) {
|
||||
$url = 'https:'.$url;
|
||||
} elseif (str_starts_with($url, '/') && $import->site_url) {
|
||||
$url = rtrim($import->site_url, '/').$url;
|
||||
}
|
||||
|
||||
return preg_match('#^https?://#i', $url) ? $url : null;
|
||||
}
|
||||
}
|
||||
49
plugins-core/wordpress-import/src/Models/WpImport.php
Normal file
49
plugins-core/wordpress-import/src/Models/WpImport.php
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
<?php
|
||||
|
||||
namespace Inhaus\Plugins\WordpressImport\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Attributes\Fillable;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
#[Fillable(['user_id', 'file', 'site_title', 'site_url', 'status', 'options', 'stats', 'log'])]
|
||||
class WpImport extends Model
|
||||
{
|
||||
protected function casts(): array
|
||||
{
|
||||
return ['options' => 'array', 'stats' => 'array'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return HasMany<WpImportItem, $this>
|
||||
*/
|
||||
public function items(): HasMany
|
||||
{
|
||||
return $this->hasMany(WpImportItem::class, 'import_id');
|
||||
}
|
||||
|
||||
/** Kennung der Quelle für wp_import_refs. */
|
||||
public function source(): string
|
||||
{
|
||||
return mb_substr((string) (parse_url((string) $this->site_url, PHP_URL_HOST) ?: $this->site_url ?: 'wordpress'), 0, 191);
|
||||
}
|
||||
|
||||
public function option(string $key, mixed $default = null): mixed
|
||||
{
|
||||
return $this->options[$key] ?? $default;
|
||||
}
|
||||
|
||||
public function addLog(string $line): void
|
||||
{
|
||||
$lines = array_slice(array_filter(explode("\n", (string) $this->log)), -499);
|
||||
$lines[] = $line;
|
||||
$this->log = implode("\n", $lines);
|
||||
}
|
||||
|
||||
public function progress(): int
|
||||
{
|
||||
$total = (int) ($this->stats['total'] ?? 0);
|
||||
|
||||
return $total === 0 ? 100 : (int) floor(100 * (int) ($this->stats['processed'] ?? 0) / $total);
|
||||
}
|
||||
}
|
||||
17
plugins-core/wordpress-import/src/Models/WpImportItem.php
Normal file
17
plugins-core/wordpress-import/src/Models/WpImportItem.php
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
namespace Inhaus\Plugins\WordpressImport\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Attributes\Fillable;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
#[Fillable(['import_id', 'type', 'wp_id', 'wp_parent', 'status', 'data', 'message'])]
|
||||
class WpImportItem extends Model
|
||||
{
|
||||
public $timestamps = false;
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return ['data' => 'array'];
|
||||
}
|
||||
}
|
||||
12
plugins-core/wordpress-import/src/WordpressImportPlugin.php
Normal file
12
plugins-core/wordpress-import/src/WordpressImportPlugin.php
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
namespace Inhaus\Plugins\WordpressImport;
|
||||
|
||||
use App\Plugins\Plugin;
|
||||
|
||||
/**
|
||||
* Umstieg von WordPress: Die Admin-Seite „WordPress-Import“ liegt unter
|
||||
* src/Filament/Pages und wird vom Kern gefunden. Nach dem Umstieg kann das
|
||||
* Plugin deaktiviert werden.
|
||||
*/
|
||||
class WordpressImportPlugin extends Plugin {}
|
||||
189
plugins-core/wordpress-import/src/WxrReader.php
Normal file
189
plugins-core/wordpress-import/src/WxrReader.php
Normal file
|
|
@ -0,0 +1,189 @@
|
|||
<?php
|
||||
|
||||
namespace Inhaus\Plugins\WordpressImport;
|
||||
|
||||
use RuntimeException;
|
||||
use SimpleXMLElement;
|
||||
use XMLReader;
|
||||
|
||||
/**
|
||||
* Liest eine WordPress-Exportdatei (WXR, „Werkzeuge → Daten exportieren“)
|
||||
* Eintrag für Eintrag – auch große Dateien brauchen kaum Arbeitsspeicher.
|
||||
*/
|
||||
class WxrReader
|
||||
{
|
||||
/** @var array<string, string> Präfix => URI */
|
||||
private array $namespaces = [];
|
||||
|
||||
private const NS = [
|
||||
'wp' => ['http://wordpress.org/export/1.2/', 'http://wordpress.org/export/1.1/', 'http://wordpress.org/export/1.0/'],
|
||||
'content' => ['http://purl.org/rss/1.0/modules/content/'],
|
||||
'excerpt' => ['http://wordpress.org/export/1.2/excerpt/', 'http://wordpress.org/export/1.1/excerpt/', 'http://wordpress.org/export/1.0/excerpt/'],
|
||||
'dc' => ['http://purl.org/dc/elements/1.1/'],
|
||||
];
|
||||
|
||||
/**
|
||||
* @param callable(string $type, array<string, mixed> $data): void $callback type: site, category, author, item
|
||||
*/
|
||||
public function read(string $file, callable $callback): void
|
||||
{
|
||||
$reader = new XMLReader;
|
||||
|
||||
if (! @$reader->open($file, null, LIBXML_NONET | LIBXML_COMPACT | LIBXML_PARSEHUGE)) {
|
||||
throw new RuntimeException('Die Datei konnte nicht gelesen werden.');
|
||||
}
|
||||
|
||||
$site = ['title' => null, 'url' => null, 'wxr' => false];
|
||||
$sawChannel = false;
|
||||
$this->namespaces = [];
|
||||
|
||||
try {
|
||||
while (@$reader->read()) {
|
||||
if ($reader->nodeType !== XMLReader::ELEMENT) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$name = $reader->name;
|
||||
|
||||
if ($name === 'rss') {
|
||||
// Namensräume des Wurzelelements merken (wp, content, excerpt, dc, wfw, …).
|
||||
while ($reader->moveToNextAttribute()) {
|
||||
if (str_starts_with($reader->name, 'xmlns:')) {
|
||||
$this->namespaces[substr($reader->name, 6)] = $reader->value;
|
||||
}
|
||||
}
|
||||
|
||||
$reader->moveToElement();
|
||||
} elseif ($name === 'channel') {
|
||||
$sawChannel = true;
|
||||
} elseif ($sawChannel && $reader->depth === 2 && $name === 'title' && $site['title'] === null) {
|
||||
$site['title'] = trim($reader->readString());
|
||||
} elseif ($name === 'wp:base_blog_url' || ($name === 'wp:base_site_url' && $site['url'] === null)) {
|
||||
$site['url'] = trim($reader->readString());
|
||||
} elseif ($name === 'wp:wxr_version') {
|
||||
$site['wxr'] = true;
|
||||
} elseif ($name === 'wp:category') {
|
||||
$callback('category', $this->category($this->element($reader)));
|
||||
} elseif ($name === 'wp:author') {
|
||||
$callback('author', $this->author($this->element($reader)));
|
||||
} elseif ($name === 'item') {
|
||||
if (! $site['wxr']) {
|
||||
throw new RuntimeException('Das ist keine WordPress-Exportdatei (WXR).');
|
||||
}
|
||||
|
||||
$callback('item', $this->item($this->element($reader)));
|
||||
$reader->next();
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
$reader->close();
|
||||
}
|
||||
|
||||
if (! $site['wxr']) {
|
||||
throw new RuntimeException('Das ist keine WordPress-Exportdatei (WXR). Bitte in WordPress unter „Werkzeuge → Daten exportieren“ erzeugen.');
|
||||
}
|
||||
|
||||
$callback('site', $site);
|
||||
}
|
||||
|
||||
private function element(XMLReader $reader): SimpleXMLElement
|
||||
{
|
||||
// Einzelnes Element mit den Namensräumen des Wurzelelements neu aufbauen.
|
||||
// Die WordPress-Versionen 1.0–1.2 werden dabei auf 1.2 vereinheitlicht.
|
||||
$namespaces = $this->namespaces + ['wp' => '', 'content' => '', 'excerpt' => '', 'dc' => ''];
|
||||
$namespaces['wp'] = self::NS['wp'][0];
|
||||
$namespaces['excerpt'] = self::NS['excerpt'][0];
|
||||
$namespaces['content'] = self::NS['content'][0];
|
||||
$namespaces['dc'] = self::NS['dc'][0];
|
||||
|
||||
$declarations = implode(' ', array_map(fn ($prefix, $uri) => 'xmlns:'.$prefix.'="'.htmlspecialchars($uri, ENT_XML1).'"', array_keys($namespaces), $namespaces));
|
||||
$xml = preg_replace('/\s+xmlns:[A-Za-z0-9_-]+="[^"]*"/', '', $reader->readOuterXml());
|
||||
|
||||
$element = @simplexml_load_string('<root '.$declarations.'>'.$xml.'</root>', SimpleXMLElement::class, LIBXML_NOCDATA | LIBXML_NONET | LIBXML_PARSEHUGE);
|
||||
|
||||
if ($element === false) {
|
||||
throw new RuntimeException('Die Exportdatei enthält fehlerhaftes XML.');
|
||||
}
|
||||
|
||||
// Erstes Kindelement, egal in welchem Namensraum (z. B. wp:author).
|
||||
$first = $element->xpath('./*')[0] ?? null;
|
||||
|
||||
if ($first === null) {
|
||||
throw new RuntimeException('Die Exportdatei enthält fehlerhaftes XML.');
|
||||
}
|
||||
|
||||
return $first;
|
||||
}
|
||||
|
||||
private function wp(SimpleXMLElement $e, string $name): string
|
||||
{
|
||||
return trim((string) $e->children(self::NS['wp'][0])->{$name});
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
private function category(SimpleXMLElement $e): array
|
||||
{
|
||||
return [
|
||||
'wp_id' => (int) $this->wp($e, 'term_id'),
|
||||
'slug' => $this->wp($e, 'category_nicename'),
|
||||
'name' => html_entity_decode($this->wp($e, 'cat_name'), ENT_QUOTES),
|
||||
'parent' => $this->wp($e, 'category_parent'),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
private function author(SimpleXMLElement $e): array
|
||||
{
|
||||
return [
|
||||
'wp_id' => (int) $this->wp($e, 'author_id'),
|
||||
'login' => $this->wp($e, 'author_login'),
|
||||
'email' => strtolower($this->wp($e, 'author_email')),
|
||||
'name' => html_entity_decode($this->wp($e, 'author_display_name'), ENT_QUOTES),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
private function item(SimpleXMLElement $e): array
|
||||
{
|
||||
$wp = $e->children(self::NS['wp'][0]);
|
||||
$meta = [];
|
||||
|
||||
foreach ($wp->postmeta as $postmeta) {
|
||||
$pm = $postmeta->children(self::NS['wp'][0]);
|
||||
$meta[(string) $pm->meta_key] = (string) $pm->meta_value;
|
||||
}
|
||||
|
||||
$categories = [];
|
||||
|
||||
foreach ($e->category as $category) {
|
||||
if ((string) $category['domain'] === 'category') {
|
||||
$categories[] = ['slug' => (string) $category['nicename'], 'name' => html_entity_decode((string) $category, ENT_QUOTES)];
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
'wp_id' => (int) $wp->post_id,
|
||||
'type' => (string) $wp->post_type,
|
||||
'status' => (string) $wp->status,
|
||||
'title' => html_entity_decode(trim((string) $e->title), ENT_QUOTES),
|
||||
'slug' => (string) $wp->post_name,
|
||||
'link' => trim((string) $e->link),
|
||||
'creator' => trim((string) $e->children(self::NS['dc'][0])->creator),
|
||||
'content' => (string) $e->children(self::NS['content'][0])->encoded,
|
||||
'excerpt' => trim((string) $e->children(self::NS['excerpt'][0])->encoded),
|
||||
'date_gmt' => (string) $wp->post_date_gmt,
|
||||
'date' => (string) $wp->post_date,
|
||||
'parent' => (int) $wp->post_parent,
|
||||
'menu_order' => (int) $wp->menu_order,
|
||||
'attachment_url' => (string) $wp->attachment_url,
|
||||
'thumbnail_id' => (int) ($meta['_thumbnail_id'] ?? 0),
|
||||
'categories' => $categories,
|
||||
];
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -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-CvqF6bx0.js";import{t as c}from"./NewsCard-KwOJE7h8.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-GlXreVuM.js";import{t as c}from"./NewsCard-DI4a_WuI.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};
|
||||
|
|
@ -1 +1 @@
|
|||
import{Zn as e,_ as t,b as n,g as r,mt as i,o as a,tr as o}from"./runtime-core.esm-bundler-B8D2lM98.js";import{i as s}from"./app-B3SzpsCA.js";var c={class:`flex items-center gap-3`},l=[`src`,`alt`],u={class:`text-[17px] font-semibold tracking-tight`},d={__name:`BrandLogo`,props:{inverted:{type:Boolean,default:!1}},setup(d){let f=r(()=>s().props.branding),p=r(()=>f.value.portal_name.trim().charAt(0).toUpperCase());return(r,s)=>(i(),n(`span`,c,[f.value.logo_url?(i(),n(`img`,{key:0,src:f.value.logo_url,alt:f.value.portal_name,class:`h-8 w-auto`},null,8,l)):(i(),n(a,{key:1},[t(`span`,{class:e([`grid size-8 place-items-center rounded-md text-base font-bold`,d.inverted?`bg-white/15 text-white`:`bg-brand text-brand-foreground`])},o(p.value),3),t(`span`,u,o(f.value.portal_name),1)],64))]))}};export{d as t};
|
||||
import{Zn as e,_ as t,b as n,g as r,mt as i,o as a,tr as o}from"./runtime-core.esm-bundler-B8D2lM98.js";import{i as s}from"./app-qaQo9ARB.js";var c={class:`flex items-center gap-3`},l=[`src`,`alt`],u={class:`text-[17px] font-semibold tracking-tight`},d={__name:`BrandLogo`,props:{inverted:{type:Boolean,default:!1}},setup(d){let f=r(()=>s().props.branding),p=r(()=>f.value.portal_name.trim().charAt(0).toUpperCase());return(r,s)=>(i(),n(`span`,c,[f.value.logo_url?(i(),n(`img`,{key:0,src:f.value.logo_url,alt:f.value.portal_name,class:`h-8 w-auto`},null,8,l)):(i(),n(a,{key:1},[t(`span`,{class:e([`grid size-8 place-items-center rounded-md text-base font-bold`,d.inverted?`bg-white/15 text-white`:`bg-brand text-brand-foreground`])},o(p.value),3),t(`span`,u,o(f.value.portal_name),1)],64))]))}};export{d as t};
|
||||
|
|
@ -1 +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-B3SzpsCA.js";import{t as p}from"./PersonAvatar-CD4S56En.js";import{n as m,t as h}from"./phone-BCjoS6Xy.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(p,{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(m),{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};
|
||||
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-qaQo9ARB.js";import{t as p}from"./PersonAvatar-CD4S56En.js";import{n as m,t as h}from"./phone-BCjoS6Xy.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(p,{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(m),{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};
|
||||
|
|
@ -1,2 +1,2 @@
|
|||
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Greeting-CpBd_0Ow.js","assets/runtime-core.esm-bundler-B8D2lM98.js","assets/app-B3SzpsCA.js","assets/runtime-dom.esm-bundler-BEWGoe8n.js","assets/app-k0gPpXCk.css","assets/AppLayout-t5KmyFQO.js","assets/RovingFocusGroup-HoUPhonB.js","assets/utils-DfNUDixG.js","assets/PersonAvatar-CD4S56En.js","assets/BrandLogo-D3B2srB7.js","assets/NewColleagues-SPK0pOn4.js","assets/Panel-CvqF6bx0.js","assets/chevron-right-2hoRrfAe.js","assets/PeopleSearch-BvcYbQvn.js","assets/arrow-right-CSfG3qiq.js","assets/ProfileIncomplete-DQ2x5eSw.js","assets/QuickLinks-B-vQ8LsD.js","assets/icons-6gNUNtiS.js","assets/building-complex-Drk3TBKp.js","assets/calendar-days-Cq3ZXY-S.js","assets/clock-IVbPqglU.js","assets/file-text-Dmdo-Zwf.js","assets/lightbulb-Crmh5htw.js","assets/link-BE7bRFjZ.js","assets/phone-BCjoS6Xy.js","assets/chevron-left-D2Or6edo.js","assets/dist-FqXf5I3H.js","assets/Upcoming-DbdyJ8Ba.js","assets/EventListItem-BBsqXvqV.js","assets/EventDateBlock-WbVaROZc.js","assets/EmptyState-Ceq4v8mE.js","assets/Areas-DWKEN92e.js","assets/NewsCard-KwOJE7h8.js","assets/NewsImage-CU6jD5fm.js","assets/Hero-DgUcrF1I.js","assets/play-BqfGHciU.js","assets/Latest-BRro1Z0k.js","assets/NewsListItem-CPNO5liG.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-B3SzpsCA.js";import{t as m}from"./AppLayout-t5KmyFQO.js";import{n as h}from"./dist-FqXf5I3H.js";var g=Object.assign({"../widgets/Greeting.vue":()=>p(()=>import(`./Greeting-CpBd_0Ow.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9])),"../widgets/NewColleagues.vue":()=>p(()=>import(`./NewColleagues-SPK0pOn4.js`),__vite__mapDeps([10,1,2,3,4,8,6,7,11,12])),"../widgets/PeopleSearch.vue":()=>p(()=>import(`./PeopleSearch-BvcYbQvn.js`),__vite__mapDeps([13,1,2,3,4,14,7,8,6,11,12])),"../widgets/ProfileIncomplete.vue":()=>p(()=>import(`./ProfileIncomplete-DQ2x5eSw.js`),__vite__mapDeps([15,1,2,3,4,5,6,7,8,9])),"../widgets/QuickLinks.vue":()=>p(()=>import(`./QuickLinks-B-vQ8LsD.js`),__vite__mapDeps([16,1,2,3,4,17,7,18,19,8,6,20,21,22,23,24,25,12,26]))}),_=Object.assign({"../../../plugins-core/events/resources/js/widgets/Upcoming.vue":()=>p(()=>import(`./Upcoming-DbdyJ8Ba.js`),__vite__mapDeps([27,1,19,7,28,2,3,4,8,6,29,30,11,12])),"../../../plugins-core/news/resources/js/widgets/Areas.vue":()=>p(()=>import(`./Areas-DWKEN92e.js`),__vite__mapDeps([31,1,11,2,3,4,12,7,32,8,6,33])),"../../../plugins-core/news/resources/js/widgets/Hero.vue":()=>p(()=>import(`./Hero-DgUcrF1I.js`),__vite__mapDeps([34,1,3,2,4,7,14,25,12,35])),"../../../plugins-core/news/resources/js/widgets/Latest.vue":()=>p(()=>import(`./Latest-BRro1Z0k.js`),__vite__mapDeps([36,1,8,6,3,7,30,11,2,4,12,37,33]))}),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:`grid grid-cols-12 gap-6`},x={class:`col-span-8 grid min-w-0 grid-cols-1 content-start gap-6 xl:col-span-9 xl:grid-cols-3`},S={class:`col-span-4 grid min-w-0 grid-cols-1 content-start gap-6 xl:col-span-3`},C={key:1,class:`grid min-w-0 grid-cols-1 gap-6`},w={__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),w=o(()=>v(`hero`)[0]??null),T=o(()=>[..._.value].sort((e,t)=>e.mobileSort-t.mobileSort));return(e,o)=>(s(),u(m,{title:`Startseite`},{default:l(()=>[t(g)?(s(),r(`div`,b,[n(`div`,x,[w.value?(s(),u(d(t(y)(w.value.component)),a({key:0},w.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:!w.value,class:w.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`,S,[(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`,C,[(s(!0),r(c,null,i(T.value,e=>(s(),u(d(t(y)(e.component)),a({key:e.key},{ref_for:!0},e.props),null,16))),128))]))]),_:1}))}};export{w as default};
|
||||
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Greeting-CbrybEKX.js","assets/runtime-core.esm-bundler-B8D2lM98.js","assets/app-qaQo9ARB.js","assets/runtime-dom.esm-bundler-BEWGoe8n.js","assets/app-0ZlMoGuN.css","assets/AppLayout-Xi_ip4AB.js","assets/RovingFocusGroup-HoUPhonB.js","assets/utils-DfNUDixG.js","assets/PersonAvatar-CD4S56En.js","assets/BrandLogo-CJRIp_WY.js","assets/NewColleagues-CRXUBi9O.js","assets/Panel-GlXreVuM.js","assets/chevron-right-2hoRrfAe.js","assets/PeopleSearch-BaHMxuMf.js","assets/arrow-right-CSfG3qiq.js","assets/ProfileIncomplete-ozL_jtWi.js","assets/QuickLinks-BvOUOHy-.js","assets/icons-6gNUNtiS.js","assets/building-complex-Drk3TBKp.js","assets/calendar-days-Cq3ZXY-S.js","assets/clock-IVbPqglU.js","assets/file-text-Dmdo-Zwf.js","assets/lightbulb-Crmh5htw.js","assets/link-BE7bRFjZ.js","assets/phone-BCjoS6Xy.js","assets/chevron-left-D2Or6edo.js","assets/dist-FqXf5I3H.js","assets/Upcoming-BJ1RwZn4.js","assets/EventListItem-C-X2Rk4q.js","assets/EventDateBlock-WbVaROZc.js","assets/EmptyState-Ceq4v8mE.js","assets/Areas-LTVGnpxy.js","assets/NewsCard-DI4a_WuI.js","assets/NewsImage-CU6jD5fm.js","assets/Hero-D17KPvpE.js","assets/play-BqfGHciU.js","assets/Latest-cskZJ6Gh.js","assets/NewsListItem-RJ4Ryvod.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-qaQo9ARB.js";import{t as m}from"./AppLayout-Xi_ip4AB.js";import{n as h}from"./dist-FqXf5I3H.js";var g=Object.assign({"../widgets/Greeting.vue":()=>p(()=>import(`./Greeting-CbrybEKX.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9])),"../widgets/NewColleagues.vue":()=>p(()=>import(`./NewColleagues-CRXUBi9O.js`),__vite__mapDeps([10,1,2,3,4,8,6,7,11,12])),"../widgets/PeopleSearch.vue":()=>p(()=>import(`./PeopleSearch-BaHMxuMf.js`),__vite__mapDeps([13,1,2,3,4,14,7,8,6,11,12])),"../widgets/ProfileIncomplete.vue":()=>p(()=>import(`./ProfileIncomplete-ozL_jtWi.js`),__vite__mapDeps([15,1,2,3,4,5,6,7,8,9])),"../widgets/QuickLinks.vue":()=>p(()=>import(`./QuickLinks-BvOUOHy-.js`),__vite__mapDeps([16,1,2,3,4,17,7,18,19,8,6,20,21,22,23,24,25,12,26]))}),_=Object.assign({"../../../plugins-core/events/resources/js/widgets/Upcoming.vue":()=>p(()=>import(`./Upcoming-BJ1RwZn4.js`),__vite__mapDeps([27,1,19,7,28,2,3,4,8,6,29,30,11,12])),"../../../plugins-core/news/resources/js/widgets/Areas.vue":()=>p(()=>import(`./Areas-LTVGnpxy.js`),__vite__mapDeps([31,1,11,2,3,4,12,7,32,8,6,33])),"../../../plugins-core/news/resources/js/widgets/Hero.vue":()=>p(()=>import(`./Hero-D17KPvpE.js`),__vite__mapDeps([34,1,3,2,4,7,14,25,12,35])),"../../../plugins-core/news/resources/js/widgets/Latest.vue":()=>p(()=>import(`./Latest-cskZJ6Gh.js`),__vite__mapDeps([36,1,8,6,3,7,30,11,2,4,12,37,33]))}),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:`grid grid-cols-12 gap-6`},x={class:`col-span-8 grid min-w-0 grid-cols-1 content-start gap-6 xl:col-span-9 xl:grid-cols-3`},S={class:`col-span-4 grid min-w-0 grid-cols-1 content-start gap-6 xl:col-span-3`},C={key:1,class:`grid min-w-0 grid-cols-1 gap-6`},w={__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),w=o(()=>v(`hero`)[0]??null),T=o(()=>[..._.value].sort((e,t)=>e.mobileSort-t.mobileSort));return(e,o)=>(s(),u(m,{title:`Startseite`},{default:l(()=>[t(g)?(s(),r(`div`,b,[n(`div`,x,[w.value?(s(),u(d(t(y)(w.value.component)),a({key:0},w.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:!w.value,class:w.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`,S,[(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`,C,[(s(!0),r(c,null,i(T.value,e=>(s(),u(d(t(y)(e.component)),a({key:e.key},{ref_for:!0},e.props),null,16))),128))]))]),_:1}))}};export{w as default};
|
||||
File diff suppressed because one or more lines are too long
1
public/build/assets/Edit-D-LRBdNE.js
Normal file
1
public/build/assets/Edit-D-LRBdNE.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
public/build/assets/Editor-B7hXNWek.js
Normal file
1
public/build/assets/Editor-B7hXNWek.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
public/build/assets/Editor-DcBkd6zb.js
Normal file
1
public/build/assets/Editor-DcBkd6zb.js
Normal file
File diff suppressed because one or more lines are too long
|
|
@ -1 +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-B3SzpsCA.js";import{M as m}from"./PersonAvatar-CD4S56En.js";import{t as h}from"./message-square-warning-CzxLG9ol.js";import{t as g}from"./plus-CGTHU-CI.js";import{t as _}from"./button-BVLATeqq.js";import{t as v}from"./Panel-CvqF6bx0.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};
|
||||
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-qaQo9ARB.js";import{M as m}from"./PersonAvatar-CD4S56En.js";import{t as h}from"./message-square-warning-CzxLG9ol.js";import{t as g}from"./plus-CGTHU-CI.js";import{t as _}from"./button-BVLATeqq.js";import{t as v}from"./Panel-GlXreVuM.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};
|
||||
|
|
@ -1 +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-B3SzpsCA.js";import{M as g}from"./PersonAvatar-CD4S56En.js";import{t as _}from"./lock-DtEIVsTL.js";import{t as v}from"./plus-CGTHU-CI.js";import{t as y}from"./button-BVLATeqq.js";import{t as b}from"./Panel-CvqF6bx0.js";import{t as x}from"./NewPageDialog-CunM9MP1.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};
|
||||
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-qaQo9ARB.js";import{M as g}from"./PersonAvatar-CD4S56En.js";import{t as _}from"./lock-DtEIVsTL.js";import{t as v}from"./plus-CGTHU-CI.js";import{t as y}from"./button-BVLATeqq.js";import{t as b}from"./Panel-GlXreVuM.js";import{t as x}from"./NewPageDialog-D3AfoYKZ.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};
|
||||
|
|
@ -1 +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-B3SzpsCA.js";import{A as u}from"./PersonAvatar-CD4S56En.js";import{t as d}from"./EventDateBlock-WbVaROZc.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};
|
||||
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-qaQo9ARB.js";import{A as u}from"./PersonAvatar-CD4S56En.js";import{t as d}from"./EventDateBlock-WbVaROZc.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};
|
||||
|
|
@ -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-B3SzpsCA.js";import{A as p}from"./utils-DfNUDixG.js";import{t as m}from"./arrow-left-CeYKHQbE.js";import{t as h}from"./FormField-D33HIO77.js";import{t as g}from"./button-BVLATeqq.js";import{t as _}from"./Input-DE5SwW-e.js";import{t as v}from"./GuestLayout-3mQ2EZWW.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-qaQo9ARB.js";import{A as p}from"./utils-DfNUDixG.js";import{t as m}from"./arrow-left-CeYKHQbE.js";import{t as h}from"./FormField-D33HIO77.js";import{t as g}from"./button-BVLATeqq.js";import{t as _}from"./Input-DE5SwW-e.js";import{t as v}from"./GuestLayout-CA0IOiaT.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};
|
||||
1
public/build/assets/FormBlock-BOT9NHLv.js
Normal file
1
public/build/assets/FormBlock-BOT9NHLv.js
Normal file
|
|
@ -0,0 +1 @@
|
|||
import{J as e,On as t,Zn as n,_ as r,b as i,mt as a,o,tr as s,v as c,y as l}from"./runtime-core.esm-bundler-B8D2lM98.js";import{t as u}from"./FormRenderer-BrPUPdr2.js";var d={key:0,class:`rounded-lg border bg-card p-5 @3xl:p-8`},f={class:`text-xl font-semibold tracking-tight`},p={key:0,class:`mt-2 mb-6 text-sm leading-relaxed whitespace-pre-line text-muted-foreground`},m={key:1,class:`rounded-lg border border-dashed p-4 text-sm text-muted-foreground`},h={__name:`FormBlock`,props:{block:{type:Object,required:!0}},setup(h){let g=e(`pagebuilder:editing`,!1);return(e,_)=>h.block.props?(a(),i(`section`,d,[h.block.data.show_title?(a(),i(o,{key:0},[r(`h3`,f,s(h.block.props.title),1),h.block.props.description?(a(),i(`p`,p,s(h.block.props.description),1)):l(``,!0)],64)):l(``,!0),r(`div`,{class:n({"pointer-events-none opacity-80":t(g)})},[(a(),c(u,{key:h.block.props.id,form:h.block.props},null,8,[`form`]))],2)])):t(g)?(a(),i(`p`,m,`Bitte rechts ein Formular auswählen.`)):l(``,!0)}};export{h as default};
|
||||
1
public/build/assets/FormRenderer-BrPUPdr2.js
Normal file
1
public/build/assets/FormRenderer-BrPUPdr2.js
Normal file
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
|||
import{D as e,E as t,On as n,_ as r,b as i,g as a,mt as o,qt as s,tr as c,v as l}from"./runtime-core.esm-bundler-B8D2lM98.js";import{i as u,n as d}from"./app-B3SzpsCA.js";import{a as f,i as p,n as m,r as h}from"./AppLayout-t5KmyFQO.js";import{t as g}from"./PersonAvatar-CD4S56En.js";var _={class:`overflow-hidden rounded-lg border bg-card`},v={class:`flex items-center justify-between gap-4 bg-brand px-6 py-6 text-brand-foreground`},y={class:`min-w-0`},b={class:`text-sm opacity-85`},x={class:`mt-0.5 text-[22px] leading-tight font-semibold tracking-tight break-words`},S={class:`mt-1.5 line-clamp-2 text-[13px] opacity-85`},C={class:`grid grid-cols-3 divide-x`,"aria-label":`Mein Bereich`},w={key:0,href:`/admin`,class:`flex flex-col items-center gap-2 px-2 py-4 text-center text-xs font-medium text-foreground/80 hover:bg-accent hover:text-foreground`},T={__name:`GreetingCard`,props:{user:{type:Object,required:!0},profile:{type:Object,required:!0},greeting:{type:String,required:!0}},setup(a){return(u,T)=>(o(),i(`section`,_,[r(`div`,v,[r(`div`,y,[r(`div`,b,c(a.greeting)+`,`,1),r(`div`,x,c(a.user.name),1),r(`div`,S,c(a.profile.job_title||`Schön, dass Sie da sind!`),1)]),e(g,{person:a.user,class:`size-16 shrink-0 text-lg ring-4 ring-white/25 xl:size-20 xl:text-xl`},null,8,[`person`])]),r(`nav`,C,[e(n(d),{href:`/personen/${a.user.id}`,class:`flex flex-col items-center gap-2 px-2 py-4 text-center text-xs font-medium text-foreground/80 hover:bg-accent hover:text-foreground`},{default:s(()=>[e(n(m),{class:`size-5 text-brand-text`,"stroke-width":1.75}),T[0]||=t(` Mein Profil `,-1)]),_:1},8,[`href`]),e(n(d),{href:`/profil/bearbeiten`,class:`flex flex-col items-center gap-2 px-2 py-4 text-center text-xs font-medium text-foreground/80 hover:bg-accent hover:text-foreground`},{default:s(()=>[e(n(h),{class:`size-5 text-brand-text`,"stroke-width":1.75}),T[1]||=t(` Profil bearbeiten `,-1)]),_:1}),a.user.can_admin?(o(),i(`a`,w,[e(n(p),{class:`size-5 text-brand-text`,"stroke-width":1.75}),T[2]||=t(` Administration `,-1)])):(o(),l(n(d),{key:1,href:`/logout`,method:`post`,as:`button`,class:`flex flex-col items-center gap-2 px-2 py-4 text-center text-xs font-medium text-foreground/80 hover:bg-accent hover:text-foreground`},{default:s(()=>[e(n(f),{class:`size-5 text-brand-text`,"stroke-width":1.75}),T[3]||=t(` Abmelden `,-1)]),_:1}))])]))}},E={__name:`Greeting`,props:{profile:{type:Object,required:!0}},setup(e){let t=e,n=u(),r=a(()=>({...n.props.auth.user,avatar_url:t.profile.avatar_url})),i=a(()=>{let e=new Date().getHours();return e<11?`Guten Morgen`:e<18?`Guten Tag`:`Guten Abend`});return(t,n)=>(o(),l(T,{user:r.value,profile:e.profile,greeting:i.value},null,8,[`user`,`profile`,`greeting`]))}};export{E as default};
|
||||
import{D as e,E as t,On as n,_ as r,b as i,g as a,mt as o,qt as s,tr as c,v as l}from"./runtime-core.esm-bundler-B8D2lM98.js";import{i as u,n as d}from"./app-qaQo9ARB.js";import{a as f,i as p,n as m,r as h}from"./AppLayout-Xi_ip4AB.js";import{t as g}from"./PersonAvatar-CD4S56En.js";var _={class:`overflow-hidden rounded-lg border bg-card`},v={class:`flex items-center justify-between gap-4 bg-brand px-6 py-6 text-brand-foreground`},y={class:`min-w-0`},b={class:`text-sm opacity-85`},x={class:`mt-0.5 text-[22px] leading-tight font-semibold tracking-tight break-words`},S={class:`mt-1.5 line-clamp-2 text-[13px] opacity-85`},C={class:`grid grid-cols-3 divide-x`,"aria-label":`Mein Bereich`},w={key:0,href:`/admin`,class:`flex flex-col items-center gap-2 px-2 py-4 text-center text-xs font-medium text-foreground/80 hover:bg-accent hover:text-foreground`},T={__name:`GreetingCard`,props:{user:{type:Object,required:!0},profile:{type:Object,required:!0},greeting:{type:String,required:!0}},setup(a){return(u,T)=>(o(),i(`section`,_,[r(`div`,v,[r(`div`,y,[r(`div`,b,c(a.greeting)+`,`,1),r(`div`,x,c(a.user.name),1),r(`div`,S,c(a.profile.job_title||`Schön, dass Sie da sind!`),1)]),e(g,{person:a.user,class:`size-16 shrink-0 text-lg ring-4 ring-white/25 xl:size-20 xl:text-xl`},null,8,[`person`])]),r(`nav`,C,[e(n(d),{href:`/personen/${a.user.id}`,class:`flex flex-col items-center gap-2 px-2 py-4 text-center text-xs font-medium text-foreground/80 hover:bg-accent hover:text-foreground`},{default:s(()=>[e(n(m),{class:`size-5 text-brand-text`,"stroke-width":1.75}),T[0]||=t(` Mein Profil `,-1)]),_:1},8,[`href`]),e(n(d),{href:`/profil/bearbeiten`,class:`flex flex-col items-center gap-2 px-2 py-4 text-center text-xs font-medium text-foreground/80 hover:bg-accent hover:text-foreground`},{default:s(()=>[e(n(h),{class:`size-5 text-brand-text`,"stroke-width":1.75}),T[1]||=t(` Profil bearbeiten `,-1)]),_:1}),a.user.can_admin?(o(),i(`a`,w,[e(n(p),{class:`size-5 text-brand-text`,"stroke-width":1.75}),T[2]||=t(` Administration `,-1)])):(o(),l(n(d),{key:1,href:`/logout`,method:`post`,as:`button`,class:`flex flex-col items-center gap-2 px-2 py-4 text-center text-xs font-medium text-foreground/80 hover:bg-accent hover:text-foreground`},{default:s(()=>[e(n(f),{class:`size-5 text-brand-text`,"stroke-width":1.75}),T[3]||=t(` Abmelden `,-1)]),_:1}))])]))}},E={__name:`Greeting`,props:{profile:{type:Object,required:!0}},setup(e){let t=e,n=u(),r=a(()=>({...n.props.auth.user,avatar_url:t.profile.avatar_url})),i=a(()=>{let e=new Date().getHours();return e<11?`Guten Morgen`:e<18?`Guten Tag`:`Guten Abend`});return(t,n)=>(o(),l(T,{user:r.value,profile:e.profile,greeting:i.value},null,8,[`user`,`profile`,`greeting`]))}};export{E as default};
|
||||
|
|
@ -1 +1 @@
|
|||
import{D as e,On as t,_ as n,b as r,g as i,mt as a,o,tr as s,xt as c,y as l}from"./runtime-core.esm-bundler-B8D2lM98.js";import{i as u,t as d}from"./app-B3SzpsCA.js";import{t as f}from"./BrandLogo-D3B2srB7.js";var p={class:`grid min-h-screen lg:grid-cols-[minmax(0,5fr)_minmax(0,6fr)]`},m={class:`relative hidden overflow-hidden bg-brand text-brand-foreground lg:flex lg:flex-col lg:justify-between lg:p-12`},h={class:`relative max-w-md`},g={class:`mt-4 text-[15px] opacity-80`},_={class:`relative text-xs opacity-60`},v={class:`flex items-center justify-center bg-background px-4 py-12 sm:px-8`},y={class:`w-full max-w-[400px]`},b={class:`mb-10 lg:hidden`},x={class:`text-2xl font-semibold tracking-tight`},S={key:0,class:`mt-2 text-sm text-muted-foreground`},C={class:`mt-8`},w={__name:`GuestLayout`,props:{title:{type:String,default:``},description:{type:String,default:``}},setup(w){let T=w,E=i(()=>u().props.branding);return(i,u)=>(a(),r(o,null,[e(t(d),{title:T.title},null,8,[`title`]),n(`div`,p,[n(`aside`,m,[u[1]||=n(`div`,{class:`pointer-events-none absolute inset-0 opacity-[0.12]`,style:{"background-image":`radial-gradient(circle at 20% 20%, white 0, transparent 45%), radial-gradient(circle at 90% 80%, white 0, transparent 40%)`}},null,-1),e(f,{inverted:``,class:`relative`}),n(`div`,h,[u[0]||=n(`p`,{class:`text-3xl leading-tight font-semibold tracking-tight`},`Alles Wichtige für Ihren Arbeitsalltag – an einem Ort.`,-1),n(`p`,g,`Neuigkeiten, Ansprechpartner und Anwendungen von `+s(E.value.portal_name)+`.`,1)]),n(`p`,_,`© `+s(new Date().getFullYear())+` `+s(E.value.portal_name),1)]),n(`main`,v,[n(`div`,y,[n(`div`,b,[e(f)]),n(`h1`,x,s(T.title),1),T.description?(a(),r(`p`,S,s(T.description),1)):l(``,!0),n(`div`,C,[c(i.$slots,`default`)])])])])],64))}};export{w as t};
|
||||
import{D as e,On as t,_ as n,b as r,g as i,mt as a,o,tr as s,xt as c,y as l}from"./runtime-core.esm-bundler-B8D2lM98.js";import{i as u,t as d}from"./app-qaQo9ARB.js";import{t as f}from"./BrandLogo-CJRIp_WY.js";var p={class:`grid min-h-screen lg:grid-cols-[minmax(0,5fr)_minmax(0,6fr)]`},m={class:`relative hidden overflow-hidden bg-brand text-brand-foreground lg:flex lg:flex-col lg:justify-between lg:p-12`},h={class:`relative max-w-md`},g={class:`mt-4 text-[15px] opacity-80`},_={class:`relative text-xs opacity-60`},v={class:`flex items-center justify-center bg-background px-4 py-12 sm:px-8`},y={class:`w-full max-w-[400px]`},b={class:`mb-10 lg:hidden`},x={class:`text-2xl font-semibold tracking-tight`},S={key:0,class:`mt-2 text-sm text-muted-foreground`},C={class:`mt-8`},w={__name:`GuestLayout`,props:{title:{type:String,default:``},description:{type:String,default:``}},setup(w){let T=w,E=i(()=>u().props.branding);return(i,u)=>(a(),r(o,null,[e(t(d),{title:T.title},null,8,[`title`]),n(`div`,p,[n(`aside`,m,[u[1]||=n(`div`,{class:`pointer-events-none absolute inset-0 opacity-[0.12]`,style:{"background-image":`radial-gradient(circle at 20% 20%, white 0, transparent 45%), radial-gradient(circle at 90% 80%, white 0, transparent 40%)`}},null,-1),e(f,{inverted:``,class:`relative`}),n(`div`,h,[u[0]||=n(`p`,{class:`text-3xl leading-tight font-semibold tracking-tight`},`Alles Wichtige für Ihren Arbeitsalltag – an einem Ort.`,-1),n(`p`,g,`Neuigkeiten, Ansprechpartner und Anwendungen von `+s(E.value.portal_name)+`.`,1)]),n(`p`,_,`© `+s(new Date().getFullYear())+` `+s(E.value.portal_name),1)]),n(`main`,v,[n(`div`,y,[n(`div`,b,[e(f)]),n(`h1`,x,s(T.title),1),T.description?(a(),r(`p`,S,s(T.description),1)):l(``,!0),n(`div`,C,[c(i.$slots,`default`)])])])])],64))}};export{w as t};
|
||||
|
|
@ -1 +1 @@
|
|||
import{D as e,E as t,On as n,Yt as r,Zn as i,_ as a,b as o,bt as s,ct as c,g as l,it as u,mt as d,o as f,qt as p,tr as m,v as h,vn as g,y as _}from"./runtime-core.esm-bundler-B8D2lM98.js";import{S as v,n as y}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{n as b}from"./app-B3SzpsCA.js";import{j as x}from"./utils-DfNUDixG.js";import{t as S}from"./arrow-right-CSfG3qiq.js";import{t as C}from"./chevron-left-D2Or6edo.js";import{t as w}from"./chevron-right-2hoRrfAe.js";import{t as T}from"./play-BqfGHciU.js";var E=x({name:`pause`,size:24,node:[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]}),D=[`src`],O={class:`flex h-full flex-col justify-end p-6 sm:max-w-[65%] sm:justify-center sm:p-10`,"aria-live":`polite`},k={key:0,class:`mb-3 w-fit rounded-sm bg-brand px-2 py-0.5 text-[11px] font-semibold tracking-wide text-brand-foreground uppercase`},A={class:`text-2xl leading-tight font-semibold tracking-tight sm:text-[32px]`},j={key:1,class:`mt-3 line-clamp-3 hidden text-[15px] text-white/85 sm:block`},M={key:0,class:`absolute right-4 bottom-4 flex items-center gap-2 sm:right-6 sm:bottom-6`},N={class:`flex items-center gap-1.5 px-1`},P=[`aria-label`,`aria-current`,`onClick`],F=[`aria-label`],I={__name:`HeroSlider`,props:{posts:{type:Array,required:!0}},setup(x){let I=x,L=g(0),R=g(!1),z=l(()=>I.posts[L.value]),B=null;function V(e){L.value=(e+I.posts.length)%I.posts.length}function H(){U(),I.posts.length>1&&!R.value&&!window.matchMedia(`(prefers-reduced-motion: reduce)`).matches&&(B=setInterval(()=>V(L.value+1),7e3))}function U(){clearInterval(B)}function W(){R.value=!R.value,H()}return c(H),u(U),(c,l)=>(d(),o(`section`,{class:`relative isolate aspect-[16/10] overflow-hidden rounded-lg bg-brand-950 text-white sm:aspect-[16/9] lg:aspect-auto lg:h-full lg:min-h-[400px]`,"aria-roledescription":`Karussell`,"aria-label":`Hervorgehobene Neuigkeiten`,onMouseenter:U,onMouseleave:H,onFocusin:U,onFocusout:H},[e(y,{"enter-active-class":`transition-opacity duration-700`,"leave-active-class":`transition-opacity duration-700 absolute inset-0`,"enter-from-class":`opacity-0`,"leave-to-class":`opacity-0`},{default:p(()=>[(d(!0),o(f,null,s(x.posts,(e,t)=>r((d(),o(`img`,{key:e.id,src:e.cover_url,alt:``,class:`absolute inset-0 -z-10 size-full object-cover`},null,8,D)),[[v,t===L.value]])),128))]),_:1}),l[3]||=a(`div`,{class:`absolute inset-0 -z-10 bg-gradient-to-t from-black/80 via-black/35 to-black/5 sm:bg-gradient-to-r sm:from-black/75 sm:via-black/40 sm:to-transparent`},null,-1),a(`div`,O,[z.value.category?(d(),o(`span`,k,m(z.value.category.name),1)):_(``,!0),a(`h2`,A,m(z.value.title),1),z.value.teaser?(d(),o(`p`,j,m(z.value.teaser),1)):_(``,!0),e(n(b),{href:`/neuigkeiten/${z.value.slug}`,class:`mt-5 inline-flex w-fit items-center gap-2 rounded-md bg-brand px-4 py-2.5 text-sm font-medium text-brand-foreground transition-colors hover:bg-brand-700`},{default:p(()=>[l[2]||=t(` Mehr erfahren `,-1),e(n(S),{class:`size-4`})]),_:1},8,[`href`])]),x.posts.length>1?(d(),o(`div`,M,[a(`button`,{type:`button`,class:`grid size-9 place-items-center rounded-full bg-black/35 hover:bg-black/55`,"aria-label":`Vorheriger Beitrag`,onClick:l[0]||=e=>V(L.value-1)},[e(n(C),{class:`size-5`})]),a(`div`,N,[(d(!0),o(f,null,s(x.posts,(e,t)=>(d(),o(`button`,{key:e.id,type:`button`,class:i([`h-1.5 rounded-full transition-all`,t===L.value?`w-6 bg-white`:`w-1.5 bg-white/50 hover:bg-white/80`]),"aria-label":`Beitrag ${t+1} von ${x.posts.length}`,"aria-current":t===L.value,onClick:e=>V(t)},null,10,P))),128))]),a(`button`,{type:`button`,class:`grid size-9 place-items-center rounded-full bg-black/35 hover:bg-black/55`,"aria-label":`Nächster Beitrag`,onClick:l[1]||=e=>V(L.value+1)},[e(n(w),{class:`size-5`})]),a(`button`,{type:`button`,class:`grid size-9 place-items-center rounded-full bg-black/35 hover:bg-black/55`,"aria-label":R.value?`Automatisch weiterblättern`:`Anhalten`,onClick:W},[R.value?(d(),h(n(T),{key:0,class:`size-4`})):(d(),h(n(E),{key:1,class:`size-4`}))],8,F)])):_(``,!0)],32))}},L={__name:`Hero`,props:{posts:{type:Array,required:!0}},setup(e){return(t,n)=>(d(),h(I,{posts:e.posts,class:`h-full`},null,8,[`posts`]))}};export{L as default};
|
||||
import{D as e,E as t,On as n,Yt as r,Zn as i,_ as a,b as o,bt as s,ct as c,g as l,it as u,mt as d,o as f,qt as p,tr as m,v as h,vn as g,y as _}from"./runtime-core.esm-bundler-B8D2lM98.js";import{S as v,n as y}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{n as b}from"./app-qaQo9ARB.js";import{j as x}from"./utils-DfNUDixG.js";import{t as S}from"./arrow-right-CSfG3qiq.js";import{t as C}from"./chevron-left-D2Or6edo.js";import{t as w}from"./chevron-right-2hoRrfAe.js";import{t as T}from"./play-BqfGHciU.js";var E=x({name:`pause`,size:24,node:[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]}),D=[`src`],O={class:`flex h-full flex-col justify-end p-6 sm:max-w-[65%] sm:justify-center sm:p-10`,"aria-live":`polite`},k={key:0,class:`mb-3 w-fit rounded-sm bg-brand px-2 py-0.5 text-[11px] font-semibold tracking-wide text-brand-foreground uppercase`},A={class:`text-2xl leading-tight font-semibold tracking-tight sm:text-[32px]`},j={key:1,class:`mt-3 line-clamp-3 hidden text-[15px] text-white/85 sm:block`},M={key:0,class:`absolute right-4 bottom-4 flex items-center gap-2 sm:right-6 sm:bottom-6`},N={class:`flex items-center gap-1.5 px-1`},P=[`aria-label`,`aria-current`,`onClick`],F=[`aria-label`],I={__name:`HeroSlider`,props:{posts:{type:Array,required:!0}},setup(x){let I=x,L=g(0),R=g(!1),z=l(()=>I.posts[L.value]),B=null;function V(e){L.value=(e+I.posts.length)%I.posts.length}function H(){U(),I.posts.length>1&&!R.value&&!window.matchMedia(`(prefers-reduced-motion: reduce)`).matches&&(B=setInterval(()=>V(L.value+1),7e3))}function U(){clearInterval(B)}function W(){R.value=!R.value,H()}return c(H),u(U),(c,l)=>(d(),o(`section`,{class:`relative isolate aspect-[16/10] overflow-hidden rounded-lg bg-brand-950 text-white sm:aspect-[16/9] lg:aspect-auto lg:h-full lg:min-h-[400px]`,"aria-roledescription":`Karussell`,"aria-label":`Hervorgehobene Neuigkeiten`,onMouseenter:U,onMouseleave:H,onFocusin:U,onFocusout:H},[e(y,{"enter-active-class":`transition-opacity duration-700`,"leave-active-class":`transition-opacity duration-700 absolute inset-0`,"enter-from-class":`opacity-0`,"leave-to-class":`opacity-0`},{default:p(()=>[(d(!0),o(f,null,s(x.posts,(e,t)=>r((d(),o(`img`,{key:e.id,src:e.cover_url,alt:``,class:`absolute inset-0 -z-10 size-full object-cover`},null,8,D)),[[v,t===L.value]])),128))]),_:1}),l[3]||=a(`div`,{class:`absolute inset-0 -z-10 bg-gradient-to-t from-black/80 via-black/35 to-black/5 sm:bg-gradient-to-r sm:from-black/75 sm:via-black/40 sm:to-transparent`},null,-1),a(`div`,O,[z.value.category?(d(),o(`span`,k,m(z.value.category.name),1)):_(``,!0),a(`h2`,A,m(z.value.title),1),z.value.teaser?(d(),o(`p`,j,m(z.value.teaser),1)):_(``,!0),e(n(b),{href:`/neuigkeiten/${z.value.slug}`,class:`mt-5 inline-flex w-fit items-center gap-2 rounded-md bg-brand px-4 py-2.5 text-sm font-medium text-brand-foreground transition-colors hover:bg-brand-700`},{default:p(()=>[l[2]||=t(` Mehr erfahren `,-1),e(n(S),{class:`size-4`})]),_:1},8,[`href`])]),x.posts.length>1?(d(),o(`div`,M,[a(`button`,{type:`button`,class:`grid size-9 place-items-center rounded-full bg-black/35 hover:bg-black/55`,"aria-label":`Vorheriger Beitrag`,onClick:l[0]||=e=>V(L.value-1)},[e(n(C),{class:`size-5`})]),a(`div`,N,[(d(!0),o(f,null,s(x.posts,(e,t)=>(d(),o(`button`,{key:e.id,type:`button`,class:i([`h-1.5 rounded-full transition-all`,t===L.value?`w-6 bg-white`:`w-1.5 bg-white/50 hover:bg-white/80`]),"aria-label":`Beitrag ${t+1} von ${x.posts.length}`,"aria-current":t===L.value,onClick:e=>V(t)},null,10,P))),128))]),a(`button`,{type:`button`,class:`grid size-9 place-items-center rounded-full bg-black/35 hover:bg-black/55`,"aria-label":`Nächster Beitrag`,onClick:l[1]||=e=>V(L.value+1)},[e(n(w),{class:`size-5`})]),a(`button`,{type:`button`,class:`grid size-9 place-items-center rounded-full bg-black/35 hover:bg-black/55`,"aria-label":R.value?`Automatisch weiterblättern`:`Anhalten`,onClick:W},[R.value?(d(),h(n(T),{key:0,class:`size-4`})):(d(),h(n(E),{key:1,class:`size-4`}))],8,F)])):_(``,!0)],32))}},L={__name:`Hero`,props:{posts:{type:Array,required:!0}},setup(e){return(t,n)=>(d(),h(I,{posts:e.posts,class:`h-full`},null,8,[`posts`]))}};export{L as default};
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
|||
import{D as e,E as t,On as n,_ as r,b as i,bt as a,g 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-B3SzpsCA.js";import{t as m}from"./AppLayout-t5KmyFQO.js";import{t as h}from"./calendar-days-Cq3ZXY-S.js";import{A as g,j as _}from"./PersonAvatar-CD4S56En.js";import{t as v}from"./map-pin-DhZUjkWx.js";import{t as y}from"./video-BV0GQFAO.js";import{t as b}from"./EventDateBlock-WbVaROZc.js";import{t as x}from"./EmptyState-Ceq4v8mE.js";var S={key:0,class:`grid max-w-4xl gap-8`},C={class:`mb-3 text-sm font-semibold text-muted-foreground`},w={class:`divide-y rounded-lg border bg-card`},T={class:`min-w-0 flex-1`},E={class:`text-[15px] font-semibold group-hover:underline`},D={class:`mt-0.5 text-[13px] text-muted-foreground`},O={key:0,class:`mt-0.5 flex items-center gap-1.5 text-[13px] text-muted-foreground`},k=[`src`],A={key:1,class:`max-w-4xl rounded-lg border border-dashed bg-card`},j={__name:`Index`,props:{events:{type:Object,required:!0}},setup(j){let M=j,N=o(()=>{let e=[];for(let t of M.events.data){let n=new Date(t.starts_at),r=_((n<new Date?new Date:n).toISOString()),i=e[e.length-1];i?.label===r?i.events.push(t):e.push({label:r,events:[t]})}return e});return(o,_)=>(s(),d(m,{title:`Termine`},{default:l(()=>[_[0]||=r(`div`,{class:`mb-6`},[r(`h1`,{class:`text-2xl font-semibold tracking-tight`},`Termine`),r(`p`,{class:`mt-1 text-sm text-muted-foreground`},`Veranstaltungen, Fortbildungen und Treffen.`)],-1),N.value.length?(s(),i(`div`,S,[(s(!0),i(c,null,a(N.value,o=>(s(),i(`section`,{key:o.label},[r(`h2`,C,u(o.label),1),r(`ul`,w,[(s(!0),i(c,null,a(o.events,a=>(s(),i(`li`,{key:a.id},[e(n(p),{href:`/termine/${a.id}`,class:`group flex items-center gap-4 p-4 transition-colors hover:bg-accent/60`},{default:l(()=>[e(b,{date:a.starts_at,class:`w-14`},null,8,[`date`]),r(`div`,T,[r(`h3`,E,u(a.title),1),r(`p`,D,u(n(g)(a)),1),a.location||a.online_url?(s(),i(`p`,O,[a.location?(s(),d(n(v),{key:0,class:`size-3.5`})):(s(),d(n(y),{key:1,class:`size-3.5`})),t(` `+u(a.location||`Online`),1)])):f(``,!0)]),a.thumb_url?(s(),i(`img`,{key:0,src:a.thumb_url,alt:``,loading:`lazy`,class:`hidden h-16 w-28 shrink-0 rounded-md object-cover sm:block`},null,8,k)):f(``,!0)]),_:2},1032,[`href`])]))),128))])]))),128))])):(s(),i(`div`,A,[e(x,{icon:n(h),title:`Keine anstehenden Termine`,text:`Neue Termine erscheinen hier, sobald sie eingetragen sind.`},null,8,[`icon`])]))]),_:1}))}};export{j as default};
|
||||
import{D as e,E as t,On as n,_ as r,b as i,bt as a,g 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-qaQo9ARB.js";import{t as m}from"./AppLayout-Xi_ip4AB.js";import{t as h}from"./calendar-days-Cq3ZXY-S.js";import{A as g,j as _}from"./PersonAvatar-CD4S56En.js";import{t as v}from"./map-pin-DhZUjkWx.js";import{t as y}from"./video-BV0GQFAO.js";import{t as b}from"./EventDateBlock-WbVaROZc.js";import{t as x}from"./EmptyState-Ceq4v8mE.js";var S={key:0,class:`grid max-w-4xl gap-8`},C={class:`mb-3 text-sm font-semibold text-muted-foreground`},w={class:`divide-y rounded-lg border bg-card`},T={class:`min-w-0 flex-1`},E={class:`text-[15px] font-semibold group-hover:underline`},D={class:`mt-0.5 text-[13px] text-muted-foreground`},O={key:0,class:`mt-0.5 flex items-center gap-1.5 text-[13px] text-muted-foreground`},k=[`src`],A={key:1,class:`max-w-4xl rounded-lg border border-dashed bg-card`},j={__name:`Index`,props:{events:{type:Object,required:!0}},setup(j){let M=j,N=o(()=>{let e=[];for(let t of M.events.data){let n=new Date(t.starts_at),r=_((n<new Date?new Date:n).toISOString()),i=e[e.length-1];i?.label===r?i.events.push(t):e.push({label:r,events:[t]})}return e});return(o,_)=>(s(),d(m,{title:`Termine`},{default:l(()=>[_[0]||=r(`div`,{class:`mb-6`},[r(`h1`,{class:`text-2xl font-semibold tracking-tight`},`Termine`),r(`p`,{class:`mt-1 text-sm text-muted-foreground`},`Veranstaltungen, Fortbildungen und Treffen.`)],-1),N.value.length?(s(),i(`div`,S,[(s(!0),i(c,null,a(N.value,o=>(s(),i(`section`,{key:o.label},[r(`h2`,C,u(o.label),1),r(`ul`,w,[(s(!0),i(c,null,a(o.events,a=>(s(),i(`li`,{key:a.id},[e(n(p),{href:`/termine/${a.id}`,class:`group flex items-center gap-4 p-4 transition-colors hover:bg-accent/60`},{default:l(()=>[e(b,{date:a.starts_at,class:`w-14`},null,8,[`date`]),r(`div`,T,[r(`h3`,E,u(a.title),1),r(`p`,D,u(n(g)(a)),1),a.location||a.online_url?(s(),i(`p`,O,[a.location?(s(),d(n(v),{key:0,class:`size-3.5`})):(s(),d(n(y),{key:1,class:`size-3.5`})),t(` `+u(a.location||`Online`),1)])):f(``,!0)]),a.thumb_url?(s(),i(`img`,{key:0,src:a.thumb_url,alt:``,loading:`lazy`,class:`hidden h-16 w-28 shrink-0 rounded-md object-cover sm:block`},null,8,k)):f(``,!0)]),_:2},1032,[`href`])]))),128))])]))),128))])):(s(),i(`div`,A,[e(x,{icon:n(h),title:`Keine anstehenden Termine`,text:`Neue Termine erscheinen hier, sobald sie eingetragen sind.`},null,8,[`icon`])]))]),_:1}))}};export{j as default};
|
||||
|
|
@ -1,2 +1,2 @@
|
|||
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/EditorialNews-Bb7mPX73.js","assets/runtime-core.esm-bundler-B8D2lM98.js","assets/app-B3SzpsCA.js","assets/runtime-dom.esm-bundler-BEWGoe8n.js","assets/app-k0gPpXCk.css","assets/PersonAvatar-CD4S56En.js","assets/RovingFocusGroup-HoUPhonB.js","assets/utils-DfNUDixG.js","assets/message-square-warning-CzxLG9ol.js","assets/plus-CGTHU-CI.js","assets/button-BVLATeqq.js","assets/Panel-CvqF6bx0.js","assets/chevron-right-2hoRrfAe.js","assets/EditorialPages--e11h67C.js","assets/lock-DtEIVsTL.js","assets/NewPageDialog-CunM9MP1.js","assets/DialogHeader-C1ondDDq.js","assets/Input-DE5SwW-e.js","assets/dist-FqXf5I3H.js","assets/dialog-BS_OCxOd.js"])))=>i.map(i=>d[i]);
|
||||
import{O as e,_ as t,b as n,bt as r,et as i,mt as a,o,qt as s,v as c,wt as l}from"./runtime-core.esm-bundler-B8D2lM98.js";import{o as u}from"./app-B3SzpsCA.js";import{t as d}from"./AppLayout-t5KmyFQO.js";var f={class:`grid items-start gap-6 xl:grid-cols-2`},p={__name:`Index`,props:{sections:{type:Array,required:!0}},setup(p){let m=Object.assign({"../../../../plugins-core/news/resources/js/editorial/EditorialNews.vue":()=>u(()=>import(`./EditorialNews-Bb7mPX73.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])),"../../../../plugins-core/pages/resources/js/editorial/EditorialPages.vue":()=>u(()=>import(`./EditorialPages--e11h67C.js`),__vite__mapDeps([13,1,2,3,4,5,6,7,14,9,10,11,12,15,16,17,18,19]))}),h={};for(let[t,n]of Object.entries(m)){let[,r]=t.match(/plugins-core\/([^/]+)\//);h[`${r}::${t.split(`/`).pop().replace(`.vue`,``)}`]=e(n)}return(e,u)=>(a(),c(d,{title:`Redaktion`},{default:s(()=>[u[0]||=t(`div`,{class:`mb-6`},[t(`h1`,{class:`text-2xl font-semibold tracking-tight`},`Redaktion`),t(`p`,{class:`mt-1 text-sm text-muted-foreground`},`Ihre Seiten und Beiträge – Entwürfe, Freigaben und Geplantes.`)],-1),t(`div`,f,[(a(!0),n(o,null,r(p.sections,e=>(a(),c(l(h[e.component]),i({key:e.key},{ref_for:!0},e.props),null,16))),128))])]),_:1}))}};export{p as default};
|
||||
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/EditorialNews-D3yswKz1.js","assets/runtime-core.esm-bundler-B8D2lM98.js","assets/app-qaQo9ARB.js","assets/runtime-dom.esm-bundler-BEWGoe8n.js","assets/app-0ZlMoGuN.css","assets/PersonAvatar-CD4S56En.js","assets/RovingFocusGroup-HoUPhonB.js","assets/utils-DfNUDixG.js","assets/message-square-warning-CzxLG9ol.js","assets/plus-CGTHU-CI.js","assets/button-BVLATeqq.js","assets/Panel-GlXreVuM.js","assets/chevron-right-2hoRrfAe.js","assets/EditorialPages-Bm4S91x9.js","assets/lock-DtEIVsTL.js","assets/NewPageDialog-D3AfoYKZ.js","assets/DialogHeader-C1ondDDq.js","assets/Input-DE5SwW-e.js","assets/dist-FqXf5I3H.js","assets/dialog-BS_OCxOd.js"])))=>i.map(i=>d[i]);
|
||||
import{O as e,_ as t,b as n,bt as r,et as i,mt as a,o,qt as s,v as c,wt as l}from"./runtime-core.esm-bundler-B8D2lM98.js";import{o as u}from"./app-qaQo9ARB.js";import{t as d}from"./AppLayout-Xi_ip4AB.js";var f={class:`grid items-start gap-6 xl:grid-cols-2`},p={__name:`Index`,props:{sections:{type:Array,required:!0}},setup(p){let m=Object.assign({"../../../../plugins-core/news/resources/js/editorial/EditorialNews.vue":()=>u(()=>import(`./EditorialNews-D3yswKz1.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])),"../../../../plugins-core/pages/resources/js/editorial/EditorialPages.vue":()=>u(()=>import(`./EditorialPages-Bm4S91x9.js`),__vite__mapDeps([13,1,2,3,4,5,6,7,14,9,10,11,12,15,16,17,18,19]))}),h={};for(let[t,n]of Object.entries(m)){let[,r]=t.match(/plugins-core\/([^/]+)\//);h[`${r}::${t.split(`/`).pop().replace(`.vue`,``)}`]=e(n)}return(e,u)=>(a(),c(d,{title:`Redaktion`},{default:s(()=>[u[0]||=t(`div`,{class:`mb-6`},[t(`h1`,{class:`text-2xl font-semibold tracking-tight`},`Redaktion`),t(`p`,{class:`mt-1 text-sm text-muted-foreground`},`Ihre Seiten und Beiträge – Entwürfe, Freigaben und Geplantes.`)],-1),t(`div`,f,[(a(!0),n(o,null,r(p.sections,e=>(a(),c(l(h[e.component]),i({key:e.key},{ref_for:!0},e.props),null,16))),128))])]),_:1}))}};export{p as default};
|
||||
|
|
@ -1 +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{a as p,n as m}from"./app-B3SzpsCA.js";import{t as h}from"./AppLayout-t5KmyFQO.js";import{z as g}from"./PersonAvatar-CD4S56En.js";import{t as _}from"./chevron-left-D2Or6edo.js";import{t as v}from"./chevron-right-2hoRrfAe.js";import{t as y}from"./pen-line-Clpe2kUm.js";import{t as b}from"./EmptyState-Ceq4v8mE.js";import{t as x}from"./button-BVLATeqq.js";import{t as S}from"./NewsCard-KwOJE7h8.js";var C={class:`mb-6 flex flex-wrap items-end justify-between gap-4`},w={key:0,class:`mb-6 flex flex-wrap gap-2`,"aria-label":`Kategorien`},T={key:1,class:`grid gap-5 sm:grid-cols-2 lg:grid-cols-3 2xl:grid-cols-4`},E={key:2,class:`rounded-lg border border-dashed bg-card`},D={key:3,class:`mt-8 flex items-center justify-between`,"aria-label":`Seiten`},O={class:`text-sm text-muted-foreground`},k={class:`flex gap-2`},A={__name:`Index`,props:{posts:{type:Object,required:!0},categories:{type:Array,required:!0},activeCategory:{type:String,default:null},canWrite:{type:Boolean,default:!1}},setup(A){return(j,M)=>(s(),d(h,{title:`Neuigkeiten`},{default:l(()=>[i(`div`,C,[M[3]||=i(`div`,null,[i(`h1`,{class:`text-2xl font-semibold tracking-tight`},`Neuigkeiten`),i(`p`,{class:`mt-1 text-sm text-muted-foreground`},`Aktuelles aus dem Unternehmen und den Bereichen.`)],-1),A.canWrite?(s(),d(n(x),{key:0,"as-child":``},{default:l(()=>[e(n(m),{href:`/redaktion/neuigkeiten/neu`},{default:l(()=>[e(n(y)),M[2]||=t(` Beitrag schreiben`,-1)]),_:1})]),_:1})):f(``,!0)]),A.categories.length?(s(),a(`nav`,w,[e(n(m),{href:`/neuigkeiten`,class:r([`rounded-full border px-3.5 py-1.5 text-[13px] font-medium transition-colors`,A.activeCategory?`bg-card hover:bg-accent`:`border-brand bg-brand text-brand-foreground`]),"preserve-scroll":``},{default:l(()=>[...M[4]||=[t(` Alle `,-1)]]),_:1},8,[`class`]),(s(!0),a(c,null,o(A.categories,e=>(s(),d(n(m),{key:e.slug,href:`/neuigkeiten?kategorie=${e.slug}`,class:r([`rounded-full border px-3.5 py-1.5 text-[13px] font-medium transition-colors`,A.activeCategory===e.slug?`border-brand bg-brand text-brand-foreground`:`bg-card hover:bg-accent`]),"preserve-scroll":``},{default:l(()=>[t(u(e.name),1)]),_:2},1032,[`href`,`class`]))),128))])):f(``,!0),A.posts.data.length?(s(),a(`div`,T,[(s(!0),a(c,null,o(A.posts.data,e=>(s(),d(S,{key:e.id,post:e},null,8,[`post`]))),128))])):(s(),a(`div`,E,[e(b,{icon:n(g),title:`Keine Beiträge`,text:`In dieser Kategorie ist noch nichts veröffentlicht.`},null,8,[`icon`])])),A.posts.meta.last_page>1?(s(),a(`nav`,D,[i(`p`,O,`Seite `+u(A.posts.meta.current_page)+` von `+u(A.posts.meta.last_page),1),i(`div`,k,[e(n(x),{variant:`outline`,size:`sm`,disabled:!A.posts.links.prev,onClick:M[0]||=e=>n(p).get(A.posts.links.prev)},{default:l(()=>[e(n(_)),M[5]||=t(` Neuere`,-1)]),_:1},8,[`disabled`]),e(n(x),{variant:`outline`,size:`sm`,disabled:!A.posts.links.next,onClick:M[1]||=e=>n(p).get(A.posts.links.next)},{default:l(()=>[M[6]||=t(`Ältere `,-1),e(n(v))]),_:1},8,[`disabled`])])])):f(``,!0)]),_:1}))}};export{A as default};
|
||||
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{a as p,n as m}from"./app-qaQo9ARB.js";import{t as h}from"./AppLayout-Xi_ip4AB.js";import{z as g}from"./PersonAvatar-CD4S56En.js";import{t as _}from"./chevron-left-D2Or6edo.js";import{t as v}from"./chevron-right-2hoRrfAe.js";import{t as y}from"./pen-line-Clpe2kUm.js";import{t as b}from"./EmptyState-Ceq4v8mE.js";import{t as x}from"./button-BVLATeqq.js";import{t as S}from"./NewsCard-DI4a_WuI.js";var C={class:`mb-6 flex flex-wrap items-end justify-between gap-4`},w={key:0,class:`mb-6 flex flex-wrap gap-2`,"aria-label":`Kategorien`},T={key:1,class:`grid gap-5 sm:grid-cols-2 lg:grid-cols-3 2xl:grid-cols-4`},E={key:2,class:`rounded-lg border border-dashed bg-card`},D={key:3,class:`mt-8 flex items-center justify-between`,"aria-label":`Seiten`},O={class:`text-sm text-muted-foreground`},k={class:`flex gap-2`},A={__name:`Index`,props:{posts:{type:Object,required:!0},categories:{type:Array,required:!0},activeCategory:{type:String,default:null},canWrite:{type:Boolean,default:!1}},setup(A){return(j,M)=>(s(),d(h,{title:`Neuigkeiten`},{default:l(()=>[i(`div`,C,[M[3]||=i(`div`,null,[i(`h1`,{class:`text-2xl font-semibold tracking-tight`},`Neuigkeiten`),i(`p`,{class:`mt-1 text-sm text-muted-foreground`},`Aktuelles aus dem Unternehmen und den Bereichen.`)],-1),A.canWrite?(s(),d(n(x),{key:0,"as-child":``},{default:l(()=>[e(n(m),{href:`/redaktion/neuigkeiten/neu`},{default:l(()=>[e(n(y)),M[2]||=t(` Beitrag schreiben`,-1)]),_:1})]),_:1})):f(``,!0)]),A.categories.length?(s(),a(`nav`,w,[e(n(m),{href:`/neuigkeiten`,class:r([`rounded-full border px-3.5 py-1.5 text-[13px] font-medium transition-colors`,A.activeCategory?`bg-card hover:bg-accent`:`border-brand bg-brand text-brand-foreground`]),"preserve-scroll":``},{default:l(()=>[...M[4]||=[t(` Alle `,-1)]]),_:1},8,[`class`]),(s(!0),a(c,null,o(A.categories,e=>(s(),d(n(m),{key:e.slug,href:`/neuigkeiten?kategorie=${e.slug}`,class:r([`rounded-full border px-3.5 py-1.5 text-[13px] font-medium transition-colors`,A.activeCategory===e.slug?`border-brand bg-brand text-brand-foreground`:`bg-card hover:bg-accent`]),"preserve-scroll":``},{default:l(()=>[t(u(e.name),1)]),_:2},1032,[`href`,`class`]))),128))])):f(``,!0),A.posts.data.length?(s(),a(`div`,T,[(s(!0),a(c,null,o(A.posts.data,e=>(s(),d(S,{key:e.id,post:e},null,8,[`post`]))),128))])):(s(),a(`div`,E,[e(b,{icon:n(g),title:`Keine Beiträge`,text:`In dieser Kategorie ist noch nichts veröffentlicht.`},null,8,[`icon`])])),A.posts.meta.last_page>1?(s(),a(`nav`,D,[i(`p`,O,`Seite `+u(A.posts.meta.current_page)+` von `+u(A.posts.meta.last_page),1),i(`div`,k,[e(n(x),{variant:`outline`,size:`sm`,disabled:!A.posts.links.prev,onClick:M[0]||=e=>n(p).get(A.posts.links.prev)},{default:l(()=>[e(n(_)),M[5]||=t(` Neuere`,-1)]),_:1},8,[`disabled`]),e(n(x),{variant:`outline`,size:`sm`,disabled:!A.posts.links.next,onClick:M[1]||=e=>n(p).get(A.posts.links.next)},{default:l(()=>[M[6]||=t(`Ältere `,-1),e(n(v))]),_:1},8,[`disabled`])])])):f(``,!0)]),_:1}))}};export{A as default};
|
||||
1
public/build/assets/Index-DqYg_2bO.js
Normal file
1
public/build/assets/Index-DqYg_2bO.js
Normal file
|
|
@ -0,0 +1 @@
|
|||
import{D as e,On as t,_ as n,b as r,bt as i,mt as a,o,qt as s,tr as c,v as l,y as u}from"./runtime-core.esm-bundler-B8D2lM98.js";import{n as d}from"./app-qaQo9ARB.js";import{t as f}from"./AppLayout-Xi_ip4AB.js";import{k as p}from"./PersonAvatar-CD4S56En.js";import{t as m}from"./chevron-right-2hoRrfAe.js";import{t as h}from"./clipboard-list-DLZt3Hel.js";import{t as g}from"./EmptyState-Ceq4v8mE.js";var _={key:0,class:`grid gap-4 md:grid-cols-2 xl:grid-cols-3`},v={class:`grid size-10 shrink-0 place-items-center rounded-lg bg-brand-soft text-brand-text`},y={class:`min-w-0 flex-1`},b={class:`block font-semibold group-hover:underline`},x={key:0,class:`mt-1 line-clamp-2 block text-sm text-muted-foreground`},S={key:1,class:`mt-2 block text-xs text-muted-foreground`},C={key:1,class:`rounded-lg border bg-card`},w={__name:`Index`,props:{forms:{type:Array,required:!0}},setup(w){return(T,E)=>(a(),l(f,{title:`Formulare`},{default:s(()=>[E[0]||=n(`div`,{class:`mb-6`},[n(`h1`,{class:`text-2xl font-semibold tracking-tight`},`Formulare`),n(`p`,{class:`mt-1 text-sm text-muted-foreground`},`Anträge, Anmeldungen und Meldungen – direkt online ausfüllen.`)],-1),w.forms.length?(a(),r(`div`,_,[(a(!0),r(o,null,i(w.forms,i=>(a(),l(t(d),{key:i.id,href:i.url,class:`group flex gap-4 rounded-lg border bg-card p-5 hover:border-brand-300`},{default:s(()=>[n(`span`,v,[e(t(h),{class:`size-5`})]),n(`span`,y,[n(`span`,b,c(i.title),1),i.description?(a(),r(`span`,x,c(i.description),1)):u(``,!0),i.closes_at?(a(),r(`span`,S,`Bis `+c(t(p)(i.closes_at)),1)):u(``,!0)]),e(t(m),{class:`mt-2.5 size-4 shrink-0 text-muted-foreground`})]),_:2},1032,[`href`]))),128))])):(a(),r(`div`,C,[e(g,{icon:t(h),title:`Keine Formulare`,text:`Derzeit sind keine Formulare für Sie freigegeben.`},null,8,[`icon`])]))]),_:1}))}};export{w as default};
|
||||
|
|
@ -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,vn as d,y as f}from"./runtime-core.esm-bundler-B8D2lM98.js";import{n as p}from"./app-B3SzpsCA.js";import{j as m}from"./utils-DfNUDixG.js";import{t as h}from"./AppLayout-t5KmyFQO.js";import{t as g}from"./chevron-right-2hoRrfAe.js";import{t as _}from"./file-text-Dmdo-Zwf.js";import{t as v}from"./plus-CGTHU-CI.js";import{t as y}from"./EmptyState-Ceq4v8mE.js";import{t as b}from"./button-BVLATeqq.js";import{t as x}from"./NewPageDialog-CunM9MP1.js";var S=m({name:`folder-open`,size:24,node:[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]}),C={class:`mb-6 flex flex-wrap items-end justify-between gap-4`},w={key:0,class:`grid gap-5 md:grid-cols-2 xl:grid-cols-3`},T={class:`grid size-10 shrink-0 place-items-center rounded-lg bg-brand-soft text-brand-text`},E={class:`min-w-0 flex-1 truncate font-semibold`},D={key:0,class:`grid p-2`},O={class:`truncate`},k={key:0,class:`text-xs text-muted-foreground`},A={key:0,class:`px-3 py-1.5 text-[13px]`},j={key:1,class:`rounded-lg border bg-card`},M={__name:`Index`,props:{tree:{type:Array,required:!0},canCreate:{type:Boolean,default:!1}},setup(m){let M=d(!1);return(d,N)=>(o(),u(h,{title:`Seiten`},{default:c(()=>[r(`div`,C,[N[3]||=r(`div`,null,[r(`h1`,{class:`text-2xl font-semibold tracking-tight`},`Seiten`),r(`p`,{class:`mt-1 text-sm text-muted-foreground`},`Informationen der Bereiche, Abteilungen und Gremien.`)],-1),m.canCreate?(o(),u(n(b),{key:0,onClick:N[0]||=e=>M.value=!0},{default:c(()=>[e(n(v)),N[2]||=t(` Neue Seite`,-1)]),_:1})):f(``,!0)]),m.tree.length?(o(),i(`div`,w,[(o(!0),i(s,null,a(m.tree,d=>(o(),i(`section`,{key:d.id,class:`rounded-lg border bg-card`},[e(n(p),{href:d.url,class:`flex items-center gap-3 border-b px-5 py-4 hover:bg-accent/50`},{default:c(()=>[r(`span`,T,[d.children.length?(o(),u(n(S),{key:0,class:`size-5`})):(o(),u(n(_),{key:1,class:`size-5`}))]),r(`span`,E,l(d.title),1),e(n(g),{class:`size-4 text-muted-foreground`})]),_:2},1032,[`href`]),d.children.length?(o(),i(`ul`,D,[(o(!0),i(s,null,a(d.children.slice(0,8),t=>(o(),i(`li`,{key:t.id},[e(n(p),{href:t.url,class:`flex items-center justify-between rounded-md px-3 py-2 text-sm hover:bg-accent`},{default:c(()=>[r(`span`,O,l(t.title),1),t.children.length?(o(),i(`span`,k,l(t.children.length),1)):f(``,!0)]),_:2},1032,[`href`])]))),128)),d.children.length>8?(o(),i(`li`,A,[e(n(p),{href:d.url,class:`font-medium text-brand-text hover:underline`},{default:c(()=>[t(`Alle `+l(d.children.length)+` Seiten`,1)]),_:2},1032,[`href`])])):f(``,!0)])):f(``,!0)]))),128))])):(o(),i(`div`,j,[e(y,{icon:n(_),title:`Noch keine Seiten`,text:`Hier erscheinen Seiten, sobald sie veröffentlicht sind.`},null,8,[`icon`])])),e(x,{open:M.value,"onUpdate:open":N[1]||=e=>M.value=e},null,8,[`open`])]),_:1}))}};export{M 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,vn as d,y as f}from"./runtime-core.esm-bundler-B8D2lM98.js";import{n as p}from"./app-qaQo9ARB.js";import{j as m}from"./utils-DfNUDixG.js";import{t as h}from"./AppLayout-Xi_ip4AB.js";import{t as g}from"./chevron-right-2hoRrfAe.js";import{t as _}from"./file-text-Dmdo-Zwf.js";import{t as v}from"./plus-CGTHU-CI.js";import{t as y}from"./EmptyState-Ceq4v8mE.js";import{t as b}from"./button-BVLATeqq.js";import{t as x}from"./NewPageDialog-D3AfoYKZ.js";var S=m({name:`folder-open`,size:24,node:[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]}),C={class:`mb-6 flex flex-wrap items-end justify-between gap-4`},w={key:0,class:`grid gap-5 md:grid-cols-2 xl:grid-cols-3`},T={class:`grid size-10 shrink-0 place-items-center rounded-lg bg-brand-soft text-brand-text`},E={class:`min-w-0 flex-1 truncate font-semibold`},D={key:0,class:`grid p-2`},O={class:`truncate`},k={key:0,class:`text-xs text-muted-foreground`},A={key:0,class:`px-3 py-1.5 text-[13px]`},j={key:1,class:`rounded-lg border bg-card`},M={__name:`Index`,props:{tree:{type:Array,required:!0},canCreate:{type:Boolean,default:!1}},setup(m){let M=d(!1);return(d,N)=>(o(),u(h,{title:`Seiten`},{default:c(()=>[r(`div`,C,[N[3]||=r(`div`,null,[r(`h1`,{class:`text-2xl font-semibold tracking-tight`},`Seiten`),r(`p`,{class:`mt-1 text-sm text-muted-foreground`},`Informationen der Bereiche, Abteilungen und Gremien.`)],-1),m.canCreate?(o(),u(n(b),{key:0,onClick:N[0]||=e=>M.value=!0},{default:c(()=>[e(n(v)),N[2]||=t(` Neue Seite`,-1)]),_:1})):f(``,!0)]),m.tree.length?(o(),i(`div`,w,[(o(!0),i(s,null,a(m.tree,d=>(o(),i(`section`,{key:d.id,class:`rounded-lg border bg-card`},[e(n(p),{href:d.url,class:`flex items-center gap-3 border-b px-5 py-4 hover:bg-accent/50`},{default:c(()=>[r(`span`,T,[d.children.length?(o(),u(n(S),{key:0,class:`size-5`})):(o(),u(n(_),{key:1,class:`size-5`}))]),r(`span`,E,l(d.title),1),e(n(g),{class:`size-4 text-muted-foreground`})]),_:2},1032,[`href`]),d.children.length?(o(),i(`ul`,D,[(o(!0),i(s,null,a(d.children.slice(0,8),t=>(o(),i(`li`,{key:t.id},[e(n(p),{href:t.url,class:`flex items-center justify-between rounded-md px-3 py-2 text-sm hover:bg-accent`},{default:c(()=>[r(`span`,O,l(t.title),1),t.children.length?(o(),i(`span`,k,l(t.children.length),1)):f(``,!0)]),_:2},1032,[`href`])]))),128)),d.children.length>8?(o(),i(`li`,A,[e(n(p),{href:d.url,class:`font-medium text-brand-text hover:underline`},{default:c(()=>[t(`Alle `+l(d.children.length)+` Seiten`,1)]),_:2},1032,[`href`])])):f(``,!0)])):f(``,!0)]))),128))])):(o(),i(`div`,j,[e(y,{icon:n(_),title:`Noch keine Seiten`,text:`Hier erscheinen Seiten, sobald sie veröffentlicht sind.`},null,8,[`icon`])])),e(x,{open:M.value,"onUpdate:open":N[1]||=e=>M.value=e},null,8,[`open`])]),_:1}))}};export{M as default};
|
||||
|
|
@ -1 +1 @@
|
|||
import{On as e,Zn as t,b as n,bt as r,mt as i,o as a,qt as o,v as s,y as c}from"./runtime-core.esm-bundler-B8D2lM98.js";import{z as l}from"./PersonAvatar-CD4S56En.js";import{t as u}from"./EmptyState-Ceq4v8mE.js";import{t as d}from"./Panel-CvqF6bx0.js";import{t as f}from"./NewsListItem-CPNO5liG.js";var p={key:0,href:`/admin/neuigkeiten/neu`,class:`mt-4 text-sm font-medium text-brand-text hover:underline`},m={__name:`Latest`,props:{posts:{type:Array,required:!0},canWrite:{type:Boolean,default:!1},wide:{type:Boolean,default:!1}},setup(m){return(h,g)=>(i(),s(d,{title:`Neuigkeiten`,"action-label":`Alle anzeigen`,"action-href":`/neuigkeiten`},{default:o(()=>[m.posts.length?(i(),n(`div`,{key:0,class:t([`-my-3 divide-y`,{"sm:grid sm:grid-cols-2 sm:gap-x-6 sm:divide-y-0":m.wide}])},[(i(!0),n(a,null,r(m.posts,e=>(i(),s(f,{key:e.id,post:e},null,8,[`post`]))),128))],2)):(i(),s(u,{key:1,icon:e(l),title:`Noch keine Neuigkeiten`,text:`Sobald Beiträge veröffentlicht sind, erscheinen sie hier.`},{default:o(()=>[m.canWrite?(i(),n(`a`,p,`Ersten Beitrag schreiben`)):c(``,!0)]),_:1},8,[`icon`]))]),_:1}))}};export{m as default};
|
||||
import{On as e,Zn as t,b as n,bt as r,mt as i,o as a,qt as o,v as s,y as c}from"./runtime-core.esm-bundler-B8D2lM98.js";import{z as l}from"./PersonAvatar-CD4S56En.js";import{t as u}from"./EmptyState-Ceq4v8mE.js";import{t as d}from"./Panel-GlXreVuM.js";import{t as f}from"./NewsListItem-RJ4Ryvod.js";var p={key:0,href:`/admin/neuigkeiten/neu`,class:`mt-4 text-sm font-medium text-brand-text hover:underline`},m={__name:`Latest`,props:{posts:{type:Array,required:!0},canWrite:{type:Boolean,default:!1},wide:{type:Boolean,default:!1}},setup(m){return(h,g)=>(i(),s(d,{title:`Neuigkeiten`,"action-label":`Alle anzeigen`,"action-href":`/neuigkeiten`},{default:o(()=>[m.posts.length?(i(),n(`div`,{key:0,class:t([`-my-3 divide-y`,{"sm:grid sm:grid-cols-2 sm:gap-x-6 sm:divide-y-0":m.wide}])},[(i(!0),n(a,null,r(m.posts,e=>(i(),s(f,{key:e.id,post:e},null,8,[`post`]))),128))],2)):(i(),s(u,{key:1,icon:e(l),title:`Noch keine Neuigkeiten`,text:`Sobald Beiträge veröffentlicht sind, erscheinen sie hier.`},{default:o(()=>[m.canWrite?(i(),n(`a`,p,`Ersten Beitrag schreiben`)):c(``,!0)]),_:1},8,[`icon`]))]),_:1}))}};export{m as default};
|
||||
|
|
@ -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-B3SzpsCA.js";import{t as p}from"./chevron-right-2hoRrfAe.js";import{t as m}from"./NewsCard-KwOJE7h8.js";import{t as h}from"./NewsListItem-CPNO5liG.js";var g={key:0,class:`mb-3 flex items-center justify-between gap-4`},_={class:`text-lg font-semibold`},v={key:1,class:`divide-y rounded-lg border bg-card px-4`},y={key:2,class:`grid gap-5 @xl:grid-cols-2 @4xl:grid-cols-3`},b={key:3,class:`text-sm text-muted-foreground`},x={__name:`LatestNews`,props:{block:{type:Object,required:!0}},setup(x){return(S,C)=>(o(),i(`section`,null,[x.block.data.title?(o(),i(`div`,g,[r(`h3`,_,l(x.block.data.title),1),x.block.props?.more_url?(o(),u(n(f),{key:0,href:x.block.props.more_url,class:`inline-flex items-center gap-0.5 text-[13px] font-medium text-brand-text hover:underline`},{default:c(()=>[C[0]||=t(` Alle anzeigen `,-1),e(n(p),{class:`size-3.5`})]),_:1},8,[`href`])):d(``,!0)])):d(``,!0),x.block.data.layout===`list`?(o(),i(`div`,v,[(o(!0),i(s,null,a(x.block.props?.posts??[],e=>(o(),u(h,{key:e.id,post:e},null,8,[`post`]))),128))])):(o(),i(`div`,y,[(o(!0),i(s,null,a(x.block.props?.posts??[],e=>(o(),u(m,{key:e.id,post:e},null,8,[`post`]))),128))])),(x.block.props?.posts??[]).length?d(``,!0):(o(),i(`p`,b,`Keine Beiträge.`))]))}};export{x 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-qaQo9ARB.js";import{t as p}from"./chevron-right-2hoRrfAe.js";import{t as m}from"./NewsCard-DI4a_WuI.js";import{t as h}from"./NewsListItem-RJ4Ryvod.js";var g={key:0,class:`mb-3 flex items-center justify-between gap-4`},_={class:`text-lg font-semibold`},v={key:1,class:`divide-y rounded-lg border bg-card px-4`},y={key:2,class:`grid gap-5 @xl:grid-cols-2 @4xl:grid-cols-3`},b={key:3,class:`text-sm text-muted-foreground`},x={__name:`LatestNews`,props:{block:{type:Object,required:!0}},setup(x){return(S,C)=>(o(),i(`section`,null,[x.block.data.title?(o(),i(`div`,g,[r(`h3`,_,l(x.block.data.title),1),x.block.props?.more_url?(o(),u(n(f),{key:0,href:x.block.props.more_url,class:`inline-flex items-center gap-0.5 text-[13px] font-medium text-brand-text hover:underline`},{default:c(()=>[C[0]||=t(` Alle anzeigen `,-1),e(n(p),{class:`size-3.5`})]),_:1},8,[`href`])):d(``,!0)])):d(``,!0),x.block.data.layout===`list`?(o(),i(`div`,v,[(o(!0),i(s,null,a(x.block.props?.posts??[],e=>(o(),u(h,{key:e.id,post:e},null,8,[`post`]))),128))])):(o(),i(`div`,y,[(o(!0),i(s,null,a(x.block.props?.posts??[],e=>(o(),u(m,{key:e.id,post:e},null,8,[`post`]))),128))])),(x.block.props?.posts??[]).length?d(``,!0):(o(),i(`p`,b,`Keine Beiträge.`))]))}};export{x as default};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
public/build/assets/NativeSelect-BmmO8Miz.js
Normal file
1
public/build/assets/NativeSelect-BmmO8Miz.js
Normal file
|
|
@ -0,0 +1 @@
|
|||
import{$ as e,D as t,Ft as n,On as r,Yt as i,_ as a,b as o,bt as s,et as c,mt as l,o as u,tr as d,y as f}from"./runtime-core.esm-bundler-B8D2lM98.js";import{b as p}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{j as m}from"./utils-DfNUDixG.js";import{W as h}from"./PersonAvatar-CD4S56En.js";var g=m({name:`send`,size:24,node:[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]}),_={class:`relative`},v={key:0,value:null},y=[`value`],b={__name:`NativeSelect`,props:e({options:{type:Array,required:!0},placeholder:{type:String,default:``}},{modelValue:{type:[String,Number,null],default:null},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let m=n(e,`modelValue`);return(n,g)=>(l(),o(`div`,_,[i(a(`select`,c({"onUpdate:modelValue":g[0]||=e=>m.value=e,class:`h-9 w-full appearance-none rounded-md border border-input bg-card pr-8 pl-3 text-sm shadow-xs focus-visible:border-brand-400 focus-visible:ring-3 focus-visible:ring-ring/30 focus-visible:outline-none disabled:opacity-60`},n.$attrs),[e.placeholder?(l(),o(`option`,v,d(e.placeholder),1)):f(``,!0),(l(!0),o(u,null,s(e.options,e=>(l(),o(`option`,{key:e.value,value:e.value},d(e.label),9,y))),128))],16),[[p,m.value]]),t(r(h),{class:`pointer-events-none absolute top-1/2 right-2.5 size-4 -translate-y-1/2 text-muted-foreground`})]))}};export{g as n,b as t};
|
||||
|
|
@ -1 +1 @@
|
|||
import{D as e,On as t,_ as n,b as r,bt as i,mt as a,o,qt as s,tr as c,v as l}from"./runtime-core.esm-bundler-B8D2lM98.js";import{n as u}from"./app-B3SzpsCA.js";import{t as d}from"./PersonAvatar-CD4S56En.js";import{t as f}from"./Panel-CvqF6bx0.js";var p={class:`grid gap-3 sm:grid-cols-2 xl:grid-cols-3`},m={class:`min-w-0`},h={class:`truncate text-sm font-semibold`},g={class:`truncate text-[13px] text-muted-foreground`},_={__name:`NewColleagues`,props:{people:{type:Array,required:!0}},setup(_){return(v,y)=>(a(),l(f,{title:`Neu im Team`,"action-label":`Alle Personen`,"action-href":`/personen`},{default:s(()=>[n(`ul`,p,[(a(!0),r(o,null,i(_.people,i=>(a(),r(`li`,{key:i.id},[e(t(u),{href:`/personen/${i.id}`,class:`flex items-center gap-3 rounded-lg border p-3 transition-colors hover:bg-accent`},{default:s(()=>[e(d,{person:i,class:`size-11`},null,8,[`person`]),n(`div`,m,[n(`div`,h,c(i.name),1),n(`div`,g,c(i.job_title||i.department),1)])]),_:2},1032,[`href`])]))),128))])]),_:1}))}};export{_ as default};
|
||||
import{D as e,On as t,_ as n,b as r,bt as i,mt as a,o,qt as s,tr as c,v as l}from"./runtime-core.esm-bundler-B8D2lM98.js";import{n as u}from"./app-qaQo9ARB.js";import{t as d}from"./PersonAvatar-CD4S56En.js";import{t as f}from"./Panel-GlXreVuM.js";var p={class:`grid gap-3 sm:grid-cols-2 xl:grid-cols-3`},m={class:`min-w-0`},h={class:`truncate text-sm font-semibold`},g={class:`truncate text-[13px] text-muted-foreground`},_={__name:`NewColleagues`,props:{people:{type:Array,required:!0}},setup(_){return(v,y)=>(a(),l(f,{title:`Neu im Team`,"action-label":`Alle Personen`,"action-href":`/personen`},{default:s(()=>[n(`ul`,p,[(a(!0),r(o,null,i(_.people,i=>(a(),r(`li`,{key:i.id},[e(t(u),{href:`/personen/${i.id}`,class:`flex items-center gap-3 rounded-lg border p-3 transition-colors hover:bg-accent`},{default:s(()=>[e(d,{person:i,class:`size-11`},null,8,[`person`]),n(`div`,m,[n(`div`,h,c(i.name),1),n(`div`,g,c(i.job_title||i.department),1)])]),_:2},1032,[`href`])]))),128))])]),_:1}))}};export{_ as default};
|
||||
|
|
@ -1 +1 @@
|
|||
import{$ as e,D as t,E as n,Ft as r,Ht as i,On as a,_ as o,b as s,mt as c,qt as l,tr as u,v as d,y as f}from"./runtime-core.esm-bundler-B8D2lM98.js";import{w as p}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{r as m}from"./app-B3SzpsCA.js";import{n as h,t as g}from"./DialogHeader-C1ondDDq.js";import{t as _}from"./button-BVLATeqq.js";import{t as v}from"./Input-DE5SwW-e.js";import{i as y,n as b,r as x,t as S}from"./dialog-BS_OCxOd.js";var C={class:`grid gap-1.5`},w={key:0,class:`text-[13px] text-destructive`},T={__name:`NewPageDialog`,props:e({parentId:{type:Number,default:null},parentTitle:{type:String,default:``}},{open:{type:Boolean,default:!1},openModifiers:{}}),emits:e([`before-create`],[`update:open`]),setup(e,{emit:T}){let E=e,D=r(e,`open`),O=T,k=m({title:``,parent_id:null});i(D,e=>e&&(k.reset(),k.clearErrors()));async function A(){O(`before-create`),k.parent_id=E.parentId,k.post(`/redaktion/seiten`)}return(r,i)=>(c(),d(a(y),{open:D.value,"onUpdate:open":i[2]||=e=>D.value=e},{default:l(()=>[t(a(x),{class:`sm:max-w-md`},{default:l(()=>[t(a(g),null,{default:l(()=>[t(a(S),null,{default:l(()=>[n(u(e.parentId?`Unterseite anlegen`:`Neue Seite`),1)]),_:1}),e.parentId?(c(),d(a(h),{key:0},{default:l(()=>[n(`Unter „`+u(e.parentTitle)+`“. Die Seite ist erst nach dem Veröffentlichen sichtbar.`,1)]),_:1})):(c(),d(a(h),{key:1},{default:l(()=>[...i[3]||=[n(`Auf der obersten Ebene. Die Seite ist erst nach dem Veröffentlichen sichtbar.`,-1)]]),_:1}))]),_:1}),o(`form`,{class:`grid gap-4`,onSubmit:p(A,[`prevent`])},[o(`label`,C,[i[4]||=o(`span`,{class:`text-[13px] font-medium`},`Titel`,-1),t(a(v),{modelValue:a(k).title,"onUpdate:modelValue":i[0]||=e=>a(k).title=e,maxlength:`200`,autofocus:``,"aria-invalid":!!a(k).errors.title},null,8,[`modelValue`,`aria-invalid`]),a(k).errors.title?(c(),s(`span`,w,u(a(k).errors.title),1)):f(``,!0)]),t(a(b),null,{default:l(()=>[t(a(_),{type:`button`,variant:`outline`,onClick:i[1]||=e=>D.value=!1},{default:l(()=>[...i[5]||=[n(`Abbrechen`,-1)]]),_:1}),t(a(_),{type:`submit`,disabled:a(k).processing||!a(k).title.trim()},{default:l(()=>[...i[6]||=[n(`Anlegen und bearbeiten`,-1)]]),_:1},8,[`disabled`])]),_:1})],32)]),_:1})]),_:1},8,[`open`]))}};export{T as t};
|
||||
import{$ as e,D as t,E as n,Ft as r,Ht as i,On as a,_ as o,b as s,mt as c,qt as l,tr as u,v as d,y as f}from"./runtime-core.esm-bundler-B8D2lM98.js";import{w as p}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{r as m}from"./app-qaQo9ARB.js";import{n as h,t as g}from"./DialogHeader-C1ondDDq.js";import{t as _}from"./button-BVLATeqq.js";import{t as v}from"./Input-DE5SwW-e.js";import{i as y,n as b,r as x,t as S}from"./dialog-BS_OCxOd.js";var C={class:`grid gap-1.5`},w={key:0,class:`text-[13px] text-destructive`},T={__name:`NewPageDialog`,props:e({parentId:{type:Number,default:null},parentTitle:{type:String,default:``}},{open:{type:Boolean,default:!1},openModifiers:{}}),emits:e([`before-create`],[`update:open`]),setup(e,{emit:T}){let E=e,D=r(e,`open`),O=T,k=m({title:``,parent_id:null});i(D,e=>e&&(k.reset(),k.clearErrors()));async function A(){O(`before-create`),k.parent_id=E.parentId,k.post(`/redaktion/seiten`)}return(r,i)=>(c(),d(a(y),{open:D.value,"onUpdate:open":i[2]||=e=>D.value=e},{default:l(()=>[t(a(x),{class:`sm:max-w-md`},{default:l(()=>[t(a(g),null,{default:l(()=>[t(a(S),null,{default:l(()=>[n(u(e.parentId?`Unterseite anlegen`:`Neue Seite`),1)]),_:1}),e.parentId?(c(),d(a(h),{key:0},{default:l(()=>[n(`Unter „`+u(e.parentTitle)+`“. Die Seite ist erst nach dem Veröffentlichen sichtbar.`,1)]),_:1})):(c(),d(a(h),{key:1},{default:l(()=>[...i[3]||=[n(`Auf der obersten Ebene. Die Seite ist erst nach dem Veröffentlichen sichtbar.`,-1)]]),_:1}))]),_:1}),o(`form`,{class:`grid gap-4`,onSubmit:p(A,[`prevent`])},[o(`label`,C,[i[4]||=o(`span`,{class:`text-[13px] font-medium`},`Titel`,-1),t(a(v),{modelValue:a(k).title,"onUpdate:modelValue":i[0]||=e=>a(k).title=e,maxlength:`200`,autofocus:``,"aria-invalid":!!a(k).errors.title},null,8,[`modelValue`,`aria-invalid`]),a(k).errors.title?(c(),s(`span`,w,u(a(k).errors.title),1)):f(``,!0)]),t(a(b),null,{default:l(()=>[t(a(_),{type:`button`,variant:`outline`,onClick:i[1]||=e=>D.value=!1},{default:l(()=>[...i[5]||=[n(`Abbrechen`,-1)]]),_:1}),t(a(_),{type:`submit`,disabled:a(k).processing||!a(k).title.trim()},{default:l(()=>[...i[6]||=[n(`Anlegen und bearbeiten`,-1)]]),_:1},8,[`disabled`])]),_:1})],32)]),_:1})]),_:1},8,[`open`]))}};export{T as t};
|
||||
|
|
@ -1 +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-B3SzpsCA.js";import{N as u}from"./PersonAvatar-CD4S56En.js";import{n as d,t as f}from"./NewsImage-CU6jD5fm.js";var p={class:`flex flex-1 flex-col p-4`},m={class:`mt-1 line-clamp-2 text-[15px] leading-snug font-semibold group-hover:underline`},h={key:0,class:`mt-1.5 line-clamp-2 text-[13px] text-muted-foreground`},g={class:`mt-auto pt-3 text-xs text-muted-foreground`},_={__name:`NewsCard`,props:{post:{type:Object,required:!0}},setup(_){return(v,y)=>(i(),s(t(l),{href:`/neuigkeiten/${_.post.slug}`,class:`group flex h-full flex-col overflow-hidden rounded-lg border bg-card transition-shadow hover:shadow-md`},{default:a(()=>[e(f,{src:_.post.thumb_url,alt:_.post.title},null,8,[`src`,`alt`]),n(`div`,p,[e(d,{category:_.post.category},null,8,[`category`]),n(`h3`,m,o(_.post.title),1),_.post.teaser?(i(),r(`p`,h,o(_.post.teaser),1)):c(``,!0),n(`p`,g,o(t(u)(_.post.published_at))+` · `+o(_.post.reading_minutes)+` Min.`,1)])]),_:1},8,[`href`]))}};export{_ as t};
|
||||
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-qaQo9ARB.js";import{N as u}from"./PersonAvatar-CD4S56En.js";import{n as d,t as f}from"./NewsImage-CU6jD5fm.js";var p={class:`flex flex-1 flex-col p-4`},m={class:`mt-1 line-clamp-2 text-[15px] leading-snug font-semibold group-hover:underline`},h={key:0,class:`mt-1.5 line-clamp-2 text-[13px] text-muted-foreground`},g={class:`mt-auto pt-3 text-xs text-muted-foreground`},_={__name:`NewsCard`,props:{post:{type:Object,required:!0}},setup(_){return(v,y)=>(i(),s(t(l),{href:`/neuigkeiten/${_.post.slug}`,class:`group flex h-full flex-col overflow-hidden rounded-lg border bg-card transition-shadow hover:shadow-md`},{default:a(()=>[e(f,{src:_.post.thumb_url,alt:_.post.title},null,8,[`src`,`alt`]),n(`div`,p,[e(d,{category:_.post.category},null,8,[`category`]),n(`h3`,m,o(_.post.title),1),_.post.teaser?(i(),r(`p`,h,o(_.post.teaser),1)):c(``,!0),n(`p`,g,o(t(u)(_.post.published_at))+` · `+o(_.post.reading_minutes)+` Min.`,1)])]),_:1},8,[`href`]))}};export{_ as t};
|
||||
|
|
@ -1 +1 @@
|
|||
import{D as e,On as t,_ as n,mt as r,qt as i,tr as a,v as o}from"./runtime-core.esm-bundler-B8D2lM98.js";import{n as s}from"./app-B3SzpsCA.js";import{M as c}from"./PersonAvatar-CD4S56En.js";import{n as l,t as u}from"./NewsImage-CU6jD5fm.js";var d={class:`min-w-0`},f={class:`mt-0.5 line-clamp-2 text-sm leading-snug font-semibold group-hover:underline`},p={class:`mt-1 text-xs text-muted-foreground`},m={__name:`NewsListItem`,props:{post:{type:Object,required:!0}},setup(m){return(h,g)=>(r(),o(t(s),{href:`/neuigkeiten/${m.post.slug}`,class:`group flex gap-4 py-3`},{default:i(()=>[e(u,{src:m.post.thumb_url,alt:m.post.title,class:`w-28 shrink-0 rounded-md sm:w-32`},null,8,[`src`,`alt`]),n(`div`,d,[e(l,{category:m.post.category},null,8,[`category`]),n(`h3`,f,a(m.post.title),1),n(`p`,p,a(t(c)(m.post.published_at)),1)])]),_:1},8,[`href`]))}};export{m as t};
|
||||
import{D as e,On as t,_ as n,mt as r,qt as i,tr as a,v as o}from"./runtime-core.esm-bundler-B8D2lM98.js";import{n as s}from"./app-qaQo9ARB.js";import{M as c}from"./PersonAvatar-CD4S56En.js";import{n as l,t as u}from"./NewsImage-CU6jD5fm.js";var d={class:`min-w-0`},f={class:`mt-0.5 line-clamp-2 text-sm leading-snug font-semibold group-hover:underline`},p={class:`mt-1 text-xs text-muted-foreground`},m={__name:`NewsListItem`,props:{post:{type:Object,required:!0}},setup(m){return(h,g)=>(r(),o(t(s),{href:`/neuigkeiten/${m.post.slug}`,class:`group flex gap-4 py-3`},{default:i(()=>[e(u,{src:m.post.thumb_url,alt:m.post.title,class:`w-28 shrink-0 rounded-md sm:w-32`},null,8,[`src`,`alt`]),n(`div`,d,[e(l,{category:m.post.category},null,8,[`category`]),n(`h3`,f,a(m.post.title),1),n(`p`,p,a(t(c)(m.post.published_at)),1)])]),_:1},8,[`href`]))}};export{m as t};
|
||||
|
|
@ -1,2 +1,2 @@
|
|||
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Accordion-kh4bR1O0.js","assets/RovingFocusGroup-HoUPhonB.js","assets/runtime-core.esm-bundler-B8D2lM98.js","assets/runtime-dom.esm-bundler-BEWGoe8n.js","assets/utils-DfNUDixG.js","assets/PersonAvatar-CD4S56En.js","assets/isValueEqualOrExist-BxQAPnq1.js","assets/Box-m5dU6NxE.js","assets/lightbulb-Crmh5htw.js","assets/Buttons-0bwW4Lhd.js","assets/button-BVLATeqq.js","assets/Columns-TRpz0IQV.js","assets/Contacts-D0PmgYoZ.js","assets/app-B3SzpsCA.js","assets/app-k0gPpXCk.css","assets/phone-BCjoS6Xy.js","assets/Divider-Cy8eDUk0.js","assets/Gallery-Ck19doXW.js","assets/image-B2vtsdro.js","assets/dialog-BS_OCxOd.js","assets/Heading-DMxvt-j4.js","assets/Hero-Cl8lLWJ_.js","assets/IconList-CTeo3kNz.js","assets/icons-6gNUNtiS.js","assets/building-complex-Drk3TBKp.js","assets/calendar-days-Cq3ZXY-S.js","assets/clock-IVbPqglU.js","assets/file-text-Dmdo-Zwf.js","assets/link-BE7bRFjZ.js","assets/Image-B7bTEMBH.js","assets/Quote-iODkllPL.js","assets/Section-DitqUeMx.js","assets/Spacer-B_j09dx4.js","assets/Table-Cen5s9kd.js","assets/Tabs-BDTYa4sI.js","assets/RovingFocusItem-B-_GxVPM.js","assets/Text-B3WYCg20.js","assets/Video-Bq7HXVFd.js","assets/play-BqfGHciU.js","assets/video-BV0GQFAO.js","assets/UpcomingEvents-CQi7P2f6.js","assets/chevron-right-2hoRrfAe.js","assets/EventListItem-BBsqXvqV.js","assets/EventDateBlock-WbVaROZc.js","assets/LatestNews-pDVMtQeO.js","assets/NewsCard-KwOJE7h8.js","assets/NewsImage-CU6jD5fm.js","assets/NewsListItem-CPNO5liG.js","assets/Downloads-BpgMfpKo.js","assets/Subpages-D_0VT6fx.js"])))=>i.map(i=>d[i]);
|
||||
import{D as e,J as t,O as n,On as r,b as i,bt as a,g as o,gt as s,mt as c,o as l,v as u,wt as d,y as f}from"./runtime-core.esm-bundler-B8D2lM98.js";import{o as p}from"./app-B3SzpsCA.js";var m=Object.assign({"./blocks/Accordion.vue":()=>p(()=>import(`./Accordion-kh4bR1O0.js`),__vite__mapDeps([0,1,2,3,4,5,6])),"./blocks/Box.vue":()=>p(()=>import(`./Box-m5dU6NxE.js`),__vite__mapDeps([7,2,4,5,1,3,8])),"./blocks/Buttons.vue":()=>p(()=>import(`./Buttons-0bwW4Lhd.js`),__vite__mapDeps([9,2,4,10])),"./blocks/Columns.vue":()=>p(()=>import(`./Columns-TRpz0IQV.js`),__vite__mapDeps([11,2])),"./blocks/Contacts.vue":()=>p(()=>import(`./Contacts-D0PmgYoZ.js`),__vite__mapDeps([12,2,13,3,14,5,1,4,15])),"./blocks/Divider.vue":()=>p(()=>import(`./Divider-Cy8eDUk0.js`),__vite__mapDeps([16,2])),"./blocks/Gallery.vue":()=>p(()=>import(`./Gallery-Ck19doXW.js`),__vite__mapDeps([17,2,18,4,19,1,3,5,10])),"./blocks/Heading.vue":()=>p(()=>import(`./Heading-DMxvt-j4.js`),__vite__mapDeps([20,2,3])),"./blocks/Hero.vue":()=>p(()=>import(`./Hero-Cl8lLWJ_.js`),__vite__mapDeps([21,2,10,4])),"./blocks/IconList.vue":()=>p(()=>import(`./IconList-CTeo3kNz.js`),__vite__mapDeps([22,2,23,4,24,25,5,1,3,26,27,8,28,15])),"./blocks/Image.vue":()=>p(()=>import(`./Image-B7bTEMBH.js`),__vite__mapDeps([29,2,18,4])),"./blocks/Quote.vue":()=>p(()=>import(`./Quote-iODkllPL.js`),__vite__mapDeps([30,2])),"./blocks/Section.vue":()=>p(()=>import(`./Section-DitqUeMx.js`),__vite__mapDeps([31,2])),"./blocks/Spacer.vue":()=>p(()=>import(`./Spacer-B_j09dx4.js`),__vite__mapDeps([32,2])),"./blocks/Table.vue":()=>p(()=>import(`./Table-Cen5s9kd.js`),__vite__mapDeps([33,2])),"./blocks/Tabs.vue":()=>p(()=>import(`./Tabs-BDTYa4sI.js`),__vite__mapDeps([34,1,2,3,4,35])),"./blocks/Text.vue":()=>p(()=>import(`./Text-B3WYCg20.js`),__vite__mapDeps([36,2,13,3,14])),"./blocks/Video.vue":()=>p(()=>import(`./Video-Bq7HXVFd.js`),__vite__mapDeps([37,2,38,4,39]))}),h=Object.assign({"../../../plugins-core/events/resources/js/blocks/UpcomingEvents.vue":()=>p(()=>import(`./UpcomingEvents-CQi7P2f6.js`),__vite__mapDeps([40,2,13,3,14,41,4,42,5,1,43])),"../../../plugins-core/news/resources/js/blocks/LatestNews.vue":()=>p(()=>import(`./LatestNews-pDVMtQeO.js`),__vite__mapDeps([44,2,13,3,14,41,4,45,5,1,46,47])),"../../../plugins-core/pages/resources/js/blocks/Downloads.vue":()=>p(()=>import(`./Downloads-BpgMfpKo.js`),__vite__mapDeps([48,2,4,27])),"../../../plugins-core/pages/resources/js/blocks/Subpages.vue":()=>p(()=>import(`./Subpages-D_0VT6fx.js`),__vite__mapDeps([49,2,13,3,14,41,4,27]))}),g={};for(let[e,t]of Object.entries(m))g[e.split(`/`).pop().replace(`.vue`,``)]=n(t);for(let[e,t]of Object.entries(h)){let[,r]=e.match(/plugins-core\/([^/]+)\//);g[`${r}::${e.split(`/`).pop().replace(`.vue`,``)}`]=n(t)}function _(e){return g[e]??null}var v={class:`grid gap-6`},y={__name:`BlockList`,props:{item:{type:Object,required:!0}},setup(e){let n=t(`pagebuilder:types`,{});return(t,o)=>(c(),i(`div`,v,[(c(!0),i(l,null,a(e.item.blocks,e=>(c(),i(l,{key:e.id},[r(_)(r(n)[e.type]?.component??e.component??``)?(c(),u(d(r(_)(r(n)[e.type]?.component??e.component??``)),{key:0,block:e},null,8,[`block`])):f(``,!0)],64))),128))]))}},b={class:`@container`},x={__name:`PageContent`,props:{content:{type:Object,required:!0},types:{type:Object,default:null}},setup(t){let n=t;s(`pagebuilder:list`,y),s(`pagebuilder:editing`,!1),s(`pagebuilder:types`,n.types??{});let r=o(()=>({blocks:n.content.blocks??[]}));return(t,n)=>(c(),i(`div`,b,[e(y,{item:r.value},null,8,[`item`])]))}};export{_ as n,x as t};
|
||||
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Accordion-kh4bR1O0.js","assets/RovingFocusGroup-HoUPhonB.js","assets/runtime-core.esm-bundler-B8D2lM98.js","assets/runtime-dom.esm-bundler-BEWGoe8n.js","assets/utils-DfNUDixG.js","assets/PersonAvatar-CD4S56En.js","assets/isValueEqualOrExist-BxQAPnq1.js","assets/Box-m5dU6NxE.js","assets/lightbulb-Crmh5htw.js","assets/Buttons-0bwW4Lhd.js","assets/button-BVLATeqq.js","assets/Columns-TRpz0IQV.js","assets/Contacts-DsE8qAVg.js","assets/app-qaQo9ARB.js","assets/app-0ZlMoGuN.css","assets/phone-BCjoS6Xy.js","assets/Divider-Cy8eDUk0.js","assets/Gallery-Ck19doXW.js","assets/image-B2vtsdro.js","assets/dialog-BS_OCxOd.js","assets/Heading-DMxvt-j4.js","assets/Hero-Cl8lLWJ_.js","assets/IconList-CTeo3kNz.js","assets/icons-6gNUNtiS.js","assets/building-complex-Drk3TBKp.js","assets/calendar-days-Cq3ZXY-S.js","assets/clock-IVbPqglU.js","assets/file-text-Dmdo-Zwf.js","assets/link-BE7bRFjZ.js","assets/Image-B7bTEMBH.js","assets/Quote-iODkllPL.js","assets/Section-DitqUeMx.js","assets/Spacer-B_j09dx4.js","assets/Table-Cen5s9kd.js","assets/Tabs-BDTYa4sI.js","assets/RovingFocusItem-B-_GxVPM.js","assets/Text-DjogHgP1.js","assets/Video-Bq7HXVFd.js","assets/play-BqfGHciU.js","assets/video-BV0GQFAO.js","assets/UpcomingEvents-BqzbaORm.js","assets/chevron-right-2hoRrfAe.js","assets/EventListItem-C-X2Rk4q.js","assets/EventDateBlock-WbVaROZc.js","assets/FormBlock-BOT9NHLv.js","assets/FormRenderer-BrPUPdr2.js","assets/eye-off-D9ExUiqn.js","assets/NativeSelect-BmmO8Miz.js","assets/Input-DE5SwW-e.js","assets/dist-FqXf5I3H.js","assets/Textarea-_u9EqblO.js","assets/LatestNews-DX9MnqcG.js","assets/NewsCard-DI4a_WuI.js","assets/NewsImage-CU6jD5fm.js","assets/NewsListItem-RJ4Ryvod.js","assets/Downloads-BpgMfpKo.js","assets/Subpages-C6skVN8o.js"])))=>i.map(i=>d[i]);
|
||||
import{D as e,J as t,O as n,On as r,b as i,bt as a,g as o,gt as s,mt as c,o as l,v as u,wt as d,y as f}from"./runtime-core.esm-bundler-B8D2lM98.js";import{o as p}from"./app-qaQo9ARB.js";var m=Object.assign({"./blocks/Accordion.vue":()=>p(()=>import(`./Accordion-kh4bR1O0.js`),__vite__mapDeps([0,1,2,3,4,5,6])),"./blocks/Box.vue":()=>p(()=>import(`./Box-m5dU6NxE.js`),__vite__mapDeps([7,2,4,5,1,3,8])),"./blocks/Buttons.vue":()=>p(()=>import(`./Buttons-0bwW4Lhd.js`),__vite__mapDeps([9,2,4,10])),"./blocks/Columns.vue":()=>p(()=>import(`./Columns-TRpz0IQV.js`),__vite__mapDeps([11,2])),"./blocks/Contacts.vue":()=>p(()=>import(`./Contacts-DsE8qAVg.js`),__vite__mapDeps([12,2,13,3,14,5,1,4,15])),"./blocks/Divider.vue":()=>p(()=>import(`./Divider-Cy8eDUk0.js`),__vite__mapDeps([16,2])),"./blocks/Gallery.vue":()=>p(()=>import(`./Gallery-Ck19doXW.js`),__vite__mapDeps([17,2,18,4,19,1,3,5,10])),"./blocks/Heading.vue":()=>p(()=>import(`./Heading-DMxvt-j4.js`),__vite__mapDeps([20,2,3])),"./blocks/Hero.vue":()=>p(()=>import(`./Hero-Cl8lLWJ_.js`),__vite__mapDeps([21,2,10,4])),"./blocks/IconList.vue":()=>p(()=>import(`./IconList-CTeo3kNz.js`),__vite__mapDeps([22,2,23,4,24,25,5,1,3,26,27,8,28,15])),"./blocks/Image.vue":()=>p(()=>import(`./Image-B7bTEMBH.js`),__vite__mapDeps([29,2,18,4])),"./blocks/Quote.vue":()=>p(()=>import(`./Quote-iODkllPL.js`),__vite__mapDeps([30,2])),"./blocks/Section.vue":()=>p(()=>import(`./Section-DitqUeMx.js`),__vite__mapDeps([31,2])),"./blocks/Spacer.vue":()=>p(()=>import(`./Spacer-B_j09dx4.js`),__vite__mapDeps([32,2])),"./blocks/Table.vue":()=>p(()=>import(`./Table-Cen5s9kd.js`),__vite__mapDeps([33,2])),"./blocks/Tabs.vue":()=>p(()=>import(`./Tabs-BDTYa4sI.js`),__vite__mapDeps([34,1,2,3,4,35])),"./blocks/Text.vue":()=>p(()=>import(`./Text-DjogHgP1.js`),__vite__mapDeps([36,2,13,3,14])),"./blocks/Video.vue":()=>p(()=>import(`./Video-Bq7HXVFd.js`),__vite__mapDeps([37,2,38,4,39]))}),h=Object.assign({"../../../plugins-core/events/resources/js/blocks/UpcomingEvents.vue":()=>p(()=>import(`./UpcomingEvents-BqzbaORm.js`),__vite__mapDeps([40,2,13,3,14,41,4,42,5,1,43])),"../../../plugins-core/forms/resources/js/blocks/FormBlock.vue":()=>p(()=>import(`./FormBlock-BOT9NHLv.js`),__vite__mapDeps([44,2,45,3,13,14,4,5,1,46,47,10,48,49,50])),"../../../plugins-core/news/resources/js/blocks/LatestNews.vue":()=>p(()=>import(`./LatestNews-DX9MnqcG.js`),__vite__mapDeps([51,2,13,3,14,41,4,52,5,1,53,54])),"../../../plugins-core/pages/resources/js/blocks/Downloads.vue":()=>p(()=>import(`./Downloads-BpgMfpKo.js`),__vite__mapDeps([55,2,4,27])),"../../../plugins-core/pages/resources/js/blocks/Subpages.vue":()=>p(()=>import(`./Subpages-C6skVN8o.js`),__vite__mapDeps([56,2,13,3,14,41,4,27]))}),g={};for(let[e,t]of Object.entries(m))g[e.split(`/`).pop().replace(`.vue`,``)]=n(t);for(let[e,t]of Object.entries(h)){let[,r]=e.match(/plugins-core\/([^/]+)\//);g[`${r}::${e.split(`/`).pop().replace(`.vue`,``)}`]=n(t)}function _(e){return g[e]??null}var v={class:`grid gap-6`},y={__name:`BlockList`,props:{item:{type:Object,required:!0}},setup(e){let n=t(`pagebuilder:types`,{});return(t,o)=>(c(),i(`div`,v,[(c(!0),i(l,null,a(e.item.blocks,e=>(c(),i(l,{key:e.id},[r(_)(r(n)[e.type]?.component??e.component??``)?(c(),u(d(r(_)(r(n)[e.type]?.component??e.component??``)),{key:0,block:e},null,8,[`block`])):f(``,!0)],64))),128))]))}},b={class:`@container`},x={__name:`PageContent`,props:{content:{type:Object,required:!0},types:{type:Object,default:null}},setup(t){let n=t;s(`pagebuilder:list`,y),s(`pagebuilder:editing`,!1),s(`pagebuilder:types`,n.types??{});let r=o(()=>({blocks:n.content.blocks??[]}));return(t,n)=>(c(),i(`div`,b,[e(y,{item:r.value},null,8,[`item`])]))}};export{_ as n,x as t};
|
||||
|
|
@ -1 +1 @@
|
|||
import{D as e,E as t,On as n,Zn as r,_ as i,b as a,mt as o,qt as s,tr as c,v as l,xt as u,y as d}from"./runtime-core.esm-bundler-B8D2lM98.js";import{n as f}from"./app-B3SzpsCA.js";import{t as p}from"./chevron-right-2hoRrfAe.js";var m={class:`rounded-lg border bg-card text-card-foreground`},h={key:0,class:`flex items-center justify-between gap-4 px-5 pt-4 pb-3`},g={class:`text-base font-semibold`},_={__name:`Panel`,props:{title:{type:String,default:``},actionLabel:{type:String,default:``},actionHref:{type:String,default:``}},setup(_){return(v,y)=>(o(),a(`section`,m,[_.title||v.$slots.actions?(o(),a(`header`,h,[i(`h2`,g,c(_.title),1),u(v.$slots,`actions`,{},()=>[_.actionHref?(o(),l(n(f),{key:0,href:_.actionHref,class:`inline-flex items-center gap-0.5 text-[13px] font-medium text-brand-text hover:underline`},{default:s(()=>[t(c(_.actionLabel)+` `,1),e(n(p),{class:`size-3.5`})]),_:1},8,[`href`])):d(``,!0)])])):d(``,!0),i(`div`,{class:r([`px-5 pb-5`,{"pt-5":!_.title&&!v.$slots.actions}])},[u(v.$slots,`default`)],2)]))}};export{_ as t};
|
||||
import{D as e,E as t,On as n,Zn as r,_ as i,b as a,mt as o,qt as s,tr as c,v as l,xt as u,y as d}from"./runtime-core.esm-bundler-B8D2lM98.js";import{n as f}from"./app-qaQo9ARB.js";import{t as p}from"./chevron-right-2hoRrfAe.js";var m={class:`rounded-lg border bg-card text-card-foreground`},h={key:0,class:`flex items-center justify-between gap-4 px-5 pt-4 pb-3`},g={class:`text-base font-semibold`},_={__name:`Panel`,props:{title:{type:String,default:``},actionLabel:{type:String,default:``},actionHref:{type:String,default:``}},setup(_){return(v,y)=>(o(),a(`section`,m,[_.title||v.$slots.actions?(o(),a(`header`,h,[i(`h2`,g,c(_.title),1),u(v.$slots,`actions`,{},()=>[_.actionHref?(o(),l(n(f),{key:0,href:_.actionHref,class:`inline-flex items-center gap-0.5 text-[13px] font-medium text-brand-text hover:underline`},{default:s(()=>[t(c(_.actionLabel)+` `,1),e(n(p),{class:`size-3.5`})]),_:1},8,[`href`])):d(``,!0)])])):d(``,!0),i(`div`,{class:r([`px-5 pb-5`,{"pt-5":!_.title&&!v.$slots.actions}])},[u(v.$slots,`default`)],2)]))}};export{_ as t};
|
||||
|
|
@ -1 +1 @@
|
|||
import{D as e,E as t,On as n,_ as r,mt as i,qt as a,tr as o,v as s}from"./runtime-core.esm-bundler-B8D2lM98.js";import{n as c}from"./app-B3SzpsCA.js";import{t as l}from"./arrow-right-CSfG3qiq.js";import{R as u}from"./PersonAvatar-CD4S56En.js";import{t as d}from"./Panel-CvqF6bx0.js";var f={action:`/personen`,method:`get`,class:`relative`,role:`search`},p={__name:`PeopleSearch`,props:{count:{type:Number,required:!0}},setup(p){return(m,h)=>(i(),s(d,{title:`Personen finden`},{default:a(()=>[r(`form`,f,[e(n(u),{class:`pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2 text-muted-foreground`}),h[0]||=r(`input`,{name:`q`,type:`search`,placeholder:`Name, Funktion, Abteilung …`,class:`h-10 w-full rounded-md border border-input bg-background pr-3 pl-9 text-sm placeholder:text-muted-foreground focus-visible:border-brand-400 focus-visible:ring-3 focus-visible:ring-ring/30 focus-visible:outline-none`},null,-1)]),e(n(c),{href:`/personen`,class:`mt-4 flex items-center justify-between text-[13px] text-muted-foreground hover:text-foreground`},{default:a(()=>[t(o(p.count===1?`1 Person`:`${p.count.toLocaleString(`de-DE`)} Personen`)+` im Verzeichnis `,1),e(n(l),{class:`size-4`})]),_:1})]),_:1}))}};export{p as default};
|
||||
import{D as e,E as t,On as n,_ as r,mt as i,qt as a,tr as o,v as s}from"./runtime-core.esm-bundler-B8D2lM98.js";import{n as c}from"./app-qaQo9ARB.js";import{t as l}from"./arrow-right-CSfG3qiq.js";import{R as u}from"./PersonAvatar-CD4S56En.js";import{t as d}from"./Panel-GlXreVuM.js";var f={action:`/personen`,method:`get`,class:`relative`,role:`search`},p={__name:`PeopleSearch`,props:{count:{type:Number,required:!0}},setup(p){return(m,h)=>(i(),s(d,{title:`Personen finden`},{default:a(()=>[r(`form`,f,[e(n(u),{class:`pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2 text-muted-foreground`}),h[0]||=r(`input`,{name:`q`,type:`search`,placeholder:`Name, Funktion, Abteilung …`,class:`h-10 w-full rounded-md border border-input bg-background pr-3 pl-9 text-sm placeholder:text-muted-foreground focus-visible:border-brand-400 focus-visible:ring-3 focus-visible:ring-ring/30 focus-visible:outline-none`},null,-1)]),e(n(c),{href:`/personen`,class:`mt-4 flex items-center justify-between text-[13px] text-muted-foreground hover:text-foreground`},{default:a(()=>[t(o(p.count===1?`1 Person`:`${p.count.toLocaleString(`de-DE`)} Personen`)+` im Verzeichnis `,1),e(n(l),{class:`size-4`})]),_:1})]),_:1}))}};export{p as default};
|
||||
|
|
@ -1 +1 @@
|
|||
import{D as e,On as t,_ as n,mt as r,qt as i,v as a}from"./runtime-core.esm-bundler-B8D2lM98.js";import{n as o}from"./app-B3SzpsCA.js";import{r as s}from"./AppLayout-t5KmyFQO.js";var c={__name:`ProfileIncomplete`,setup(c){return(c,l)=>(r(),a(t(o),{href:`/profil/bearbeiten`,class:`flex items-start gap-3 rounded-lg border border-dashed border-brand-300 bg-card p-4 transition-colors hover:bg-brand-soft`},{default:i(()=>[e(t(s),{class:`mt-0.5 size-5 shrink-0 text-brand-text`}),l[0]||=n(`div`,null,[n(`div`,{class:`text-sm font-semibold`},`Profil vervollständigen`),n(`p`,{class:`mt-0.5 text-[13px] text-muted-foreground`},`Mit Foto und Funktion finden Kolleginnen und Kollegen Sie schneller.`)],-1)]),_:1}))}};export{c as default};
|
||||
import{D as e,On as t,_ as n,mt as r,qt as i,v as a}from"./runtime-core.esm-bundler-B8D2lM98.js";import{n as o}from"./app-qaQo9ARB.js";import{r as s}from"./AppLayout-Xi_ip4AB.js";var c={__name:`ProfileIncomplete`,setup(c){return(c,l)=>(r(),a(t(o),{href:`/profil/bearbeiten`,class:`flex items-start gap-3 rounded-lg border border-dashed border-brand-300 bg-card p-4 transition-colors hover:bg-brand-soft`},{default:i(()=>[e(t(s),{class:`mt-0.5 size-5 shrink-0 text-brand-text`}),l[0]||=n(`div`,null,[n(`div`,{class:`text-sm font-semibold`},`Profil vervollständigen`),n(`p`,{class:`mt-0.5 text-[13px] text-muted-foreground`},`Mit Foto und Funktion finden Kolleginnen und Kollegen Sie schneller.`)],-1)]),_:1}))}};export{c as default};
|
||||
|
|
@ -1 +1 @@
|
|||
import{D as e,On as t,_ as n,b as r,bt as i,ct as a,mt as o,o as s,qt as c,tr as l,v as u,vn as d,wt as f,y as p}from"./runtime-core.esm-bundler-B8D2lM98.js";import{n as m}from"./app-B3SzpsCA.js";import{t as h}from"./icons-6gNUNtiS.js";import{t as g}from"./chevron-left-D2Or6edo.js";import{t as _}from"./chevron-right-2hoRrfAe.js";import{r as v,t as y}from"./dist-FqXf5I3H.js";var b={class:`rounded-lg border bg-card`},x={class:`flex items-center justify-between px-5 pt-4 pb-3`},S={key:0,class:`flex gap-1.5`},C=[`disabled`],w=[`disabled`],T={class:`text-xs leading-tight font-medium`},E={__name:`QuickLinksRow`,props:{links:{type:Array,required:!0}},setup(E){let D=d(null),O=d(!1),k=d(!1);function A(){let e=D.value;e&&(O.value=e.scrollLeft>4,k.value=e.scrollLeft+e.clientWidth<e.scrollWidth-4)}function j(e){D.value?.scrollBy({left:e*D.value.clientWidth*.8,behavior:`smooth`})}return a(A),v(D,A),y(D,`scroll`,A,{passive:!0}),(a,d)=>(o(),r(`section`,b,[n(`header`,x,[d[2]||=n(`h2`,{class:`text-base font-semibold`},`Schnellzugriff`,-1),O.value||k.value?(o(),r(`div`,S,[n(`button`,{type:`button`,class:`grid size-7 place-items-center rounded-md border text-foreground/70 hover:bg-accent disabled:opacity-40`,disabled:!O.value,"aria-label":`Zurück`,onClick:d[0]||=e=>j(-1)},[e(t(g),{class:`size-4`})],8,C),n(`button`,{type:`button`,class:`grid size-7 place-items-center rounded-md border text-foreground/70 hover:bg-accent disabled:opacity-40`,disabled:!k.value,"aria-label":`Weiter`,onClick:d[1]||=e=>j(1)},[e(t(_),{class:`size-4`})],8,w)])):p(``,!0)]),n(`div`,{ref_key:`track`,ref:D,class:`flex snap-x scroll-px-5 gap-3 overflow-x-auto px-5 pb-5 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden`},[(o(!0),r(s,null,i(E.links,e=>(o(),u(f(e.url.startsWith(`/`)&&!e.new_tab?t(m):`a`),{key:e.label+e.url,href:e.url,target:e.new_tab?`_blank`:void 0,rel:e.new_tab?`noopener`:void 0,class:`flex w-[116px] shrink-0 snap-start flex-col items-center gap-2.5 rounded-md bg-muted px-2 py-4 text-center transition-colors hover:bg-brand-soft`},{default:c(()=>[(o(),u(f(t(h)[e.icon]??t(h).link),{class:`size-6 text-brand-text`,"stroke-width":1.6})),n(`span`,T,l(e.label),1)]),_:2},1032,[`href`,`target`,`rel`]))),128))],512)]))}},D={__name:`QuickLinks`,props:{links:{type:Array,required:!0}},setup(e){return(t,n)=>(o(),u(E,{links:e.links},null,8,[`links`]))}};export{D as default};
|
||||
import{D as e,On as t,_ as n,b as r,bt as i,ct as a,mt as o,o as s,qt as c,tr as l,v as u,vn as d,wt as f,y as p}from"./runtime-core.esm-bundler-B8D2lM98.js";import{n as m}from"./app-qaQo9ARB.js";import{t as h}from"./icons-6gNUNtiS.js";import{t as g}from"./chevron-left-D2Or6edo.js";import{t as _}from"./chevron-right-2hoRrfAe.js";import{r as v,t as y}from"./dist-FqXf5I3H.js";var b={class:`rounded-lg border bg-card`},x={class:`flex items-center justify-between px-5 pt-4 pb-3`},S={key:0,class:`flex gap-1.5`},C=[`disabled`],w=[`disabled`],T={class:`text-xs leading-tight font-medium`},E={__name:`QuickLinksRow`,props:{links:{type:Array,required:!0}},setup(E){let D=d(null),O=d(!1),k=d(!1);function A(){let e=D.value;e&&(O.value=e.scrollLeft>4,k.value=e.scrollLeft+e.clientWidth<e.scrollWidth-4)}function j(e){D.value?.scrollBy({left:e*D.value.clientWidth*.8,behavior:`smooth`})}return a(A),v(D,A),y(D,`scroll`,A,{passive:!0}),(a,d)=>(o(),r(`section`,b,[n(`header`,x,[d[2]||=n(`h2`,{class:`text-base font-semibold`},`Schnellzugriff`,-1),O.value||k.value?(o(),r(`div`,S,[n(`button`,{type:`button`,class:`grid size-7 place-items-center rounded-md border text-foreground/70 hover:bg-accent disabled:opacity-40`,disabled:!O.value,"aria-label":`Zurück`,onClick:d[0]||=e=>j(-1)},[e(t(g),{class:`size-4`})],8,C),n(`button`,{type:`button`,class:`grid size-7 place-items-center rounded-md border text-foreground/70 hover:bg-accent disabled:opacity-40`,disabled:!k.value,"aria-label":`Weiter`,onClick:d[1]||=e=>j(1)},[e(t(_),{class:`size-4`})],8,w)])):p(``,!0)]),n(`div`,{ref_key:`track`,ref:D,class:`flex snap-x scroll-px-5 gap-3 overflow-x-auto px-5 pb-5 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden`},[(o(!0),r(s,null,i(E.links,e=>(o(),u(f(e.url.startsWith(`/`)&&!e.new_tab?t(m):`a`),{key:e.label+e.url,href:e.url,target:e.new_tab?`_blank`:void 0,rel:e.new_tab?`noopener`:void 0,class:`flex w-[116px] shrink-0 snap-start flex-col items-center gap-2.5 rounded-md bg-muted px-2 py-4 text-center transition-colors hover:bg-brand-soft`},{default:c(()=>[(o(),u(f(t(h)[e.icon]??t(h).link),{class:`size-6 text-brand-text`,"stroke-width":1.6})),n(`span`,T,l(e.label),1)]),_:2},1032,[`href`,`target`,`rel`]))),128))],512)]))}},D={__name:`QuickLinks`,props:{links:{type:Array,required:!0}},setup(e){return(t,n)=>(o(),u(E,{links:e.links},null,8,[`links`]))}};export{D as default};
|
||||
|
|
@ -1 +1 @@
|
|||
import{D as e,E as t,On as n,_ as r,mt as i,qt as a,v as o,y as s}from"./runtime-core.esm-bundler-B8D2lM98.js";import{w as c}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{r as l}from"./app-B3SzpsCA.js";import{A as u}from"./utils-DfNUDixG.js";import{t as d}from"./FormField-D33HIO77.js";import{t as f}from"./button-BVLATeqq.js";import{t as p}from"./Input-DE5SwW-e.js";import{t as m}from"./GuestLayout-3mQ2EZWW.js";var h={__name:`ResetPassword`,props:{email:{type:String,default:``},token:{type:String,required:!0}},setup(h){let g=h,_=l({token:g.token,email:g.email,password:``,password_confirmation:``});function v(){_.post(`/reset-password`,{onFinish:()=>_.reset(`password`,`password_confirmation`)})}return(l,h)=>(i(),o(m,{title:`Neues Passwort festlegen`,description:`Mindestens 10 Zeichen, mit Buchstaben und Ziffern.`},{default:a(()=>[r(`form`,{class:`grid gap-5`,onSubmit:c(v,[`prevent`])},[e(d,{id:`email`,label:`E-Mail-Adresse`,error:n(_).errors.email},{default:a(()=>[e(n(p),{id:`email`,modelValue:n(_).email,"onUpdate:modelValue":h[0]||=e=>n(_).email=e,type:`email`,autocomplete:`username`,class:`h-10`},null,8,[`modelValue`])]),_:1},8,[`error`]),e(d,{id:`password`,label:`Neues Passwort`,error:n(_).errors.password},{default:a(()=>[e(n(p),{id:`password`,modelValue:n(_).password,"onUpdate:modelValue":h[1]||=e=>n(_).password=e,type:`password`,autocomplete:`new-password`,autofocus:``,class:`h-10`},null,8,[`modelValue`])]),_:1},8,[`error`]),e(d,{id:`password_confirmation`,label:`Passwort wiederholen`},{default:a(()=>[e(n(p),{id:`password_confirmation`,modelValue:n(_).password_confirmation,"onUpdate:modelValue":h[2]||=e=>n(_).password_confirmation=e,type:`password`,autocomplete:`new-password`,class:`h-10`},null,8,[`modelValue`])]),_:1}),e(n(f),{type:`submit`,size:`lg`,class:`h-10 w-full`,disabled:n(_).processing},{default:a(()=>[n(_).processing?(i(),o(n(u),{key:0,class:`animate-spin`})):s(``,!0),h[3]||=t(` Passwort speichern `,-1)]),_:1},8,[`disabled`])],32)]),_:1}))}};export{h as default};
|
||||
import{D as e,E as t,On as n,_ as r,mt as i,qt as a,v as o,y as s}from"./runtime-core.esm-bundler-B8D2lM98.js";import{w as c}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{r as l}from"./app-qaQo9ARB.js";import{A as u}from"./utils-DfNUDixG.js";import{t as d}from"./FormField-D33HIO77.js";import{t as f}from"./button-BVLATeqq.js";import{t as p}from"./Input-DE5SwW-e.js";import{t as m}from"./GuestLayout-CA0IOiaT.js";var h={__name:`ResetPassword`,props:{email:{type:String,default:``},token:{type:String,required:!0}},setup(h){let g=h,_=l({token:g.token,email:g.email,password:``,password_confirmation:``});function v(){_.post(`/reset-password`,{onFinish:()=>_.reset(`password`,`password_confirmation`)})}return(l,h)=>(i(),o(m,{title:`Neues Passwort festlegen`,description:`Mindestens 10 Zeichen, mit Buchstaben und Ziffern.`},{default:a(()=>[r(`form`,{class:`grid gap-5`,onSubmit:c(v,[`prevent`])},[e(d,{id:`email`,label:`E-Mail-Adresse`,error:n(_).errors.email},{default:a(()=>[e(n(p),{id:`email`,modelValue:n(_).email,"onUpdate:modelValue":h[0]||=e=>n(_).email=e,type:`email`,autocomplete:`username`,class:`h-10`},null,8,[`modelValue`])]),_:1},8,[`error`]),e(d,{id:`password`,label:`Neues Passwort`,error:n(_).errors.password},{default:a(()=>[e(n(p),{id:`password`,modelValue:n(_).password,"onUpdate:modelValue":h[1]||=e=>n(_).password=e,type:`password`,autocomplete:`new-password`,autofocus:``,class:`h-10`},null,8,[`modelValue`])]),_:1},8,[`error`]),e(d,{id:`password_confirmation`,label:`Passwort wiederholen`},{default:a(()=>[e(n(p),{id:`password_confirmation`,modelValue:n(_).password_confirmation,"onUpdate:modelValue":h[2]||=e=>n(_).password_confirmation=e,type:`password`,autocomplete:`new-password`,class:`h-10`},null,8,[`modelValue`])]),_:1}),e(n(f),{type:`submit`,size:`lg`,class:`h-10 w-full`,disabled:n(_).processing},{default:a(()=>[n(_).processing?(i(),o(n(u),{key:0,class:`animate-spin`})):s(``,!0),h[3]||=t(` Passwort speichern `,-1)]),_:1},8,[`disabled`])],32)]),_:1}))}};export{h as default};
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -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{n as u}from"./app-B3SzpsCA.js";import{j as d}from"./utils-DfNUDixG.js";import{t as f}from"./arrow-left-CeYKHQbE.js";import{t as p}from"./AppLayout-t5KmyFQO.js";import{A as m}from"./PersonAvatar-CD4S56En.js";import{t as h}from"./clock-IVbPqglU.js";import{t as g}from"./map-pin-DhZUjkWx.js";import{t as _}from"./video-BV0GQFAO.js";import{t as v}from"./EventDateBlock-WbVaROZc.js";import{t as y}from"./button-BVLATeqq.js";import{t as b}from"./Panel-CvqF6bx0.js";var x=d({name:`calendar-plus`,size:24,node:[[`path`,{d:`M16 18h6`,key:`987eiv`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`path`,{d:`M19 15v6`,key:`10aioa`}],[`path`,{d:`M21 11.5V5a2 2 0 00-2-2H5a2 2 0 00-2 2v14a2 2 0 002 2h8.3`,key:`jgwkxf`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M8 2v3`,key:`1ioesn`}]]}),S={class:`mx-auto max-w-4xl`},C={class:`flex items-start gap-4`},w={class:`pt-1 text-2xl leading-tight font-semibold tracking-tight sm:text-3xl`},T=[`src`,`alt`],E={class:`mt-6 grid gap-6 lg:grid-cols-3`},D=[`innerHTML`],O={key:1,class:`text-sm text-muted-foreground`},k={class:`grid gap-4 text-sm`},A={class:`flex gap-3`},j={key:0,class:`flex gap-3`},M={key:1,class:`flex gap-3`},N={class:`min-w-0`},P={class:`truncate`},F=[`href`],I=[`href`],L={__name:`Show`,props:{event:{type:Object,required:!0}},setup(d){return(L,R)=>(a(),c(p,{title:d.event.title},{default:o(()=>[r(`div`,S,[e(n(u),{href:`/termine`,class:`mb-6 inline-flex items-center gap-1.5 text-sm font-medium text-muted-foreground hover:text-foreground`},{default:o(()=>[e(n(f),{class:`size-4`}),R[0]||=t(` Alle Termine `,-1)]),_:1}),r(`div`,C,[e(v,{date:d.event.starts_at,class:`w-16 py-2`},null,8,[`date`]),r(`h1`,w,s(d.event.title),1)]),d.event.image_url?(a(),i(`img`,{key:0,src:d.event.image_url,alt:d.event.title,class:`mt-6 aspect-video w-full rounded-lg object-cover`},null,8,T)):l(``,!0),r(`div`,E,[e(b,{title:`Beschreibung`,class:`lg:col-span-2`},{default:o(()=>[d.event.description_html?(a(),i(`div`,{key:0,class:`prose prose-neutral max-w-none text-[15px]`,innerHTML:d.event.description_html},null,8,D)):(a(),i(`p`,O,`Keine weiteren Informationen.`))]),_:1}),e(b,{title:`Details`,class:`content-start`},{default:o(()=>[r(`dl`,k,[r(`div`,A,[e(n(h),{class:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),r(`div`,null,[R[1]||=r(`dt`,{class:`text-xs text-muted-foreground`},`Wann`,-1),r(`dd`,null,s(n(m)(d.event)),1)])]),d.event.location?(a(),i(`div`,j,[e(n(g),{class:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),r(`div`,null,[R[2]||=r(`dt`,{class:`text-xs text-muted-foreground`},`Ort`,-1),r(`dd`,null,s(d.event.location),1)])])):l(``,!0),d.event.online_url?(a(),i(`div`,M,[e(n(_),{class:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),r(`div`,N,[R[3]||=r(`dt`,{class:`text-xs text-muted-foreground`},`Online`,-1),r(`dd`,P,[r(`a`,{href:d.event.online_url,target:`_blank`,rel:`noopener`,class:`text-brand-text hover:underline`},`Zur Teilnahme`,8,F)])])])):l(``,!0)]),e(n(y),{variant:`outline`,class:`mt-5 w-full`,"as-child":``},{default:o(()=>[r(`a`,{href:`/termine/${d.event.id}/kalender.ics`},[e(n(x)),R[4]||=t(` In meinen Kalender`,-1)],8,I)]),_:1})]),_:1})])])]),_:1},8,[`title`]))}};export{L 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{n as u}from"./app-qaQo9ARB.js";import{j as d}from"./utils-DfNUDixG.js";import{t as f}from"./arrow-left-CeYKHQbE.js";import{t as p}from"./AppLayout-Xi_ip4AB.js";import{A as m}from"./PersonAvatar-CD4S56En.js";import{t as h}from"./clock-IVbPqglU.js";import{t as g}from"./map-pin-DhZUjkWx.js";import{t as _}from"./video-BV0GQFAO.js";import{t as v}from"./EventDateBlock-WbVaROZc.js";import{t as y}from"./button-BVLATeqq.js";import{t as b}from"./Panel-GlXreVuM.js";var x=d({name:`calendar-plus`,size:24,node:[[`path`,{d:`M16 18h6`,key:`987eiv`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`path`,{d:`M19 15v6`,key:`10aioa`}],[`path`,{d:`M21 11.5V5a2 2 0 00-2-2H5a2 2 0 00-2 2v14a2 2 0 002 2h8.3`,key:`jgwkxf`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M8 2v3`,key:`1ioesn`}]]}),S={class:`mx-auto max-w-4xl`},C={class:`flex items-start gap-4`},w={class:`pt-1 text-2xl leading-tight font-semibold tracking-tight sm:text-3xl`},T=[`src`,`alt`],E={class:`mt-6 grid gap-6 lg:grid-cols-3`},D=[`innerHTML`],O={key:1,class:`text-sm text-muted-foreground`},k={class:`grid gap-4 text-sm`},A={class:`flex gap-3`},j={key:0,class:`flex gap-3`},M={key:1,class:`flex gap-3`},N={class:`min-w-0`},P={class:`truncate`},F=[`href`],I=[`href`],L={__name:`Show`,props:{event:{type:Object,required:!0}},setup(d){return(L,R)=>(a(),c(p,{title:d.event.title},{default:o(()=>[r(`div`,S,[e(n(u),{href:`/termine`,class:`mb-6 inline-flex items-center gap-1.5 text-sm font-medium text-muted-foreground hover:text-foreground`},{default:o(()=>[e(n(f),{class:`size-4`}),R[0]||=t(` Alle Termine `,-1)]),_:1}),r(`div`,C,[e(v,{date:d.event.starts_at,class:`w-16 py-2`},null,8,[`date`]),r(`h1`,w,s(d.event.title),1)]),d.event.image_url?(a(),i(`img`,{key:0,src:d.event.image_url,alt:d.event.title,class:`mt-6 aspect-video w-full rounded-lg object-cover`},null,8,T)):l(``,!0),r(`div`,E,[e(b,{title:`Beschreibung`,class:`lg:col-span-2`},{default:o(()=>[d.event.description_html?(a(),i(`div`,{key:0,class:`prose prose-neutral max-w-none text-[15px]`,innerHTML:d.event.description_html},null,8,D)):(a(),i(`p`,O,`Keine weiteren Informationen.`))]),_:1}),e(b,{title:`Details`,class:`content-start`},{default:o(()=>[r(`dl`,k,[r(`div`,A,[e(n(h),{class:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),r(`div`,null,[R[1]||=r(`dt`,{class:`text-xs text-muted-foreground`},`Wann`,-1),r(`dd`,null,s(n(m)(d.event)),1)])]),d.event.location?(a(),i(`div`,j,[e(n(g),{class:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),r(`div`,null,[R[2]||=r(`dt`,{class:`text-xs text-muted-foreground`},`Ort`,-1),r(`dd`,null,s(d.event.location),1)])])):l(``,!0),d.event.online_url?(a(),i(`div`,M,[e(n(_),{class:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),r(`div`,N,[R[3]||=r(`dt`,{class:`text-xs text-muted-foreground`},`Online`,-1),r(`dd`,P,[r(`a`,{href:d.event.online_url,target:`_blank`,rel:`noopener`,class:`text-brand-text hover:underline`},`Zur Teilnahme`,8,F)])])])):l(``,!0)]),e(n(y),{variant:`outline`,class:`mt-5 w-full`,"as-child":``},{default:o(()=>[r(`a`,{href:`/termine/${d.event.id}/kalender.ics`},[e(n(x)),R[4]||=t(` In meinen Kalender`,-1)],8,I)]),_:1})]),_:1})])])]),_:1},8,[`title`]))}};export{L as default};
|
||||
|
|
@ -1 +1 @@
|
|||
import{D as e,E as t,On as n,St as r,Zn as i,_ as a,b as o,bt as s,mt as c,o as l,qt as u,tr as d,v as f,y as p}from"./runtime-core.esm-bundler-B8D2lM98.js";import{n as m}from"./app-B3SzpsCA.js";import{j as h}from"./utils-DfNUDixG.js";import{t as g}from"./AppLayout-t5KmyFQO.js";import{t as _}from"./calendar-clock-CwsI-C0a.js";import{k as v}from"./PersonAvatar-CD4S56En.js";import{t as y}from"./chevron-right-2hoRrfAe.js";import{t as b}from"./button-BVLATeqq.js";import{t as x}from"./PageContent-DwZvPVNb.js";var S=h({name:`pencil-line`,size:24,node:[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]}),C={__name:`PageTreeNav`,props:{items:{type:Array,required:!0},current:{type:String,required:!0},depth:{type:Number,default:0}},setup(a){let h=(e,t)=>e.url===t||e.children.some(e=>h(e,t));return(g,_)=>{let v=r(`PageTreeNav`,!0);return c(),o(`ul`,{class:i([`grid gap-0.5`,a.depth?`mt-0.5 ml-3 border-l pl-2`:`mt-1`])},[(c(!0),o(l,null,s(a.items,r=>(c(),o(`li`,{key:r.id},[e(n(m),{href:r.url,class:i([`block rounded-md px-3 py-1.5 text-sm`,r.url===a.current?`bg-brand-soft font-medium text-brand-soft-foreground`:`text-foreground/80 hover:bg-accent hover:text-foreground`]),"aria-current":r.url===a.current?`page`:void 0},{default:u(()=>[t(d(r.title),1)]),_:2},1032,[`href`,`class`,`aria-current`]),r.children.length&&h(r,a.current)?(c(),f(v,{key:0,items:r.children,current:a.current,depth:a.depth+1},null,8,[`items`,`current`,`depth`])):p(``,!0)]))),128))],2)}}},w={key:0,class:`hidden lg:block`},T={class:`sticky top-24 rounded-lg border bg-card p-2`,"aria-label":`Seiten in diesem Bereich`},E={key:0,class:`mb-3 flex flex-wrap items-center gap-1 text-[13px] text-muted-foreground`,"aria-label":`Brotkrumen`},D={class:`text-foreground`},O={class:`mb-8 flex flex-wrap items-start justify-between gap-4`},k={class:`min-w-0`},A={class:`text-3xl leading-tight font-semibold tracking-tight`},j={key:0,class:`mt-1.5 text-[13px] text-muted-foreground`},M={key:1,class:`mb-6 flex items-start gap-3 rounded-lg border border-brand-200 bg-brand-soft px-4 py-3 text-sm`},N={key:2,class:`rounded-lg border border-dashed px-6 py-12 text-center text-sm text-muted-foreground`},P={__name:`Show`,props:{page:{type:Object,required:!0},content:{type:Object,required:!0},breadcrumbs:{type:Array,default:()=>[]},section:{type:Object,required:!0},editor:{type:Object,default:null}},setup(r){let h=r.section.children.length>0;return(P,F)=>(c(),f(g,{title:r.page.title},{default:u(()=>[a(`div`,{class:i([`grid gap-8`,h?`lg:grid-cols-[260px_minmax(0,1fr)]`:``])},[h?(c(),o(`aside`,w,[a(`nav`,T,[e(n(m),{href:r.section.url,class:i([`block rounded-md px-3 py-2 text-sm font-semibold`,r.section.active?`bg-brand-soft text-brand-soft-foreground`:`hover:bg-accent`])},{default:u(()=>[t(d(r.section.title),1)]),_:1},8,[`href`,`class`]),e(C,{items:r.section.children,current:r.page.url},null,8,[`items`,`current`])])])):p(``,!0),a(`article`,{class:i([`min-w-0`,h?``:`mx-auto w-full max-w-5xl`])},[r.breadcrumbs.length?(c(),o(`nav`,E,[(c(!0),o(l,null,s(r.breadcrumbs,r=>(c(),o(l,{key:r.url},[e(n(m),{href:r.url,class:`hover:text-foreground hover:underline`},{default:u(()=>[t(d(r.title),1)]),_:2},1032,[`href`]),e(n(y),{class:`size-3.5`})],64))),128)),a(`span`,D,d(r.page.title),1)])):p(``,!0),a(`header`,O,[a(`div`,k,[a(`h1`,A,d(r.page.title),1),r.page.published_at?(c(),o(`p`,j,`Zuletzt aktualisiert am `+d(n(v)(r.page.published_at)),1)):p(``,!0)]),r.editor?(c(),f(n(b),{key:0,variant:`outline`,"as-child":``},{default:u(()=>[e(n(m),{href:r.editor.url},{default:u(()=>[e(n(S)),F[0]||=t(` Bearbeiten`,-1)]),_:1},8,[`href`])]),_:1})):p(``,!0)]),r.editor&&(!r.page.is_published||r.editor.has_draft||r.editor.scheduled_at)?(c(),o(`div`,M,[r.editor.scheduled_at?(c(),f(n(_),{key:0,class:`mt-0.5 size-4 shrink-0 text-brand-text`})):(c(),f(n(S),{key:1,class:`mt-0.5 size-4 shrink-0 text-brand-text`})),a(`p`,null,[r.page.is_published?r.editor.scheduled_at?(c(),o(l,{key:1},[t(`Eine neue Fassung wird am `+d(new Date(r.editor.scheduled_at).toLocaleString(`de-DE`,{dateStyle:`medium`,timeStyle:`short`}))+` veröffentlicht.`,1)],64)):(c(),o(l,{key:2},[t(`Es gibt unveröffentlichte Änderungen an dieser Seite.`)],64)):(c(),o(l,{key:0},[t(`Diese Seite ist noch nicht veröffentlicht. Nur Redakteure sehen sie.`)],64)),e(n(m),{href:r.editor.url,class:`ml-1 font-medium text-brand-text hover:underline`},{default:u(()=>[...F[1]||=[t(`Im Editor öffnen`,-1)]]),_:1},8,[`href`])])])):p(``,!0),e(x,{content:r.content},null,8,[`content`]),r.content.blocks.length?p(``,!0):(c(),o(`p`,N,`Diese Seite hat noch keinen Inhalt.`))],2)],2)]),_:1},8,[`title`]))}};export{P as default};
|
||||
import{D as e,E as t,On as n,St as r,Zn as i,_ as a,b as o,bt as s,mt as c,o as l,qt as u,tr as d,v as f,y as p}from"./runtime-core.esm-bundler-B8D2lM98.js";import{n as m}from"./app-qaQo9ARB.js";import{j as h}from"./utils-DfNUDixG.js";import{t as g}from"./AppLayout-Xi_ip4AB.js";import{t as _}from"./calendar-clock-CwsI-C0a.js";import{k as v}from"./PersonAvatar-CD4S56En.js";import{t as y}from"./chevron-right-2hoRrfAe.js";import{t as b}from"./button-BVLATeqq.js";import{t as x}from"./PageContent-CzvPEtOi.js";var S=h({name:`pencil-line`,size:24,node:[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]}),C={__name:`PageTreeNav`,props:{items:{type:Array,required:!0},current:{type:String,required:!0},depth:{type:Number,default:0}},setup(a){let h=(e,t)=>e.url===t||e.children.some(e=>h(e,t));return(g,_)=>{let v=r(`PageTreeNav`,!0);return c(),o(`ul`,{class:i([`grid gap-0.5`,a.depth?`mt-0.5 ml-3 border-l pl-2`:`mt-1`])},[(c(!0),o(l,null,s(a.items,r=>(c(),o(`li`,{key:r.id},[e(n(m),{href:r.url,class:i([`block rounded-md px-3 py-1.5 text-sm`,r.url===a.current?`bg-brand-soft font-medium text-brand-soft-foreground`:`text-foreground/80 hover:bg-accent hover:text-foreground`]),"aria-current":r.url===a.current?`page`:void 0},{default:u(()=>[t(d(r.title),1)]),_:2},1032,[`href`,`class`,`aria-current`]),r.children.length&&h(r,a.current)?(c(),f(v,{key:0,items:r.children,current:a.current,depth:a.depth+1},null,8,[`items`,`current`,`depth`])):p(``,!0)]))),128))],2)}}},w={key:0,class:`hidden lg:block`},T={class:`sticky top-24 rounded-lg border bg-card p-2`,"aria-label":`Seiten in diesem Bereich`},E={key:0,class:`mb-3 flex flex-wrap items-center gap-1 text-[13px] text-muted-foreground`,"aria-label":`Brotkrumen`},D={class:`text-foreground`},O={class:`mb-8 flex flex-wrap items-start justify-between gap-4`},k={class:`min-w-0`},A={class:`text-3xl leading-tight font-semibold tracking-tight`},j={key:0,class:`mt-1.5 text-[13px] text-muted-foreground`},M={key:1,class:`mb-6 flex items-start gap-3 rounded-lg border border-brand-200 bg-brand-soft px-4 py-3 text-sm`},N={key:2,class:`rounded-lg border border-dashed px-6 py-12 text-center text-sm text-muted-foreground`},P={__name:`Show`,props:{page:{type:Object,required:!0},content:{type:Object,required:!0},breadcrumbs:{type:Array,default:()=>[]},section:{type:Object,required:!0},editor:{type:Object,default:null}},setup(r){let h=r.section.children.length>0;return(P,F)=>(c(),f(g,{title:r.page.title},{default:u(()=>[a(`div`,{class:i([`grid gap-8`,h?`lg:grid-cols-[260px_minmax(0,1fr)]`:``])},[h?(c(),o(`aside`,w,[a(`nav`,T,[e(n(m),{href:r.section.url,class:i([`block rounded-md px-3 py-2 text-sm font-semibold`,r.section.active?`bg-brand-soft text-brand-soft-foreground`:`hover:bg-accent`])},{default:u(()=>[t(d(r.section.title),1)]),_:1},8,[`href`,`class`]),e(C,{items:r.section.children,current:r.page.url},null,8,[`items`,`current`])])])):p(``,!0),a(`article`,{class:i([`min-w-0`,h?``:`mx-auto w-full max-w-5xl`])},[r.breadcrumbs.length?(c(),o(`nav`,E,[(c(!0),o(l,null,s(r.breadcrumbs,r=>(c(),o(l,{key:r.url},[e(n(m),{href:r.url,class:`hover:text-foreground hover:underline`},{default:u(()=>[t(d(r.title),1)]),_:2},1032,[`href`]),e(n(y),{class:`size-3.5`})],64))),128)),a(`span`,D,d(r.page.title),1)])):p(``,!0),a(`header`,O,[a(`div`,k,[a(`h1`,A,d(r.page.title),1),r.page.published_at?(c(),o(`p`,j,`Zuletzt aktualisiert am `+d(n(v)(r.page.published_at)),1)):p(``,!0)]),r.editor?(c(),f(n(b),{key:0,variant:`outline`,"as-child":``},{default:u(()=>[e(n(m),{href:r.editor.url},{default:u(()=>[e(n(S)),F[0]||=t(` Bearbeiten`,-1)]),_:1},8,[`href`])]),_:1})):p(``,!0)]),r.editor&&(!r.page.is_published||r.editor.has_draft||r.editor.scheduled_at)?(c(),o(`div`,M,[r.editor.scheduled_at?(c(),f(n(_),{key:0,class:`mt-0.5 size-4 shrink-0 text-brand-text`})):(c(),f(n(S),{key:1,class:`mt-0.5 size-4 shrink-0 text-brand-text`})),a(`p`,null,[r.page.is_published?r.editor.scheduled_at?(c(),o(l,{key:1},[t(`Eine neue Fassung wird am `+d(new Date(r.editor.scheduled_at).toLocaleString(`de-DE`,{dateStyle:`medium`,timeStyle:`short`}))+` veröffentlicht.`,1)],64)):(c(),o(l,{key:2},[t(`Es gibt unveröffentlichte Änderungen an dieser Seite.`)],64)):(c(),o(l,{key:0},[t(`Diese Seite ist noch nicht veröffentlicht. Nur Redakteure sehen sie.`)],64)),e(n(m),{href:r.editor.url,class:`ml-1 font-medium text-brand-text hover:underline`},{default:u(()=>[...F[1]||=[t(`Im Editor öffnen`,-1)]]),_:1},8,[`href`])])])):p(``,!0),e(x,{content:r.content},null,8,[`content`]),r.content.blocks.length?p(``,!0):(c(),o(`p`,N,`Diese Seite hat noch keinen Inhalt.`))],2)],2)]),_:1},8,[`title`]))}};export{P as default};
|
||||
1
public/build/assets/Show-DDDWcurK.js
Normal file
1
public/build/assets/Show-DDDWcurK.js
Normal file
|
|
@ -0,0 +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{n as u}from"./app-qaQo9ARB.js";import{t as d}from"./arrow-left-CeYKHQbE.js";import{t as f}from"./AppLayout-Xi_ip4AB.js";import{t as p}from"./calendar-clock-CwsI-C0a.js";import{k as m}from"./PersonAvatar-CD4S56En.js";import{t as h}from"./FormRenderer-BrPUPdr2.js";var g={class:`mx-auto max-w-3xl`},_={class:`text-3xl font-semibold tracking-tight`},v={key:0,class:`mt-3 leading-relaxed whitespace-pre-line text-muted-foreground`},y={key:1,class:`mt-3 inline-flex items-center gap-1.5 text-[13px] text-muted-foreground`},b={class:`@container mt-8 rounded-lg border bg-card p-5 sm:p-8`},x={__name:`Show`,props:{form:{type:Object,required:!0}},setup(x){return(S,C)=>(a(),c(f,{title:x.form.title},{default:o(()=>[r(`div`,g,[e(n(u),{href:`/formulare`,class:`mb-6 inline-flex items-center gap-1.5 text-sm font-medium text-muted-foreground hover:text-foreground`},{default:o(()=>[e(n(d),{class:`size-4`}),C[0]||=t(` Alle Formulare `,-1)]),_:1}),r(`h1`,_,s(x.form.title),1),x.form.description?(a(),i(`p`,v,s(x.form.description),1)):l(``,!0),x.form.closes_at&&x.form.open?(a(),i(`p`,y,[e(n(p),{class:`size-4`}),t(` Einsendeschluss: `+s(n(m)(x.form.closes_at)),1)])):l(``,!0),r(`div`,b,[e(h,{form:x.form},null,8,[`form`])])])]),_:1},8,[`title`]))}};export{x as default};
|
||||
|
|
@ -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-B3SzpsCA.js";import{t as p}from"./arrow-left-CeYKHQbE.js";import{t as m}from"./AppLayout-t5KmyFQO.js";import{k as h,t as g}from"./PersonAvatar-CD4S56En.js";import{t as _}from"./clock-IVbPqglU.js";import{t as v}from"./pen-line-Clpe2kUm.js";import{t as y}from"./button-BVLATeqq.js";import{n as b}from"./NewsImage-CU6jD5fm.js";import{t as x}from"./NewsCard-KwOJE7h8.js";var S={class:`mx-auto max-w-3xl`},C={class:`mb-6 flex items-center justify-between gap-4`},w={class:`mt-2 text-3xl leading-tight font-semibold tracking-tight sm:text-[34px]`},T={key:0,class:`mt-4 text-lg leading-relaxed text-muted-foreground`},E={class:`mt-6 flex flex-wrap items-center gap-x-6 gap-y-3 border-y py-4 text-sm`},D={class:`block font-medium`},O={key:0,class:`block text-xs text-muted-foreground`},k={class:`text-muted-foreground`},A={class:`inline-flex items-center gap-1.5 text-muted-foreground`},j=[`src`,`alt`],M=[`innerHTML`],N={key:0,class:`mx-auto mt-16 max-w-5xl`},P={class:`grid gap-5 sm:grid-cols-2 lg:grid-cols-3`},F={__name:`Show`,props:{post:{type:Object,required:!0},related:{type:Object,required:!0},editUrl:{type:String,default:null}},setup(F){return(I,L)=>(o(),u(m,{title:F.post.title},{default:c(()=>[r(`article`,S,[r(`div`,C,[e(n(f),{href:`/neuigkeiten`,class:`inline-flex items-center gap-1.5 text-sm font-medium text-muted-foreground hover:text-foreground`},{default:c(()=>[e(n(p),{class:`size-4`}),L[0]||=t(` Alle Neuigkeiten `,-1)]),_:1}),F.editUrl?(o(),u(n(y),{key:0,variant:`outline`,size:`sm`,"as-child":``},{default:c(()=>[e(n(f),{href:F.editUrl},{default:c(()=>[e(n(v)),L[1]||=t(` Bearbeiten`,-1)]),_:1},8,[`href`])]),_:1})):d(``,!0)]),r(`header`,null,[e(b,{category:F.post.category},null,8,[`category`]),r(`h1`,w,l(F.post.title),1),F.post.teaser?(o(),i(`p`,T,l(F.post.teaser),1)):d(``,!0),r(`div`,E,[F.post.author?(o(),u(n(f),{key:0,href:`/personen/${F.post.author.id}`,class:`flex items-center gap-3 hover:underline`},{default:c(()=>[e(g,{person:F.post.author,class:`size-9`},null,8,[`person`]),r(`span`,null,[r(`span`,D,l(F.post.author.name),1),F.post.author.job_title?(o(),i(`span`,O,l(F.post.author.job_title),1)):d(``,!0)])]),_:1},8,[`href`])):d(``,!0),r(`span`,k,l(n(h)(F.post.published_at)),1),r(`span`,A,[e(n(_),{class:`size-4`}),t(` `+l(F.post.reading_minutes)+` Min. Lesezeit`,1)])])]),F.post.cover_url?(o(),i(`img`,{key:0,src:F.post.cover_url,alt:F.post.title,class:`mt-8 aspect-video w-full rounded-lg object-cover`},null,8,j)):d(``,!0),r(`div`,{class:`prose prose-neutral mt-8 max-w-none prose-headings:tracking-tight prose-img:rounded-lg`,innerHTML:F.post.body_html},null,8,M)]),F.related.data.length?(o(),i(`section`,N,[L[2]||=r(`h2`,{class:`mb-4 text-lg font-semibold`},`Weitere Beiträge`,-1),r(`div`,P,[(o(!0),i(s,null,a(F.related.data,e=>(o(),u(x,{key:e.id,post:e},null,8,[`post`]))),128))])])):d(``,!0)]),_:1},8,[`title`]))}};export{F 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-qaQo9ARB.js";import{t as p}from"./arrow-left-CeYKHQbE.js";import{t as m}from"./AppLayout-Xi_ip4AB.js";import{k as h,t as g}from"./PersonAvatar-CD4S56En.js";import{t as _}from"./clock-IVbPqglU.js";import{t as v}from"./pen-line-Clpe2kUm.js";import{t as y}from"./button-BVLATeqq.js";import{n as b}from"./NewsImage-CU6jD5fm.js";import{t as x}from"./NewsCard-DI4a_WuI.js";var S={class:`mx-auto max-w-3xl`},C={class:`mb-6 flex items-center justify-between gap-4`},w={class:`mt-2 text-3xl leading-tight font-semibold tracking-tight sm:text-[34px]`},T={key:0,class:`mt-4 text-lg leading-relaxed text-muted-foreground`},E={class:`mt-6 flex flex-wrap items-center gap-x-6 gap-y-3 border-y py-4 text-sm`},D={class:`block font-medium`},O={key:0,class:`block text-xs text-muted-foreground`},k={class:`text-muted-foreground`},A={class:`inline-flex items-center gap-1.5 text-muted-foreground`},j=[`src`,`alt`],M=[`innerHTML`],N={key:0,class:`mx-auto mt-16 max-w-5xl`},P={class:`grid gap-5 sm:grid-cols-2 lg:grid-cols-3`},F={__name:`Show`,props:{post:{type:Object,required:!0},related:{type:Object,required:!0},editUrl:{type:String,default:null}},setup(F){return(I,L)=>(o(),u(m,{title:F.post.title},{default:c(()=>[r(`article`,S,[r(`div`,C,[e(n(f),{href:`/neuigkeiten`,class:`inline-flex items-center gap-1.5 text-sm font-medium text-muted-foreground hover:text-foreground`},{default:c(()=>[e(n(p),{class:`size-4`}),L[0]||=t(` Alle Neuigkeiten `,-1)]),_:1}),F.editUrl?(o(),u(n(y),{key:0,variant:`outline`,size:`sm`,"as-child":``},{default:c(()=>[e(n(f),{href:F.editUrl},{default:c(()=>[e(n(v)),L[1]||=t(` Bearbeiten`,-1)]),_:1},8,[`href`])]),_:1})):d(``,!0)]),r(`header`,null,[e(b,{category:F.post.category},null,8,[`category`]),r(`h1`,w,l(F.post.title),1),F.post.teaser?(o(),i(`p`,T,l(F.post.teaser),1)):d(``,!0),r(`div`,E,[F.post.author?(o(),u(n(f),{key:0,href:`/personen/${F.post.author.id}`,class:`flex items-center gap-3 hover:underline`},{default:c(()=>[e(g,{person:F.post.author,class:`size-9`},null,8,[`person`]),r(`span`,null,[r(`span`,D,l(F.post.author.name),1),F.post.author.job_title?(o(),i(`span`,O,l(F.post.author.job_title),1)):d(``,!0)])]),_:1},8,[`href`])):d(``,!0),r(`span`,k,l(n(h)(F.post.published_at)),1),r(`span`,A,[e(n(_),{class:`size-4`}),t(` `+l(F.post.reading_minutes)+` Min. Lesezeit`,1)])])]),F.post.cover_url?(o(),i(`img`,{key:0,src:F.post.cover_url,alt:F.post.title,class:`mt-8 aspect-video w-full rounded-lg object-cover`},null,8,j)):d(``,!0),r(`div`,{class:`prose prose-neutral mt-8 max-w-none prose-headings:tracking-tight prose-img:rounded-lg`,innerHTML:F.post.body_html},null,8,M)]),F.related.data.length?(o(),i(`section`,N,[L[2]||=r(`h2`,{class:`mb-4 text-lg font-semibold`},`Weitere Beiträge`,-1),r(`div`,P,[(o(!0),i(s,null,a(F.related.data,e=>(o(),u(x,{key:e.id,post:e},null,8,[`post`]))),128))])])):d(``,!0)]),_:1},8,[`title`]))}};export{F as default};
|
||||
|
|
@ -1 +1 @@
|
|||
import{D as e,On as t,Zn 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-B3SzpsCA.js";import{t as p}from"./chevron-right-2hoRrfAe.js";import{t as m}from"./file-text-Dmdo-Zwf.js";var h={key:0,class:`mb-3 text-lg font-semibold`},g={class:`min-w-0 flex-1 truncate font-medium group-hover:underline`},_={__name:`Subpages`,props:{block:{type:Object,required:!0}},setup(_){return(v,y)=>(o(),i(`section`,null,[_.block.data.title?(o(),i(`h3`,h,l(_.block.data.title),1)):d(``,!0),r(`div`,{class:n(_.block.data.layout===`list`?`divide-y rounded-lg border bg-card`:`grid gap-3 @xl:grid-cols-2 @4xl:grid-cols-3`)},[(o(!0),i(s,null,a(_.block.props?.pages??[],i=>(o(),u(t(f),{key:i.id,href:i.url,class:n([`group flex items-center gap-3 hover:bg-accent/50`,_.block.data.layout===`list`?`px-4 py-3`:`rounded-lg border bg-card p-4`])},{default:c(()=>[e(t(m),{class:`size-5 shrink-0 text-brand-text`}),r(`span`,g,l(i.title),1),e(t(p),{class:`size-4 text-muted-foreground`})]),_:2},1032,[`href`,`class`]))),128)),(_.block.props?.pages??[]).length?d(``,!0):(o(),i(`p`,{key:0,class:n([`text-sm text-muted-foreground`,_.block.data.layout===`list`?`px-4 py-3`:``])},`Keine veröffentlichten Unterseiten.`,2))],2)]))}};export{_ as default};
|
||||
import{D as e,On as t,Zn 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-qaQo9ARB.js";import{t as p}from"./chevron-right-2hoRrfAe.js";import{t as m}from"./file-text-Dmdo-Zwf.js";var h={key:0,class:`mb-3 text-lg font-semibold`},g={class:`min-w-0 flex-1 truncate font-medium group-hover:underline`},_={__name:`Subpages`,props:{block:{type:Object,required:!0}},setup(_){return(v,y)=>(o(),i(`section`,null,[_.block.data.title?(o(),i(`h3`,h,l(_.block.data.title),1)):d(``,!0),r(`div`,{class:n(_.block.data.layout===`list`?`divide-y rounded-lg border bg-card`:`grid gap-3 @xl:grid-cols-2 @4xl:grid-cols-3`)},[(o(!0),i(s,null,a(_.block.props?.pages??[],i=>(o(),u(t(f),{key:i.id,href:i.url,class:n([`group flex items-center gap-3 hover:bg-accent/50`,_.block.data.layout===`list`?`px-4 py-3`:`rounded-lg border bg-card p-4`])},{default:c(()=>[e(t(m),{class:`size-5 shrink-0 text-brand-text`}),r(`span`,g,l(i.title),1),e(t(p),{class:`size-4 text-muted-foreground`})]),_:2},1032,[`href`,`class`]))),128)),(_.block.props?.pages??[]).length?d(``,!0):(o(),i(`p`,{key:0,class:n([`text-sm text-muted-foreground`,_.block.data.layout===`list`?`px-4 py-3`:``])},`Keine veröffentlichten Unterseiten.`,2))],2)]))}};export{_ as default};
|
||||
1
public/build/assets/Switch-Bijyy0EE.js
Normal file
1
public/build/assets/Switch-Bijyy0EE.js
Normal file
|
|
@ -0,0 +1 @@
|
|||
import{_ as e,u as t}from"./RovingFocusGroup-HoUPhonB.js";import{$n as n,D as r,On as i,Tn as a,Zn as o,b as s,et as c,g as l,k as u,mt as d,o as f,qt as p,v as m,xt as h,y as g,z as _}from"./runtime-core.esm-bundler-B8D2lM98.js";import{C as v,w as y}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{S as b,c as x,h as S,p as C,t as w}from"./utils-DfNUDixG.js";import{n as T,r as E,t as D}from"./VisuallyHiddenInput-DHw-iIzi.js";var[O,k]=e(`SwitchRoot`),A=u({inheritAttrs:!1,__name:`SwitchRoot`,props:{defaultValue:{type:null,required:!1},modelValue:{type:null,required:!1,default:void 0},disabled:{type:Boolean,required:!1},id:{type:String,required:!1},value:{type:String,required:!1,default:`on`},trueValue:{type:null,required:!1,default:()=>!0},falseValue:{type:null,required:!1,default:()=>!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,o=t,{disabled:u}=a(n),_=b(n,`modelValue`,o,{defaultValue:n.defaultValue??n.falseValue,passive:n.modelValue===void 0}),x=l(()=>_.value===n.trueValue);function w(){u.value||(_.value=x.value?n.falseValue:n.trueValue)}let{forwardRef:O,currentElement:A}=S(),j=E(A),M=T(),N=l(()=>n.id&&A.value?document.querySelector(`[for="${n.id}"]`)?.innerText:void 0);return k({checked:x,toggleCheck:w,disabled:u}),(e,t)=>(d(),s(f,null,[r(i(C),c({id:e.id,ref:i(O),role:`switch`,type:e.as===`button`?`button`:void 0,value:e.value,"aria-label":e.$attrs[`aria-label`]||N.value,"aria-checked":x.value,"aria-required":e.required,"data-state":x.value?`checked`:`unchecked`,"data-disabled":i(u)?``:void 0,"as-child":e.asChild,as:e.as,disabled:i(u)},{...i(M),...e.$attrs},{onClick:w,onKeydown:v(y(w,[`prevent`]),[`enter`])}),{default:p(()=>[h(e.$slots,`default`,{modelValue:i(_),checked:x.value})]),_:3},16,[`id`,`type`,`value`,`aria-label`,`aria-checked`,`aria-required`,`data-state`,`data-disabled`,`as-child`,`as`,`disabled`,`onKeydown`]),i(j)&&e.name?(d(),m(i(D),c({key:0,type:`checkbox`,name:e.name,disabled:i(u),required:e.required,value:e.value,checked:x.value},i(M)),null,16,[`name`,`disabled`,`required`,`value`,`checked`])):g(`v-if`,!0)],64))}}),j=u({__name:`SwitchThumb`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let t=O();return S(),(e,n)=>(d(),m(i(C),{"data-state":i(t).checked.value?`checked`:`unchecked`,"data-disabled":i(t).disabled.value?``:void 0,"as-child":e.asChild,as:e.as},{default:p(()=>[h(e.$slots,`default`)]),_:3},8,[`data-state`,`data-disabled`,`as-child`,`as`]))}}),M=u({__name:`Switch`,props:{defaultValue:{},modelValue:{},disabled:{type:Boolean},id:{},value:{},trueValue:{},falseValue:{},asChild:{type:Boolean},as:{},name:{},required:{type:Boolean},class:{type:[Boolean,null,String,Object,Array]}},emits:[`update:modelValue`],setup(e,{emit:a}){let s=e,l=a,u=x(s,`class`),f=t(u,l);return(e,t)=>(d(),m(i(A),c({"data-slot":`switch`},i(f),{class:i(w)(`peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50`,s.class)}),{default:p(t=>[r(i(j),{"data-slot":`switch-thumb`,class:o(i(w)(`bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0`))},{default:p(()=>[h(e.$slots,`thumb`,n(_(t)))]),_:2},1032,[`class`])]),_:3},16,[`class`]))}});export{M as t};
|
||||
|
|
@ -1,2 +1,2 @@
|
|||
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/RichTextEditor-SFePC83k.js","assets/RovingFocusGroup-HoUPhonB.js","assets/runtime-core.esm-bundler-B8D2lM98.js","assets/runtime-dom.esm-bundler-BEWGoe8n.js","assets/utils-DfNUDixG.js","assets/check-NR_gS8I-.js","assets/PersonAvatar-CD4S56En.js","assets/link-BE7bRFjZ.js","assets/RichTextEditor-Lf5W1_X5.css"])))=>i.map(i=>d[i]);
|
||||
import{J as e,O as t,On as n,b as r,mt as i,v as a}from"./runtime-core.esm-bundler-B8D2lM98.js";import{o}from"./app-B3SzpsCA.js";var s=[`innerHTML`],c={__name:`Text`,props:{block:{type:Object,required:!0}},setup(c){let l=e(`pagebuilder:editing`,!1),u=t(()=>o(()=>import(`./RichTextEditor-SFePC83k.js`).then(e=>e.t),__vite__mapDeps([0,1,2,3,4,5,6,7,8])));return(e,t)=>n(l)?(i(),a(n(u),{key:0,modelValue:c.block.data.html,"onUpdate:modelValue":t[0]||=e=>c.block.data.html=e,placeholder:`Text eingeben …`},null,8,[`modelValue`])):(i(),r(`div`,{key:1,class:`prose prose-neutral max-w-none prose-headings:tracking-tight prose-img:rounded-lg`,innerHTML:c.block.data.html},null,8,s))}};export{c as default};
|
||||
import{J as e,O as t,On as n,b as r,mt as i,v as a}from"./runtime-core.esm-bundler-B8D2lM98.js";import{o}from"./app-qaQo9ARB.js";var s=[`innerHTML`],c={__name:`Text`,props:{block:{type:Object,required:!0}},setup(c){let l=e(`pagebuilder:editing`,!1),u=t(()=>o(()=>import(`./RichTextEditor-SFePC83k.js`).then(e=>e.t),__vite__mapDeps([0,1,2,3,4,5,6,7,8])));return(e,t)=>n(l)?(i(),a(n(u),{key:0,modelValue:c.block.data.html,"onUpdate:modelValue":t[0]||=e=>c.block.data.html=e,placeholder:`Text eingeben …`},null,8,[`modelValue`])):(i(),r(`div`,{key:1,class:`prose prose-neutral max-w-none prose-headings:tracking-tight prose-img:rounded-lg`,innerHTML:c.block.data.html},null,8,s))}};export{c as default};
|
||||
|
|
@ -1 +0,0 @@
|
|||
import{On as e,Yt as t,Zn as n,b as r,k as i,mt as a,un as o}from"./runtime-core.esm-bundler-B8D2lM98.js";import{x as s}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{j as c,t as l}from"./utils-DfNUDixG.js";import{i as u}from"./dist-FqXf5I3H.js";var d=c({name:`trash`,size:24,node:[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]],aliases:[`trash-2`]}),f=i({__name:`Textarea`,props:{class:{type:[Boolean,null,String,Object,Array]},defaultValue:{},modelValue:{}},emits:[`update:modelValue`],setup(i,{emit:c}){let d=i,f=u(d,`modelValue`,c,{passive:!0,defaultValue:d.defaultValue});return(i,c)=>t((a(),r(`textarea`,{"onUpdate:modelValue":c[0]||=e=>o(f)?f.value=e:null,"data-slot":`textarea`,class:n(e(l)(`border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`,d.class))},null,2)),[[s,e(f)]])}});export{d as n,f as t};
|
||||
1
public/build/assets/Textarea-_u9EqblO.js
Normal file
1
public/build/assets/Textarea-_u9EqblO.js
Normal file
|
|
@ -0,0 +1 @@
|
|||
import{On as e,Yt as t,Zn as n,b as r,k as i,mt as a,un as o}from"./runtime-core.esm-bundler-B8D2lM98.js";import{x as s}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{t as c}from"./utils-DfNUDixG.js";import{i as l}from"./dist-FqXf5I3H.js";var u=i({__name:`Textarea`,props:{class:{type:[Boolean,null,String,Object,Array]},defaultValue:{},modelValue:{}},emits:[`update:modelValue`],setup(i,{emit:u}){let d=i,f=l(d,`modelValue`,u,{passive:!0,defaultValue:d.defaultValue});return(i,l)=>t((a(),r(`textarea`,{"onUpdate:modelValue":l[0]||=e=>o(f)?f.value=e:null,"data-slot":`textarea`,class:n(e(c)(`border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`,d.class))},null,2)),[[s,e(f)]])}});export{u as t};
|
||||
|
|
@ -1 +1 @@
|
|||
import{On 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"./calendar-days-Cq3ZXY-S.js";import{t as c}from"./EventListItem-BBsqXvqV.js";import{t as l}from"./EmptyState-Ceq4v8mE.js";import{t as u}from"./Panel-CvqF6bx0.js";var d={key:0,class:`-my-3 divide-y`},f={__name:`Upcoming`,props:{events:{type:Array,required:!0}},setup(f){return(p,m)=>(r(),o(u,{title:`Termine`,"action-label":`Alle Termine`,"action-href":`/termine`},{default:a(()=>[f.events.length?(r(),t(`div`,d,[(r(!0),t(i,null,n(f.events,e=>(r(),o(c,{key:e.id,event:e},null,8,[`event`]))),128))])):(r(),o(l,{key:1,icon:e(s),title:`Keine anstehenden Termine`,class:`py-6`},null,8,[`icon`]))]),_:1}))}};export{f as default};
|
||||
import{On 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"./calendar-days-Cq3ZXY-S.js";import{t as c}from"./EventListItem-C-X2Rk4q.js";import{t as l}from"./EmptyState-Ceq4v8mE.js";import{t as u}from"./Panel-GlXreVuM.js";var d={key:0,class:`-my-3 divide-y`},f={__name:`Upcoming`,props:{events:{type:Array,required:!0}},setup(f){return(p,m)=>(r(),o(u,{title:`Termine`,"action-label":`Alle Termine`,"action-href":`/termine`},{default:a(()=>[f.events.length?(r(),t(`div`,d,[(r(!0),t(i,null,n(f.events,e=>(r(),o(c,{key:e.id,event:e},null,8,[`event`]))),128))])):(r(),o(l,{key:1,icon:e(s),title:`Keine anstehenden Termine`,class:`py-6`},null,8,[`icon`]))]),_:1}))}};export{f as default};
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue