This commit is contained in:
salam committed 2026-07-13 12:28:01 +02:00
1 parent ca616f9728
commit de41dd5187
2 files changed
+135 -113

No files matched your search

@@ -55,7 +55,6 @@ class ProjektInhaltsverzeichnisRelationManager extends RelationManager
->components([
Tabs::make('Tabs')
->tabs([
Hidden::make('added_manuel')->default(1),
Tab::make('Überschrift')
->schema([
Checkbox::make('neue_seite')
@@ -98,22 +97,34 @@ class ProjektInhaltsverzeichnisRelationManager extends RelationManager
TextInput::make('konto_textblock_id')->hidden(),
RichEditor::make('textblock')
->hiddenLabel()
->aboveLabel(fn ($record): string => $record?->inhaltselement_id != 0 ? 'Ausgabe vor Inhaltselement' : '')
->aboveLabel(fn($record): string => $record?->inhaltselement_id != 0 ? 'Ausgabe vor Inhaltselement' : '')
->columnSpan(5)
->extraInputAttributes(['style' => 'min-height: 20rem; max-height: 50vh; overflow-y: auto;'])
->toolbarButtons([
['bold', 'italic', 'underline', 'strike', 'subscript', 'superscript', 'horizontalRule', 'table'],
])->floatingToolbars([
'paragraph' => [
'bold', 'italic', 'underline', 'strike', 'subscript', 'superscript',
'bold',
'italic',
'underline',
'strike',
'subscript',
'superscript',
],
'heading' => [
'h1', 'h2', 'h3',
'h1',
'h2',
'h3',
],
'table' => [
'tableAddColumnBefore', 'tableAddColumnAfter', 'tableDeleteColumn',
'tableAddRowBefore', 'tableAddRowAfter', 'tableDeleteRow',
'tableMergeCells', 'tableSplitCell',
'tableAddColumnBefore',
'tableAddColumnAfter',
'tableDeleteColumn',
'tableAddRowBefore',
'tableAddRowAfter',
'tableDeleteRow',
'tableMergeCells',
'tableSplitCell',
'tableToggleHeaderRow',
'tableDelete',
],
@@ -211,22 +222,34 @@ class ProjektInhaltsverzeichnisRelationManager extends RelationManager
TextInput::make('konto_textblock_id')->hidden(),
RichEditor::make('textblock2')
->hiddenLabel()
->aboveLabel(fn ($record): string => $record?->inhaltselement_id != 0 ? 'Ausgabe nach Inhaltselement' : '')
->aboveLabel(fn($record): string => $record?->inhaltselement_id != 0 ? 'Ausgabe nach Inhaltselement' : '')
->columnSpan(5)
->extraInputAttributes(['style' => 'min-height: 20rem; max-height: 50vh; overflow-y: auto;'])
->toolbarButtons([
['bold', 'italic', 'underline', 'strike', 'subscript', 'superscript', 'horizontalRule', 'table'],
])->floatingToolbars([
'paragraph' => [
'bold', 'italic', 'underline', 'strike', 'subscript', 'superscript',
'bold',
'italic',
'underline',
'strike',
'subscript',
'superscript',
],
'heading' => [
'h1', 'h2', 'h3',
'h1',
'h2',
'h3',
],
'table' => [
'tableAddColumnBefore', 'tableAddColumnAfter', 'tableDeleteColumn',
'tableAddRowBefore', 'tableAddRowAfter', 'tableDeleteRow',
'tableMergeCells', 'tableSplitCell',
'tableAddColumnBefore',
'tableAddColumnAfter',
'tableDeleteColumn',
'tableAddRowBefore',
'tableAddRowAfter',
'tableDeleteRow',
'tableMergeCells',
'tableSplitCell',
'tableToggleHeaderRow',
'tableDelete',
],
@@ -254,7 +277,6 @@ class ProjektInhaltsverzeichnisRelationManager extends RelationManager
KontoTextblock::where('id', $record['konto_textblock_id'])
->update(['name' => $data['name'], 'textblock' => RichContentRenderer::make($record['textblock'])->toHtml()]);
}),
Action::make('neu')
->iconButton()
@@ -322,13 +344,13 @@ class ProjektInhaltsverzeichnisRelationManager extends RelationManager
->alignRight()
->width('2rem')
->label('Index')
->getStateUsing(fn ($record): string => $record->ordnungszahl == '0' ? '' : number_format($record->ordnungszahl, 2)),
->getStateUsing(fn($record): string => $record->ordnungszahl == '0' ? '' : number_format($record->ordnungszahl, 2)),
IconColumn::make('neue_seite')
->tooltip('Start neue Seite')
->alignCenter()
->label('Start')
->color('primary')
->icon(fn (string $state): string => match ($state) {
->icon(fn(string $state): string => match ($state) {
'1' => 'phosphor-file-plus',
default => ''
}),
@@ -347,7 +369,7 @@ class ProjektInhaltsverzeichnisRelationManager extends RelationManager
->width('2rem')
->alignCenter()
->tooltip('Bei 0 wird keine Seitenzahl ausgegeben.')
->getStateUsing(fn ($record): string => $record->seite == 0 ? '' : $record->seite),
->getStateUsing(fn($record): string => $record->seite == 0 ? '' : $record->seite),
])
// ->defaultPaginationPageOption(5)
->persistFiltersInSession()
@@ -389,7 +411,7 @@ class ProjektInhaltsverzeichnisRelationManager extends RelationManager
return $query
->when(
$data['part'],
fn (Builder $query, $part): Builder => $query->where('part', $part),
fn(Builder $query, $part): Builder => $query->where('part', $part),
);
}),
], layout: FiltersLayout::AboveContent)
@@ -408,8 +430,8 @@ class ProjektInhaltsverzeichnisRelationManager extends RelationManager
->reorderable('sort')
->headerActions([
Action::make('generate')
->action(fn (CreateProjektInhaltsverzeichnis $createInhaltsverzeichnis) => $createInhaltsverzeichnis->create($this->ownerRecord))
->hidden(fn (): bool => $this->ownerRecord->bezahlt_am ? false : true)
->action(fn(CreateProjektInhaltsverzeichnis $createInhaltsverzeichnis) => $createInhaltsverzeichnis->create($this->ownerRecord))
->hidden(fn(): bool => $this->ownerRecord->bezahlt_am ? false : true)
->requiresConfirmation()
->modalHeading('Inhaltsverzeichnis neu generieren')
->modalDescription('Bestehende Daten werden gelöscht.')
@@ -418,12 +440,12 @@ class ProjektInhaltsverzeichnisRelationManager extends RelationManager
->tooltip('Inhaltsverzeichnis wird neu erstellt.')
->icon('phosphor-gear'),
CreateAction::make()
->hidden(fn (): bool => $this->ownerRecord->bezahlt_am ? false : true)
->hidden(fn(): bool => $this->ownerRecord->bezahlt_am ? false : true)
->icon('phosphor-file-plus')
->createAnother(false),
])
->recordActions([
EditAction::make()->iconButton()->hidden(fn ($record) => (bool) $record->no_edit),
EditAction::make()->iconButton()->hidden(fn($record) => (bool) $record->no_edit),
DeleteAction::make()->iconButton(),
])
->toolbarActions([