big change Inhaltstabelle und PDF
This commit is contained in:
1 parent
2f6ae7e4a1
commit
d5d1f743bb
58 files changed
+1244
-922
No files matched your search
@@ -2,13 +2,14 @@
|
||||
|
||||
namespace App\Filament\Resources\Inhaltsverzeichnis\Schemas;
|
||||
|
||||
use App\Models\Tabellen;
|
||||
use App\Models\Inhaltselement;
|
||||
use App\Models\Textblock;
|
||||
use Filament\Forms\Components\Checkbox;
|
||||
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
|
||||
@@ -17,72 +18,75 @@ class InhaltsverzeichnisForm
|
||||
{
|
||||
return $schema
|
||||
->components([
|
||||
Section::make('Überschrift')
|
||||
->schema([
|
||||
Checkbox::make('neue_seite')
|
||||
->label('Start neuer Seite'),
|
||||
Checkbox::make('ueberschrift_anzeigen')
|
||||
->label('Überschrift angezeigen'),
|
||||
Textarea::make('name')
|
||||
->required()
|
||||
->label('Überschrift in der Inhaltsangabe')
|
||||
->columnSpan(3),
|
||||
Textarea::make('name2')
|
||||
->label('Überschrift im Dokument')
|
||||
->belowContent([
|
||||
'Bei abweichender Überschrift im Dokument',
|
||||
])
|
||||
->columnSpan(3),
|
||||
TextInput::make('ordnungszahl')
|
||||
->label('Kapitel Index')
|
||||
->placeholder('3.21')
|
||||
->numeric()
|
||||
->default(0)
|
||||
->belowContent([
|
||||
'Bei "0" wird der Index im PDF nicht angezeigt',
|
||||
])
|
||||
->columnSpan(1),
|
||||
TextInput::make('seite')
|
||||
->label('Seitenzahl')
|
||||
->numeric()
|
||||
->default(0)
|
||||
->belowContent([
|
||||
'Bei "0" wird die Seitenzahl automatisch generiert',
|
||||
])
|
||||
->columnSpan(1),
|
||||
Checkbox::make('seitenzahl_anzeige')
|
||||
->label('Seitenzahl angezeigen'),
|
||||
])->columnSpanFull(),
|
||||
Section::make('Textblock und Tabelle')
|
||||
->hiddenLabel()
|
||||
->description('Ausgabe Textblock vor Tabelle')
|
||||
->schema([
|
||||
Select::make('textblock_id')->label('Textblock')
|
||||
->prefixIcon('phosphor-article')
|
||||
->prefixIconColor(
|
||||
fn ($record): string => $record->textblock_id == 0 ? 'gray' : 'primary'
|
||||
)
|
||||
->default(0)
|
||||
->options(function () {
|
||||
$res = Textblock::all()->pluck('name', 'id')->toArray();
|
||||
array_unshift($res, 'Ohne Textblock');
|
||||
Tabs::make('Überschrift')
|
||||
->tabs([
|
||||
Tab::make('Überschrift')
|
||||
->schema([
|
||||
Checkbox::make('neue_seite')
|
||||
->label('Start neuer Seite'),
|
||||
Checkbox::make('ueberschrift_anzeigen')
|
||||
->label('Überschrift angezeigen'),
|
||||
Textarea::make('name')
|
||||
->required()
|
||||
->label('Überschrift')
|
||||
->columnSpan(3),
|
||||
]),
|
||||
Tab::make('Kapitel Index')
|
||||
->schema([
|
||||
TextInput::make('ordnungszahl')
|
||||
->label('Kapitel Index')
|
||||
->placeholder('3.21')
|
||||
->numeric()
|
||||
->default(0)
|
||||
->belowContent([
|
||||
'Bei "0" wird der Index im Inhaltsverzeichnis und bei der Überschrift im Dokument nicht angezeigt.',
|
||||
])
|
||||
->columnSpan(1),
|
||||
])->columnSpanFull(),
|
||||
Tab::make('Seitenzahl')
|
||||
->schema([
|
||||
Checkbox::make('seitenzahl_anzeige')
|
||||
->label('Seitenzahl angezeigen'),
|
||||
TextInput::make('seite')
|
||||
->label('Seitenzahl')
|
||||
->numeric()
|
||||
->default(0)
|
||||
->belowContent([
|
||||
'Bei "0" wird die Seitenzahl automatisch generiert',
|
||||
])
|
||||
->columnSpan(1),
|
||||
])->columnSpanFull(),
|
||||
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;
|
||||
}),
|
||||
Select::make('tabellen_id')->label('Tabelle')
|
||||
->prefixIcon('phosphor-table')
|
||||
->prefixIconColor(
|
||||
fn ($record): string => $record->tabellen_id == 0 ? 'gray' : 'primary'
|
||||
)
|
||||
->default(0)
|
||||
->options(function () {
|
||||
$res = Tabellen::all()->pluck('name', 'id')->toArray();
|
||||
array_unshift($res, 'Ohne Tabelle');
|
||||
return $res;
|
||||
}),
|
||||
|
||||
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');
|
||||
|
||||
])->columnSpanFull(),
|
||||
return $res;
|
||||
}),
|
||||
]),
|
||||
])->vertical()->columnSpanFull(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,6 @@ use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Enums\FiltersLayout;
|
||||
use Filament\Tables\Filters\SelectFilter;
|
||||
use Filament\Tables\Table;
|
||||
use Illuminate\Support\HtmlString;
|
||||
|
||||
class InhaltsverzeichnisTable
|
||||
{
|
||||
@@ -18,40 +17,27 @@ class InhaltsverzeichnisTable
|
||||
return $table
|
||||
->heading('Inhaltsverzeichnis')
|
||||
->description('Generische Vorlage beim Erstellen neuer Projekte.')
|
||||
// ->recordClasses(fn ($record) => $record->part == 'gutachten' ? 'border-l-4' : 'border-l-4')
|
||||
->columns([
|
||||
TextColumn::make('ordnungszahl')
|
||||
->label('Index')
|
||||
->alignRight()
|
||||
->getStateUsing(fn ($record): string => $record->ordnungszahl == '0' ? '' : number_format($record->ordnungszahl, 2)),
|
||||
IconColumn::make('neue_seite')
|
||||
->tooltip('Start neue Seite')
|
||||
->color('primary')
|
||||
->alignCenter()
|
||||
->label('Start')
|
||||
->icon(fn (string $state): string => match ($state) {
|
||||
'1' => 'phosphor-file-plus',
|
||||
default => ''
|
||||
}),
|
||||
TextColumn::make('name')
|
||||
->color('primary')
|
||||
->label('Überschrift')
|
||||
->wrap(),
|
||||
IconColumn::make('ueberschrift_anzeigen')
|
||||
->label('Anzeigen')
|
||||
->alignCenter()
|
||||
->tooltip('Überschrift anzeigen')
|
||||
->color(fn ($state): string => $state ? 'primary' : 'gray')
|
||||
->icon(fn ($state): string => $state ? 'phosphor-article-ny-times' : ''),
|
||||
IconColumn::make('textblock')
|
||||
->color('primary')
|
||||
->alignCenter()
|
||||
->icon('phosphor-article')
|
||||
->tooltip(fn ($record): HtmlString => new HtmlString($record->name)),
|
||||
IconColumn::make('tabellen')
|
||||
->color('primary')
|
||||
->alignCenter()
|
||||
->icon('phosphor-table')
|
||||
->tooltip(fn ($record): HtmlString => new HtmlString($record->name)),
|
||||
TextColumn::make('inhaltselement.name')
|
||||
->label('Element')
|
||||
->wrap(),
|
||||
TextColumn::make('textblock.name')
|
||||
->wrap(),
|
||||
TextColumn::make('seite')
|
||||
->alignCenter()
|
||||
->badge()
|
||||
|
||||
Reference in new issue
Block a user