composer
This commit is contained in:
1 parent
c2981d43f6
commit
301443d8c4
25 files changed
+473
-565
No files matched your search
+22
-39
@@ -19,6 +19,7 @@ use Filament\Forms\Components\RichEditor;
|
||||
use Filament\Forms\Components\RichEditor\RichContentRenderer;
|
||||
use Filament\Forms\Components\Select;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Forms\Components\ToggleButtons;
|
||||
use Filament\Resources\RelationManagers\RelationManager;
|
||||
use Filament\Schemas\Components\Fieldset;
|
||||
use Filament\Schemas\Components\Grid;
|
||||
@@ -34,7 +35,6 @@ use Filament\Tables\Filters\Filter;
|
||||
use Filament\Tables\Table;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use ToneGabes\BetterOptions\Forms\Components\RadioCards;
|
||||
use ToneGabes\Filament\Icons\Enums\Phosphor;
|
||||
|
||||
class ProjektInhaltsverzeichnisRelationManager extends RelationManager
|
||||
@@ -97,7 +97,7 @@ 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([
|
||||
@@ -222,7 +222,7 @@ 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([
|
||||
@@ -344,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 => ''
|
||||
}),
|
||||
@@ -369,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()
|
||||
@@ -382,56 +382,39 @@ class ProjektInhaltsverzeichnisRelationManager extends RelationManager
|
||||
->filters([
|
||||
Filter::make('partfilters')
|
||||
->schema([
|
||||
RadioCards::make('part')
|
||||
->columns(3)
|
||||
->iconAfter()
|
||||
->indicatorBefore()
|
||||
// ->hiddenIcon()
|
||||
ToggleButtons::make('part')
|
||||
->inline()
|
||||
->hiddenLabel()
|
||||
->default('standard')
|
||||
->options([
|
||||
'standard' => 'Gutachten Standard',
|
||||
'nutzwerte' => 'Nutzwertberechnung',
|
||||
'paragraph' => 'Auszug Gutachten',
|
||||
'paragraph' => 'Auszug Gutachten §6',
|
||||
])
|
||||
->icons([
|
||||
'standard' => Phosphor::ListNumbers->thin(),
|
||||
'nutzwerte' => Phosphor::Table->thin(),
|
||||
'paragraph' => Phosphor::Paragraph->thin(),
|
||||
])
|
||||
->idleIndicator('phosphor-circle')
|
||||
->selectedIndicator('phosphor-circle-fill')
|
||||
->descriptions([
|
||||
'standard' => 'Inhaltsangabe, Texte',
|
||||
'nutzwerte' => 'Tabellen',
|
||||
'paragraph' => 'Gemäß Paragraph §6',
|
||||
'standard' => Phosphor::ListNumbers,
|
||||
'nutzwerte' => Phosphor::Table,
|
||||
'paragraph' => Phosphor::Paragraph,
|
||||
]),
|
||||
])
|
||||
->query(function (Builder $query, array $data): Builder {
|
||||
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)
|
||||
// ->filters([
|
||||
// SelectFilter::make('part')
|
||||
// ->selectablePlaceholder(false)
|
||||
// ->default('standard')
|
||||
// ->label('Gutachten Komponenten')
|
||||
// ->options([
|
||||
// 'standard' => 'Gutachten Standard Texte',
|
||||
// 'nutzwerte' => 'Nutzwertberechnung',
|
||||
// 'paragraph' => 'Auszug Gutachten gem. §6',
|
||||
// ]),
|
||||
// ], FiltersLayout::AboveContent)
|
||||
->defaultSort('sort', direction: 'asc')
|
||||
->reorderable('sort')
|
||||
->reorderRecordsTriggerAction(
|
||||
fn (Action $action, bool $isReordering) => $action
|
||||
->button()
|
||||
->label($isReordering ? 'Reihenfolge schließen' : 'Reihenfolge Aktivieren')
|
||||
)
|
||||
->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.')
|
||||
@@ -440,12 +423,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([
|
||||
|
||||
Reference in new issue
Block a user