refactoring into clusters
This commit is contained in:
1 parent
042a5a8b58
commit
48deb69379
97 files changed
+186
-198
No files matched your search
+116
@@ -0,0 +1,116 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Clusters\Administration\Inhaltsverzeichnis\Schemas;
|
||||
|
||||
use App\Models\Inhaltselement;
|
||||
use App\Models\Textblock;
|
||||
use Filament\Forms\Components\Checkbox;
|
||||
use Filament\Forms\Components\FileUpload;
|
||||
use Filament\Forms\Components\Select;
|
||||
use Filament\Forms\Components\Textarea;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Schemas\Components\Section;
|
||||
use Filament\Schemas\Components\Tabs;
|
||||
use Filament\Schemas\Components\Tabs\Tab;
|
||||
use Filament\Schemas\Schema;
|
||||
|
||||
class InhaltsverzeichnisForm
|
||||
{
|
||||
public static function configure(Schema $schema): Schema
|
||||
{
|
||||
return $schema
|
||||
->components([
|
||||
Tabs::make('Überschrift')
|
||||
->tabs([
|
||||
Tab::make('Überschrift')
|
||||
->schema([
|
||||
Checkbox::make('neue_seite')
|
||||
->label('Start neuer Seite'),
|
||||
Checkbox::make('ueberschrift_verbergen')
|
||||
->label('Überschrift im Gutachten verbergen'),
|
||||
TextInput::make('name')
|
||||
->prefixIcon('phosphor-article')
|
||||
->required()
|
||||
->label('Überschrift')
|
||||
->columnSpan(2),
|
||||
TextInput::make('ordnungszahl')
|
||||
->label('Kapitel Index')
|
||||
->prefixIcon('phosphor-list-numbers')
|
||||
->placeholder('3.21')
|
||||
->numeric()
|
||||
->default(0)
|
||||
->belowContent([
|
||||
'Bei "0" wird der Index nicht angezeigt',
|
||||
])
|
||||
->columnSpan(2),
|
||||
// TextInput::make('seite')
|
||||
// ->label('Seitenzahl')
|
||||
// ->numeric()
|
||||
// ->default(0)
|
||||
// ->belowContent([
|
||||
// 'Bei "0" wird die Seitenzahl automatisch generiert',
|
||||
// ])
|
||||
// ->columnSpan(1),
|
||||
Section::make('Benutzer Hilfe')
|
||||
->icon('phosphor-chat-text')
|
||||
->schema([
|
||||
TextInput::make('hilfe_titel')
|
||||
->aboveLabel([
|
||||
'Erklärungen des Inhalts beim Bearbeiten des Gutachtens',
|
||||
])
|
||||
->afterLabel(['optional'])
|
||||
->label('Überschrift')
|
||||
->columnSpanFull(),
|
||||
Textarea::make('hilfe_description')
|
||||
->afterLabel(['optional'])
|
||||
->label('Beschreibung'),
|
||||
FileUpload::make('hilfe_image')
|
||||
->afterLabel(['optional'])
|
||||
->image()
|
||||
->label('Bild')
|
||||
->disk('public')
|
||||
->maxSize(3072) // 3MB limit
|
||||
->acceptedFileTypes(['image/jpeg', 'image/png', 'image/webp'])
|
||||
->directory('gutachten_hilfe')
|
||||
->visibility('public')
|
||||
->columnSpanFull(),
|
||||
|
||||
])
|
||||
->secondary()
|
||||
->compact()
|
||||
->collapsed()
|
||||
->columnSpanFull(),
|
||||
])->columns(3),
|
||||
Tab::make('Inhaltselement')
|
||||
->hiddenLabel()
|
||||
->schema([
|
||||
Select::make('inhaltselement_id')
|
||||
->label('Inhaltselement')
|
||||
->prefixIcon('phosphor-table')
|
||||
->default(0)
|
||||
->options(function () {
|
||||
$res = Inhaltselement::all()->pluck('name', 'id')->toArray();
|
||||
array_push($res, 'Ohne');
|
||||
|
||||
return $res;
|
||||
}),
|
||||
]),
|
||||
Tab::make('Textblock')
|
||||
->hiddenLabel()
|
||||
->schema([
|
||||
Select::make('textblock_id')
|
||||
->label('Textblock')
|
||||
// ->description('Ausgabe Textblock vor Tabelle')
|
||||
->prefixIcon('phosphor-article')
|
||||
->default(0)
|
||||
->options(function () {
|
||||
$res = Textblock::all()->pluck('name', 'id')->toArray();
|
||||
array_push($res, 'Ohne');
|
||||
|
||||
return $res;
|
||||
}),
|
||||
]),
|
||||
])->vertical()->columnSpanFull(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user