- Per-user admin mode (simple: bookings/contracts, blocked periods, guests, portal tasks, reviews; expert: everything the role allows), user menu switch, FollowsAdminMode on all resources/pages (guarded by a test); roles keep deciding permissions. - Users list shows mode and 2FA; admins can reset another user's 2FA. - New "Sperrzeiten" list for all apartments (manual blocks editable, portal blocks read-only). - styles/final: clean hand-built SVG mark, logo, favicon (dark-mode aware), 4 icons, wave divider, plus PNG/WebP for mail/PDF/touch icon; colours via --brand-* variables. - Decisions recorded in KONZEPT §6a/6b (booking path 1 via offer + guest acceptance, direct booking later; tourist tax by Ferienservice Balu); agent documents added and marked as analysis with assumptions; styles excluded from the deploy package. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
49 lines
1.8 KiB
PHP
49 lines
1.8 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Resources\Users\Schemas;
|
|
|
|
use App\Enums\AdminMode;
|
|
use App\Enums\UserRole;
|
|
use Filament\Forms\Components\Radio;
|
|
use Filament\Forms\Components\TextInput;
|
|
use Filament\Schemas\Schema;
|
|
|
|
class UserForm
|
|
{
|
|
public static function configure(Schema $schema): Schema
|
|
{
|
|
return $schema
|
|
->columns(2)
|
|
->components([
|
|
TextInput::make('name')
|
|
->label('Name')
|
|
->required()
|
|
->maxLength(255),
|
|
TextInput::make('email')
|
|
->label('E-Mail (Anmeldename)')
|
|
->email()
|
|
->required()
|
|
->unique(ignoreRecord: true)
|
|
->maxLength(255),
|
|
Radio::make('role')
|
|
->label('Rolle')
|
|
->helperText('Bestimmt, was die Person darf.')
|
|
->options(UserRole::class)
|
|
->required()
|
|
->columnSpanFull(),
|
|
Radio::make('admin_mode')
|
|
->label('Ansicht')
|
|
->helperText('Bestimmt nur, was im Menü erscheint. Leer = Administratoren Expertenansicht, alle anderen einfache Ansicht. Jederzeit umschaltbar über das Benutzermenü oben rechts.')
|
|
->options(AdminMode::class)
|
|
->columnSpanFull(),
|
|
TextInput::make('password')
|
|
->label(fn (string $operation): string => $operation === 'create' ? 'Passwort' : 'Neues Passwort (leer lassen = unverändert)')
|
|
->password()
|
|
->revealable()
|
|
->minLength(10)
|
|
->required(fn (string $operation): bool => $operation === 'create')
|
|
->dehydrated(fn (?string $state): bool => filled($state)),
|
|
]);
|
|
}
|
|
}
|