This commit is contained in:
salam committed 2025-10-20 18:37:56 +02:00
1 parent 9eb19cf8fd
commit 551ad2369e
17 files changed
+277 -38

No files matched your search

@@ -5,6 +5,7 @@ namespace App\Filament\Resources\Projektes\RelationManagers;
use App\Actions\Create\CreateProjektInhaltsverzeichnis;
use App\Models\KontoTextblock;
use App\Models\ProjektInhaltsverzeichnis;
use App\Models\Tabellen;
use Filament\Actions\Action;
use Filament\Actions\BulkActionGroup;
use Filament\Actions\CreateAction;
@@ -48,7 +49,11 @@ class ProjektInhaltsverzeichnisRelationManager extends RelationManager
Tabs::make('Tabs')
->tabs([
Tab::make('Überschrift')
->hidden(fn ($record) => $record->name == 'DECKBLATT' ? true : false)
->schema([
Checkbox::make('neue_seite')
->label('Start neuer Seite')
->columnSpan(2),
Textarea::make('name')
->required()
->label('Kapitel / Absatz')
@@ -158,6 +163,21 @@ class ProjektInhaltsverzeichnisRelationManager extends RelationManager
])->columns(1),
]),
]),
Tab::make('Tabellen')
->schema([
Select::make('tabellen_id')->label('Tabelle')
->prefixIcon('phosphor-table')
->prefixIconColor(
fn ($record): string => $record->tabellen_id == 0 ? 'gray' : 'primary'
)
->default(0)
->options(function () {
$res = Tabellen::all()->pluck('name', 'id')->toArray();
array_unshift($res, 'Ohne Tabelle');
return $res;
}),
]),
])->columnSpanFull(),
]);
}
@@ -171,6 +191,12 @@ class ProjektInhaltsverzeichnisRelationManager extends RelationManager
->width('2rem')
->label('Index')
->getStateUsing(fn ($record): string => $record->ordnungszahl == '0' ? '' : number_format($record->ordnungszahl, 2)),
IconColumn::make('neue_seite')
->label('Seite')
->icon(fn (string $state): string => match ($state) {
'1' => 'phosphor-file-plus',
default => ''
}),
TextColumn::make('name')
->wrap()
->weight(fn ($record): FontWeight => match ($record->ueberschrift_nicht_anzeigen) {
@@ -221,7 +247,7 @@ class ProjektInhaltsverzeichnisRelationManager extends RelationManager
->createAnother(false),
])
->recordActions([
EditAction::make()->iconButton(),
EditAction::make()->iconButton()->hidden(fn ($record) => $record->name == 'INHALTSVERZEICHNIS' ? true : false),
DeleteAction::make()->iconButton(),
])
->toolbarActions([