KontoTextblocksTable

This commit is contained in:
salam committed 2025-10-12 11:51:33 +02:00
1 parent ae828ab8f5
commit eaed59cceb
19 files changed
+532 -97

No files matched your search

@@ -60,6 +60,8 @@ class ProjektInhaltsverzeichnisRelationManager extends RelationManager
]),
Fieldset::make('Vorlagen')
->hiddenLabel()
->hidden(fn ($record): bool => ! isset($record) || ! $record['textblock_kennung_id'])
->schema([
Action::make('textblock_sichern')
->schema([
@@ -76,7 +78,7 @@ class ProjektInhaltsverzeichnisRelationManager extends RelationManager
return $record['textblock'];
}),
TextInput::make('name')->required()
->label('Name der Vorlage')
->label('Geben sie dem Textblock einen eindeutigen Namen')
->validationMessages([
'different' => 'Name ist schon in Verwendung bitte verwenden Sie einen eindeutig Namen.',
])
@@ -85,9 +87,9 @@ class ProjektInhaltsverzeichnisRelationManager extends RelationManager
return $record['name'];
}),
])
->modalSubmitActionLabel('Sichern')
->icon('phosphor-floppy-disk')
->tooltip('Ein veränderter Textblock kann als persönliche Vorlage gespeichert werden.')
->hidden(fn ($record): bool => ! $record['textblock_kennung_id'])
->color('info')
->action(function (array $mountedActions, $data) {
@@ -106,12 +108,15 @@ class ProjektInhaltsverzeichnisRelationManager extends RelationManager
Action::make('textblock_laden')
->schema([
Radio::make('konto_textblock_id')
->label('Personalsierte Vorlagen')
->hiddenLabel()
->options(function ($record) {
return KontoTextblock::where('textblock_kennung_id', $record['textblock_kennung_id'])->where('konto_id', auth()->user()->konto_id)->pluck('name', 'id')->toArray();
}),
})->belowLabel([
'Bitte eine Vorlage auswählen',
]),
])
->icon('phosphor-article')
->modalSubmitActionLabel('Einsetzen')
->color('info')
->tooltip('Personaliserten Texblock laden.')
->action(function (Set $set, array $data) {