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([
|
||||
|
||||
+11
-8
@@ -55,14 +55,14 @@ class ProjektMethodesRelationManager extends RelationManager
|
||||
])
|
||||
->live(),
|
||||
Select::make('aufstellung_id')
|
||||
->visible(fn(Get $get): bool => ! in_array($get('methode_id'), [1, 5]))
|
||||
->visible(fn (Get $get): bool => ! in_array($get('methode_id'), [1, 5]))
|
||||
->label('Aufstellung')
|
||||
->options(Aufstellung::pluck('name', 'id'))
|
||||
->afterStateUpdated(function (Component $livewire) {
|
||||
$livewire->dispatch('refreshMethods');
|
||||
}),
|
||||
TextInput::make('faktor')
|
||||
->visible(fn(Get $get): bool => $get('methode_id') != 1)
|
||||
->visible(fn (Get $get): bool => $get('methode_id') != 1)
|
||||
->suffixIcon('phosphor-function')
|
||||
->numeric()
|
||||
->label('Fläche')
|
||||
@@ -85,7 +85,7 @@ class ProjektMethodesRelationManager extends RelationManager
|
||||
->columns([
|
||||
TextColumn::make('methode.name')
|
||||
->badge()
|
||||
->color(fn($record) => $record->methode->color),
|
||||
->color(fn ($record) => $record->methode->color),
|
||||
TextColumn::make('aufstellung.name'),
|
||||
TextColumn::make('raumart')
|
||||
->searchable(),
|
||||
@@ -120,8 +120,8 @@ class ProjektMethodesRelationManager extends RelationManager
|
||||
TernaryFilter::make('faktor')
|
||||
->label('Faktor fehlt')
|
||||
->queries(
|
||||
true: fn(Builder $query) => $query->where('faktor', '=', 0),
|
||||
false: fn(Builder $query) => $query->where('faktor', '>', 0),
|
||||
true: fn (Builder $query) => $query->where('faktor', '=', 0),
|
||||
false: fn (Builder $query) => $query->where('faktor', '>', 0),
|
||||
),
|
||||
|
||||
], FiltersLayout::AboveContent)
|
||||
@@ -129,6 +129,7 @@ class ProjektMethodesRelationManager extends RelationManager
|
||||
->filtersFormColumns(4)
|
||||
->headerActions([
|
||||
Action::make('Wohnnutzfläche')
|
||||
->color('info')
|
||||
->tooltip('Setzt alle leeren Felder auf "Normale Wohnnutzfläche"')
|
||||
->icon('phosphor-arrow-bend-right-down')
|
||||
->action(function (): void {
|
||||
@@ -142,16 +143,18 @@ class ProjektMethodesRelationManager extends RelationManager
|
||||
->send();
|
||||
}),
|
||||
Action::make('methoden')
|
||||
->color('info')
|
||||
->tooltip('Informationen zu den Methoden')
|
||||
->icon('phosphor-question')
|
||||
->modalCancelAction(fn(Action $action) => $action->label('Schließen'))
|
||||
->modalCancelAction(fn (Action $action) => $action->label('Schließen'))
|
||||
->modalSubmitAction(false)
|
||||
->modalHeading('Hilfe zu Methoden')
|
||||
->slideOver()
|
||||
->modalContent(view('filament.pages.actions.methoden')),
|
||||
Action::make('erstellen')
|
||||
->action(fn(CreateProjektMethoden $createProjektMethoden) => $createProjektMethoden->create($this->ownerRecord))
|
||||
->action(fn (CreateProjektMethoden $createProjektMethoden) => $createProjektMethoden->create($this->ownerRecord))
|
||||
->requiresConfirmation()
|
||||
->hidden(fn(): bool => $this->ownerRecord->bezahlt_am ? false : true)
|
||||
->hidden(fn (): bool => $this->ownerRecord->bezahlt_am ? false : true)
|
||||
->modalHeading('Raum Methoden erstellen')
|
||||
->modalDescription(new HtmlString('Daten werden aus der Tabelle "Objekte im Detail" generiert. Änderungen werden übernommen nicht mehr verwendete Objekte gelöscht. <br>Um die Tabelle neu zu generieren bitte die Tabelle vorher leeren.'))
|
||||
->modalSubmitActionLabel('Generieren')
|
||||
|
||||
@@ -13,15 +13,15 @@ class WidgetMethoden extends TableWidget
|
||||
public function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->query(fn(): Builder => Methode::query()->orderBy('order'))
|
||||
->query(fn (): Builder => Methode::query()->orderBy('order'))
|
||||
->paginated(false)
|
||||
->columns([
|
||||
TextColumn::make('methode')
|
||||
->label('')
|
||||
->color(fn($record) => $record->color)
|
||||
->badge(),
|
||||
TextColumn::make('name')
|
||||
->alignCenter()
|
||||
->label('Methoden')
|
||||
->color(fn ($record) => $record->color),
|
||||
TextColumn::make('description')
|
||||
->description(fn(Methode $record): string => $record->berechnung)
|
||||
->description(fn (Methode $record): string => $record->berechnung)
|
||||
->html()
|
||||
->label('')
|
||||
->wrap(),
|
||||
|
||||
Reference in new issue
Block a user