Zeige das Widget Anfrage in der Vorschau des Seiteneditors und gib der Fassungsliste deutsche Texte
CI Feature / test (push) Successful in 5m32s
CI Feature / test (push) Successful in 5m32s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2eca612108
commit
374fd95576
7 files changed
+56
-4
No files matched your search
+3
@@ -33,6 +33,9 @@ public function table(Table $table): Table
|
|||||||
$template = $this->getOwnerRecord();
|
$template = $this->getOwnerRecord();
|
||||||
|
|
||||||
return $table
|
return $table
|
||||||
|
->heading('Fassungen')
|
||||||
|
->emptyStateHeading('Noch keine Fassung veröffentlicht')
|
||||||
|
->emptyStateDescription('Mit „Veröffentlichen“ entsteht die erste Fassung.')
|
||||||
->columns([
|
->columns([
|
||||||
TextColumn::make('version')->label('Fassung')->prefix('Nr. '),
|
TextColumn::make('version')->label('Fassung')->prefix('Nr. '),
|
||||||
TextColumn::make('published_at')->label('Veröffentlicht')->dateTime('d.m.Y H:i'),
|
TextColumn::make('published_at')->label('Veröffentlicht')->dateTime('d.m.Y H:i'),
|
||||||
|
|||||||
@@ -80,7 +80,6 @@ private static function structure(): array
|
|||||||
->blockNumbers(false)
|
->blockNumbers(false)
|
||||||
->reorderableWithButtons()
|
->reorderableWithButtons()
|
||||||
->collapsible()
|
->collapsible()
|
||||||
->collapsed()
|
|
||||||
->live(),
|
->live(),
|
||||||
])
|
])
|
||||||
->reorderableWithButtons()
|
->reorderableWithButtons()
|
||||||
@@ -98,7 +97,7 @@ private static function blocks(): array
|
|||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
Block::make('field')
|
Block::make('field')
|
||||||
->label(fn (?array $state): string => 'Feld: '.(($state['label'] ?? '') ?: 'neu').self::fieldBadges($state))
|
->label(fn (?array $state): string => $state === null ? 'Feld' : 'Feld: '.(($state['label'] ?? '') ?: 'neu').self::fieldBadges($state))
|
||||||
->icon('heroicon-o-pencil-square')
|
->icon('heroicon-o-pencil-square')
|
||||||
->schema([
|
->schema([
|
||||||
Hidden::make('key')->default(fn (): string => FormEditor::temporaryKey()),
|
Hidden::make('key')->default(fn (): string => FormEditor::temporaryKey()),
|
||||||
@@ -149,7 +148,7 @@ private static function blocks(): array
|
|||||||
self::condition('field'),
|
self::condition('field'),
|
||||||
]),
|
]),
|
||||||
Block::make('section')
|
Block::make('section')
|
||||||
->label(fn (?array $state): string => 'Teilbereich: '.(($state['label'] ?? '') ?: 'neu').(filled($state['cond']['effect'] ?? null) ? ' (Bedingung)' : ''))
|
->label(fn (?array $state): string => $state === null ? 'Teilbereich' : 'Teilbereich: '.(($state['label'] ?? '') ?: 'neu').(filled($state['cond']['effect'] ?? null) ? ' (Bedingung)' : ''))
|
||||||
->icon('heroicon-o-rectangle-group')
|
->icon('heroicon-o-rectangle-group')
|
||||||
->schema([
|
->schema([
|
||||||
Hidden::make('key')->default(fn (): string => FormEditor::temporaryKey()),
|
Hidden::make('key')->default(fn (): string => FormEditor::temporaryKey()),
|
||||||
|
|||||||
@@ -740,3 +740,23 @@ @media (prefers-reduced-motion: reduce) {
|
|||||||
transition: none !important;
|
transition: none !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Vorschau im Seiteneditor: der geöffnete Dialog als gerahmtes Beispiel statt als Dialog über der Seite. */
|
||||||
|
.iw-sample-note {
|
||||||
|
margin: var(--space-3) 0 var(--space-2);
|
||||||
|
font-size: 0.9em;
|
||||||
|
color: var(--color-text-muted);
|
||||||
|
}
|
||||||
|
|
||||||
|
.iw-dialog--sample {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
width: auto;
|
||||||
|
max-height: none;
|
||||||
|
border: 2px dashed var(--color-border-strong);
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.iw-dialog--sample .iw-body {
|
||||||
|
overflow: visible;
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
/*
|
||||||
|
* Einstieg für Vorschauen, die nur Stile laden (Iframes im Seiteneditor): bringt das Anfrageformular und das Widget
|
||||||
|
* „Anfrage“ zum Laufen. Die öffentliche Seite und die Seitenvorschau laden dasselbe über app.js.
|
||||||
|
*/
|
||||||
|
import './inquiry-form.js';
|
||||||
|
import './inquiry-widget.js';
|
||||||
@@ -50,6 +50,10 @@ class InquiryWidget {
|
|||||||
this.active = null;
|
this.active = null;
|
||||||
this.sent = false;
|
this.sent = false;
|
||||||
this.modal = this.config.open === 'modal';
|
this.modal = this.config.open === 'modal';
|
||||||
|
// In den Vorschau-Iframes des Seiteneditors (srcdoc, kleine feste Fläche) ist ein echter Dialog nicht darstellbar:
|
||||||
|
// Dort steht der geöffnete Dialog als gerahmtes Beispiel unter dem Button. Auf der Seite und in der Seitenvorschau
|
||||||
|
// öffnet der Button den echten Dialog.
|
||||||
|
this.sample = this.modal && this.config.preview && Boolean(window.frameElement?.hasAttribute?.('srcdoc'));
|
||||||
}
|
}
|
||||||
|
|
||||||
start() {
|
start() {
|
||||||
@@ -64,6 +68,10 @@ class InquiryWidget {
|
|||||||
this.choose(preselected.key, false);
|
this.choose(preselected.key, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.sample) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (this.modal) {
|
if (this.modal) {
|
||||||
// Ein Button der Seite mit ?grund=… will den Dialog sofort sehen; ohne Vorwahl öffnet der Besucher selbst.
|
// Ein Button der Seite mit ?grund=… will den Dialog sofort sehen; ohne Vorwahl öffnet der Besucher selbst.
|
||||||
if (preselected) {
|
if (preselected) {
|
||||||
@@ -93,6 +101,18 @@ class InquiryWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.root.classList.add('is-modal');
|
this.root.classList.add('is-modal');
|
||||||
|
|
||||||
|
if (this.sample) {
|
||||||
|
this.opener = h('button', { type: 'button', class: 'button iw-opener', text: this.config.openLabel });
|
||||||
|
this.root.append(
|
||||||
|
this.opener,
|
||||||
|
h('p', { class: 'iw-sample-note', text: 'Vorschau: So sieht der geöffnete Dialog aus.' }),
|
||||||
|
h('div', { class: 'iw-dialog iw-dialog--sample', role: 'group', 'aria-label': this.config.openLabel }, h('div', { class: 'iw-dialog-head' }, h('span', { class: 'iw-close', 'aria-hidden': 'true' }, '×')), this.body),
|
||||||
|
);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.opener = h('button', {
|
this.opener = h('button', {
|
||||||
type: 'button',
|
type: 'button',
|
||||||
class: 'button iw-opener',
|
class: 'button iw-opener',
|
||||||
|
|||||||
@@ -39,3 +39,7 @@
|
|||||||
</p>
|
</p>
|
||||||
@endif
|
@endif
|
||||||
@endif
|
@endif
|
||||||
|
@if ($context->preview)
|
||||||
|
{{-- Vorschau-Iframes im Seiteneditor laden nur Stile: Das Skript lässt das Formular dort wie auf der Seite erscheinen. --}}
|
||||||
|
@vite('resources/js/inquiry-embed.js')
|
||||||
|
@endif
|
||||||
+1
-1
@@ -6,7 +6,7 @@ import tailwindcss from '@tailwindcss/vite';
|
|||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [
|
plugins: [
|
||||||
laravel({
|
laravel({
|
||||||
input: ['resources/css/app.css', 'resources/js/app.js'],
|
input: ['resources/css/app.css', 'resources/js/app.js', 'resources/js/inquiry-embed.js'],
|
||||||
refresh: true,
|
refresh: true,
|
||||||
fonts: [
|
fonts: [
|
||||||
// Vorläufige Markenschriften (Website-Zielkonzept 7.2, nicht freigegeben); beim Build lokal abgelegt.
|
// Vorläufige Markenschriften (Website-Zielkonzept 7.2, nicht freigegeben); beim Build lokal abgelegt.
|
||||||
|
|||||||
Reference in new issue
Block a user