This commit is contained in:
salam committed 2025-11-07 10:52:36 +01:00
1 parent faded38980
commit 48b372c164
24 files changed
+357 -244

No files matched your search

@@ -2,8 +2,12 @@
namespace App\Filament\Resources\Textblocks\Schemas;
use Filament\Forms\Components\FileUpload;
use Filament\Forms\Components\RichEditor;
use Filament\Forms\Components\Textarea;
use Filament\Forms\Components\TextInput;
use Filament\Schemas\Components\Tabs;
use Filament\Schemas\Components\Tabs\Tab;
use Filament\Schemas\Schema;
class TextblockForm
@@ -12,46 +16,84 @@ class TextblockForm
{
return $schema
->components([
TextInput::make('name')
->required(),
RichEditor::make('textblock')
->label('Abschnitt A')
->toolbarButtons([
['bold', 'italic', 'underline', 'strike', 'subscript', 'superscript', 'horizontalRule', 'table'],
])->floatingToolbars([
'paragraph' => [
'bold', 'italic', 'underline', 'strike', 'subscript', 'superscript',
],
'heading' => [
'h1', 'h2', 'h3',
],
'table' => [
'tableAddColumnBefore', 'tableAddColumnAfter', 'tableDeleteColumn',
'tableAddRowBefore', 'tableAddRowAfter', 'tableDeleteRow',
'tableMergeCells', 'tableSplitCell',
'tableToggleHeaderRow',
'tableDelete',
],
]),
RichEditor::make('textblock2')
->label('Abschnitt B')
->toolbarButtons([
['bold', 'italic', 'underline', 'strike', 'subscript', 'superscript', 'horizontalRule', 'table'],
])->floatingToolbars([
'paragraph' => [
'bold', 'italic', 'underline', 'strike', 'subscript', 'superscript',
],
'heading' => [
'h1', 'h2', 'h3',
],
'table' => [
'tableAddColumnBefore', 'tableAddColumnAfter', 'tableDeleteColumn',
'tableAddRowBefore', 'tableAddRowAfter', 'tableDeleteRow',
'tableMergeCells', 'tableSplitCell',
'tableToggleHeaderRow',
'tableDelete',
],
Tabs::make('Tabs')
->tabs([
Tab::make('Inhaltselement')
->icon('phosphor-textbox')
->schema([
TextInput::make('name')
->label('Element Name')
->afterLabel([
'Wird im Gutachten nicht verwendet, dient nur zur Erkennen des Inhaltselements.',
])
->required(),
RichEditor::make('textblock')
->label('Abschnitt A')
->toolbarButtons([
['bold', 'italic', 'underline', 'strike', 'subscript', 'superscript', 'horizontalRule', 'table'],
])->floatingToolbars([
'paragraph' => [
'bold', 'italic', 'underline', 'strike', 'subscript', 'superscript',
],
'heading' => [
'h1', 'h2', 'h3',
],
'table' => [
'tableAddColumnBefore', 'tableAddColumnAfter', 'tableDeleteColumn',
'tableAddRowBefore', 'tableAddRowAfter', 'tableDeleteRow',
'tableMergeCells', 'tableSplitCell',
'tableToggleHeaderRow',
'tableDelete',
],
]),
RichEditor::make('textblock2')
->label('Abschnitt B')
->afterLabel([
'Textblock uner der Überschrift.',
])
->belowContent([
'Dieses Feld kann auch leer bleiben. Sollten im selben Punkt des Inhaltsvereichnisses auch eine Tabelle verwendet werden, dann wird dieser Text nach dieser angezeigt.',
])
->toolbarButtons([
['bold', 'italic', 'underline', 'strike', 'subscript', 'superscript', 'horizontalRule', 'table'],
])->floatingToolbars([
'paragraph' => [
'bold', 'italic', 'underline', 'strike', 'subscript', 'superscript',
],
'heading' => [
'h1', 'h2', 'h3',
],
'table' => [
'tableAddColumnBefore', 'tableAddColumnAfter', 'tableDeleteColumn',
'tableAddRowBefore', 'tableAddRowAfter', 'tableDeleteRow',
'tableMergeCells', 'tableSplitCell',
'tableToggleHeaderRow',
'tableDelete',
],
]),
]),
Tab::make('Benutzer Hilfe')
->icon('phosphor-chat-text')
->schema([
TextInput::make('hilfe_titel')
->aboveLabel([
'Dieser Inhalt wird dem Benutzer an entsprechender Stelle bei der Bearbeitung des Gutachtens angezeigt.',
])
->label('Überschrift')
->columnSpanFull(),
Textarea::make('hilfe_description'),
FileUpload::make('hilfe_image')
->image()
->label('Bild')
->disk('public')
->maxSize(3072) // 3MB limit
->acceptedFileTypes(['image/jpeg', 'image/png', 'image/webp'])
->directory('gutachten_hilfe')
->visibility('public')
->columnSpanFull(),
]),
]),
])->columns(1);
}
}