help wip
This commit is contained in:
1 parent
3791379c41
commit
ec5a56a9b1
27 files changed
+514
-143
No files matched your search
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Filament\Resources\Gutachters\Schemas;
|
||||
|
||||
use App\Actions\Helper\ShowHelp;
|
||||
use Filament\Forms\Components\Checkbox;
|
||||
use Filament\Forms\Components\FileUpload;
|
||||
use Filament\Forms\Components\Radio;
|
||||
@@ -10,6 +11,7 @@ use Filament\Forms\Components\Select;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Schemas\Components\Tabs;
|
||||
use Filament\Schemas\Components\Tabs\Tab;
|
||||
use Filament\Schemas\Components\Utilities\Get;
|
||||
use Filament\Schemas\Schema;
|
||||
use Filament\Support\Icons\Heroicon;
|
||||
use Ysfkaya\FilamentPhoneInput\Forms\PhoneInput;
|
||||
@@ -22,7 +24,6 @@ class GutachterForm
|
||||
->components([
|
||||
Tabs::make('Tabs')
|
||||
->tabs([
|
||||
|
||||
Tab::make('Gutachter')
|
||||
->icon('lucide-stamp')
|
||||
->inlineLabel()
|
||||
@@ -57,7 +58,8 @@ class GutachterForm
|
||||
->schema([
|
||||
Checkbox::make('logo_anzeigen')
|
||||
->label('Das Logo im Gutachten verwenden')
|
||||
->columnSpanFull(),
|
||||
->columnSpanFull()
|
||||
->live(),
|
||||
FileUpload::make('logo')
|
||||
->image()
|
||||
->disk('public')
|
||||
@@ -65,7 +67,9 @@ class GutachterForm
|
||||
->maxSize(3072) // 3MB limit
|
||||
->acceptedFileTypes(['image/jpeg', 'image/png', 'image/webp'])
|
||||
->visibility('public')
|
||||
->label('Logo'),
|
||||
->label('Logo')
|
||||
->afterLabel([ShowHelp::show('logo_am_deckblatt')])
|
||||
->columnSpanFull(),
|
||||
Radio::make('logo_align')
|
||||
->Label('Position')
|
||||
->default('right')
|
||||
@@ -74,12 +78,17 @@ class GutachterForm
|
||||
'center' => 'Zentriert',
|
||||
'right' => 'Rechts',
|
||||
]),
|
||||
TextInput::make('logo_height')
|
||||
->hidden(fn (Get $get): bool => ! $get('logo_anzeigen'))
|
||||
->label('Logo Höhe')
|
||||
->required()
|
||||
->suffix('mm'),
|
||||
])->columns(2),
|
||||
Tab::make('Anzeige am Deckblatt')
|
||||
->icon('lucide-contact')
|
||||
->schema([
|
||||
Checkbox::make('text_anzeigen')
|
||||
->label('Diesen Text am Deckblatt des Gutachtens verwenden')
|
||||
->label('Diesen Text anzeigen')
|
||||
->columnSpanFull(),
|
||||
RichEditor::make('referenz_formatting')
|
||||
->json()
|
||||
@@ -111,7 +120,8 @@ class GutachterForm
|
||||
'#cad5e2' => 'Schiefer Hell',
|
||||
'#314158' => 'Schiefer Dunkel',
|
||||
])
|
||||
->label('Adresse')
|
||||
->label('Gutachter am Deckblatt')
|
||||
->afterLabel([ShowHelp::show('gutachter_am_deckblatt')])
|
||||
->required(),
|
||||
]),
|
||||
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\Helps;
|
||||
|
||||
use App\Filament\Clusters\Administration\AdministrationCluster;
|
||||
use App\Filament\Resources\Helps\Pages\ListHelps;
|
||||
use App\Filament\Resources\Helps\Schemas\HelpForm;
|
||||
use App\Filament\Resources\Helps\Tables\HelpsTable;
|
||||
use App\Models\Help;
|
||||
use BackedEnum;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Schemas\Schema;
|
||||
use Filament\Tables\Table;
|
||||
use UnitEnum;
|
||||
|
||||
class HelpResource extends Resource
|
||||
{
|
||||
protected static ?string $model = Help::class;
|
||||
|
||||
protected static ?string $cluster = AdministrationCluster::class;
|
||||
|
||||
protected static string|UnitEnum|null $navigationGroup = 'Vorlagen';
|
||||
|
||||
protected static string|BackedEnum|null $navigationIcon = 'phosphor-info';
|
||||
|
||||
protected static ?string $navigationLabel = 'Hilfen';
|
||||
|
||||
protected static ?string $modelLabel = 'Hilfen';
|
||||
|
||||
protected static ?string $pluralModelLabel = 'Hilfen';
|
||||
|
||||
protected static ?int $navigationSort = 5;
|
||||
|
||||
public static function form(Schema $schema): Schema
|
||||
{
|
||||
return HelpForm::configure($schema);
|
||||
}
|
||||
|
||||
public static function table(Table $table): Table
|
||||
{
|
||||
return HelpsTable::configure($table);
|
||||
}
|
||||
|
||||
public static function getRelations(): array
|
||||
{
|
||||
return [
|
||||
//
|
||||
];
|
||||
}
|
||||
|
||||
public static function getPages(): array
|
||||
{
|
||||
return [
|
||||
'index' => ListHelps::route('/'),
|
||||
];
|
||||
}
|
||||
|
||||
public static function getNavigationBadge(): ?string
|
||||
{
|
||||
return parent::getEloquentQuery()->count();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\Helps\Pages;
|
||||
|
||||
use App\Filament\Resources\Helps\HelpResource;
|
||||
use Filament\Resources\Pages\CreateRecord;
|
||||
|
||||
class CreateHelp extends CreateRecord
|
||||
{
|
||||
protected static string $resource = HelpResource::class;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\Helps\Pages;
|
||||
|
||||
use App\Filament\Resources\Helps\HelpResource;
|
||||
use Filament\Actions\DeleteAction;
|
||||
use Filament\Resources\Pages\EditRecord;
|
||||
|
||||
class EditHelp extends EditRecord
|
||||
{
|
||||
protected static string $resource = HelpResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
DeleteAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\Helps\Pages;
|
||||
|
||||
use App\Filament\Resources\Helps\HelpResource;
|
||||
use Filament\Actions\CreateAction;
|
||||
use Filament\Resources\Pages\ListRecords;
|
||||
|
||||
class ListHelps extends ListRecords
|
||||
{
|
||||
protected static string $resource = HelpResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
CreateAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\Helps\Schemas;
|
||||
|
||||
use Filament\Forms\Components\FileUpload;
|
||||
use Filament\Forms\Components\Textarea;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Schemas\Schema;
|
||||
|
||||
class HelpForm
|
||||
{
|
||||
public static function configure(Schema $schema): Schema
|
||||
{
|
||||
return $schema
|
||||
->components([
|
||||
TextInput::make('kennung'),
|
||||
TextInput::make('titel'),
|
||||
Textarea::make('description'),
|
||||
FileUpload::make('image')
|
||||
->image()
|
||||
->label('Bild')
|
||||
->preserveFilenames()
|
||||
->disk('public')
|
||||
->maxSize(3072) // 3MB limit
|
||||
->acceptedFileTypes(['image/jpeg', 'image/png', 'image/webp'])
|
||||
->directory('gutachten_hilfe')
|
||||
->visibility('public')
|
||||
->columnSpanFull(),
|
||||
|
||||
])->columns(1);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\Helps\Tables;
|
||||
|
||||
use Filament\Actions\EditAction;
|
||||
use Filament\Tables\Columns\ImageColumn;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
class HelpsTable
|
||||
{
|
||||
public static function configure(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
TextColumn::make('kennung')->badge()->searchable(),
|
||||
TextColumn::make('titel'),
|
||||
ImageColumn::make('image')->disk('public'),
|
||||
])
|
||||
->recordActions([
|
||||
EditAction::make(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -5,11 +5,9 @@ namespace App\Filament\Resources\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;
|
||||
@@ -32,24 +30,6 @@ class InhaltsverzeichnisForm
|
||||
->required()
|
||||
->label('Überschrift')
|
||||
->columnSpan(3),
|
||||
Section::make('Hilfe')
|
||||
->icon('phosphor-question')
|
||||
->schema([
|
||||
FileUpload::make('hilfe_bild')
|
||||
->image()
|
||||
->label('Bild')
|
||||
->disk('public')
|
||||
->maxSize(3072) // 3MB limit
|
||||
->acceptedFileTypes(['image/jpeg', 'image/png', 'image/webp'])
|
||||
->directory('gutachten_hilfe')
|
||||
->visibility('public')
|
||||
->columnSpanFull(),
|
||||
Textarea::make('hilfe_text')
|
||||
->label('Text')
|
||||
->columnSpan(2),
|
||||
])
|
||||
->collapsible()
|
||||
->columnSpan(3),
|
||||
]),
|
||||
Tab::make('Kapitel Index')
|
||||
->schema([
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
namespace App\Filament\Resources\Kontos\Schemas;
|
||||
|
||||
use App\Models\Konto;
|
||||
use App\Models\Plan;
|
||||
use Danielebarbaro\LaravelVatEuValidator\Rules\VatNumber;
|
||||
use Filament\Forms\Components\RichEditor;
|
||||
use Filament\Forms\Components\Select;
|
||||
@@ -11,11 +10,7 @@ use Filament\Forms\Components\TextInput;
|
||||
use Filament\Schemas\Components\Tabs;
|
||||
use Filament\Schemas\Components\Tabs\Tab;
|
||||
use Filament\Schemas\Schema;
|
||||
use Filament\Support\Enums\Alignment;
|
||||
use Filament\Support\Enums\IconPosition;
|
||||
use Filament\Support\Enums\IconSize;
|
||||
use Filament\Support\Icons\Heroicon;
|
||||
use JaOcero\RadioDeck\Forms\Components\RadioDeck;
|
||||
use Ysfkaya\FilamentPhoneInput\Forms\PhoneInput;
|
||||
|
||||
class KontoForm
|
||||
@@ -72,34 +67,7 @@ class KontoForm
|
||||
->label('Telefon')
|
||||
->defaultCountry('AT'),
|
||||
])->columnSpanFull(),
|
||||
|
||||
Tab::make('Zahlungsplan')
|
||||
->icon('phosphor-coins')
|
||||
->schema([
|
||||
RadioDeck::make('plan_id')
|
||||
// ->label('Wählen sie eine Option')
|
||||
->label('Zur Zeit bieten wie nur den Basic Plan als Zahlungvariante an.')
|
||||
->options(fn () => Plan::pluck('name', 'id')->toArray())
|
||||
->descriptions(Plan::options())
|
||||
->icons(fn () => Plan::pluck('icon', 'id')->toArray())
|
||||
->required()
|
||||
->iconPosition(IconPosition::Before) // Before | After
|
||||
->iconSize(IconSize::TwoExtraLarge)
|
||||
->alignment(Alignment::Center) // Start | Center | End
|
||||
->padding('px-4 py-6') // Padding around the deck
|
||||
->extraCardsAttributes([
|
||||
'class' => 'rounded-xl drop-shadow-xl mt-1',
|
||||
])
|
||||
->extraOptionsAttributes([
|
||||
'class' => 'text-2xl font-black tracking-tight lg:text-3xl',
|
||||
])
|
||||
->colors('primary')
|
||||
->disabled()
|
||||
->columns(3)
|
||||
->columnSpanFull(),
|
||||
])->columnSpanFull(),
|
||||
])->columnSpanFull(),
|
||||
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user