Richte die Redaktionsformulare an den Mockups aus.
Abschnitte, Medienkarten, Einordnung und Auswahl folgen der vorgegebenen Form. Datenmodell und Fassungen bleiben unverändert.
This commit is contained in:
1 parent
4c29ab2593
commit
b9fe0e3791
16 files changed
+559
-339
No files matched your search
@@ -0,0 +1,36 @@
|
||||
@php
|
||||
$kind = $kind ?? 'text';
|
||||
$rows = $rows ?? 3;
|
||||
$origin = $origin ?? null;
|
||||
$placeholder = $placeholder ?? '';
|
||||
$disabled = $disabled ?? false;
|
||||
$hint = $hint ?? null;
|
||||
$value = $value ?? '';
|
||||
$required = $required ?? false;
|
||||
$offen = trim((string) $value) === '' && $origin === null;
|
||||
@endphp
|
||||
<section class="vw-abschnitt" x-data="{ offen: {{ $offen ? 'true' : 'false' }} }">
|
||||
<header>
|
||||
<h3>{{ $label }}</h3>
|
||||
@if (filled($origin))
|
||||
<span @class(['vw-herkunft', 'is-eigen' => str_starts_with((string) $origin, 'Eigene')])>{{ $origin }}</span>
|
||||
@endif
|
||||
@unless ($disabled)
|
||||
<button type="button" class="vw-textaktion" @click="offen = !offen">
|
||||
<span x-text="offen ? 'Schließen' : 'Bearbeiten'">Bearbeiten</span>
|
||||
</button>
|
||||
@endunless
|
||||
</header>
|
||||
<p class="vw-lesetext" x-show="!offen">{{ trim((string) $value) !== '' ? $value : 'Keine Angabe' }}</p>
|
||||
<div class="luf-field" x-show="offen" @unless ($offen) x-cloak @endunless>
|
||||
<label class="luf-sr" for="{{ $id }}">{{ $label }}</label>
|
||||
@if ($kind === 'textarea')
|
||||
<textarea id="{{ $id }}" rows="{{ $rows }}" wire:model="{{ $model }}" placeholder="{{ $placeholder }}" @disabled($disabled)></textarea>
|
||||
@else
|
||||
<input id="{{ $id }}" type="text" wire:model="{{ $model }}" placeholder="{{ $placeholder }}" @disabled($disabled) @if ($required) required @endif>
|
||||
@endif
|
||||
@if (filled($hint))
|
||||
<span class="luf-meta">{{ $hint }}</span>
|
||||
@endif
|
||||
</div>
|
||||
</section>
|
||||
Reference in new issue
Block a user