wip methods
This commit is contained in:
1 parent
de41dd5187
commit
2ca6d0c48d
6 files changed
+30
-33
No files matched your search
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace App\Filament\Clusters\Administration\Methodes\Schemas;
|
||||
|
||||
use Filament\Forms\Components\RichEditor;
|
||||
use Filament\Forms\Components\Textarea;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Schemas\Schema;
|
||||
|
||||
@@ -13,12 +13,7 @@ class MethodeForm
|
||||
return $schema
|
||||
->components([
|
||||
TextInput::make('name')->required(),
|
||||
RichEditor::make('description')
|
||||
->label('Beschreibung')
|
||||
->extraInputAttributes(['style' => 'min-height: 20rem; max-height: 50vh; overflow-y: auto;'])
|
||||
->toolbarButtons([
|
||||
['bold', 'italic', 'underline', 'strike', 'subscript', 'superscript'],
|
||||
]),
|
||||
Textarea::make('description')->label('Beschreibung')->rows(6),
|
||||
])->columns(1);
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,6 @@ use Filament\Actions\EditAction;
|
||||
use Filament\Support\Enums\FontWeight;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Table;
|
||||
use Illuminate\Support\HtmlString;
|
||||
|
||||
class MethodesTable
|
||||
{
|
||||
@@ -14,13 +13,15 @@ class MethodesTable
|
||||
{
|
||||
return $table
|
||||
->paginated(false)
|
||||
->defaultSort('order', direction: 'asc')
|
||||
->columns([
|
||||
TextColumn::make('id'),
|
||||
TextColumn::make('name')
|
||||
->color(fn($record) => $record->color)
|
||||
->weight(FontWeight::Bold)
|
||||
->wrap()
|
||||
->description(function ($record) {
|
||||
return new HtmlString($record->description);
|
||||
return $record->description;
|
||||
}),
|
||||
])
|
||||
->recordActions([
|
||||
|
||||
+11
-9
@@ -47,7 +47,7 @@ class ProjektMethodesRelationManager extends RelationManager
|
||||
->components([
|
||||
Select::make('methode_id')
|
||||
->label('Methoden')
|
||||
->options(Methode::pluck('name', 'id'))
|
||||
->options(Methode::orderBy('order')->pluck('name', 'id'))
|
||||
->rules(['required'])
|
||||
->afterStateUpdated(function (Component $livewire) {
|
||||
$livewire->dispatch('refreshMethods');
|
||||
@@ -56,14 +56,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')
|
||||
@@ -84,7 +84,9 @@ class ProjektMethodesRelationManager extends RelationManager
|
||||
->recordTitleAttribute('raumart')
|
||||
->defaultPaginationPageOption(50)
|
||||
->columns([
|
||||
TextColumn::make('methode.name'),
|
||||
TextColumn::make('methode.name')
|
||||
->badge()
|
||||
->color(fn($record) => $record->methode->color),
|
||||
TextColumn::make('aufstellung.name'),
|
||||
TextColumn::make('raumart')
|
||||
->searchable(),
|
||||
@@ -119,8 +121,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)
|
||||
@@ -142,15 +144,15 @@ class ProjektMethodesRelationManager extends RelationManager
|
||||
}),
|
||||
Action::make('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')
|
||||
|
||||
@@ -3,31 +3,27 @@
|
||||
namespace App\Filament\Resources\Projektes\Widgets;
|
||||
|
||||
use App\Models\Methode;
|
||||
use Filament\Support\Enums\FontWeight;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Table;
|
||||
use Filament\Widgets\TableWidget;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Support\HtmlString;
|
||||
|
||||
class WidgetMethoden extends TableWidget
|
||||
{
|
||||
public function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->query(fn (): Builder => Methode::query())
|
||||
->query(fn(): Builder => Methode::query()->orderBy('order'))
|
||||
->paginated(false)
|
||||
->columns([
|
||||
TextColumn::make('methode')
|
||||
->color(fn ($record) => $record->color)
|
||||
->badge(),
|
||||
TextColumn::make('name')
|
||||
->label('')
|
||||
->weight(FontWeight::Bold)
|
||||
->wrap()
|
||||
->description(function ($record) {
|
||||
return new HtmlString($record->description);
|
||||
}),
|
||||
->color(fn($record) => $record->color)
|
||||
->badge(),
|
||||
TextColumn::make('description')
|
||||
->html()
|
||||
->label('')
|
||||
->wrap(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -45,11 +45,13 @@ class AppServiceProvider extends ServiceProvider
|
||||
'primary' => Color::Blue,
|
||||
'success' => Color::Green,
|
||||
'warning' => Color::Amber,
|
||||
'info' => Color::Gray,
|
||||
'info' => Color::Purple,
|
||||
'secondary' => Color::Cyan,
|
||||
]);
|
||||
|
||||
FilamentView::registerRenderHook(
|
||||
PanelsRenderHook::AUTH_LOGIN_FORM_BEFORE, fn (): View => view('components.login-links'),
|
||||
PanelsRenderHook::AUTH_LOGIN_FORM_BEFORE,
|
||||
fn(): View => view('components.login-links'),
|
||||
);
|
||||
|
||||
// FilamentView::registerRenderHook(
|
||||
@@ -60,8 +62,8 @@ class AppServiceProvider extends ServiceProvider
|
||||
// );
|
||||
|
||||
FilamentView::registerRenderHook(
|
||||
PanelsRenderHook::FOOTER, fn (): View => view('layouts.footer'),
|
||||
PanelsRenderHook::FOOTER,
|
||||
fn(): View => view('layouts.footer'),
|
||||
);
|
||||
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user