Liefere das Anfrageformular je Anfragegrund aus und gib dem Widget Gründe, Formularführung und Präsentation
Das Widget Anfrage wählt statt eines Anfrage-Einstiegs mehrere Anfragegründe, jeder zeigt auf ein veröffentlichtes Formular
(optional mit vorgewähltem Anliegen). Der Besucher erhält genau das Formular seines Grundes: /anfrage/formular/{vorlage}
mit Grund in der Adresse, dasselbe Token, dieselbe Auswertung und Annahme. Ein Dialog (dialog-Element) und die Grundauswahl
als Karten oder Auswahlfeld kommen aus resources/js/inquiry-widget.js. Seiten mit einem Einstieg bleiben darstellbar.
Bereiche lassen sich wie Gruppen anzeigen oder ausblenden.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f255bf5200
commit
fb479c1b01
18 files changed
+1394
-57
No files matched your search
@@ -62,6 +62,13 @@ class InquiryForm {
|
||||
const response = await fetch(this.root.dataset.definitionUrl, { headers: { Accept: 'application/json' }, credentials: 'same-origin' });
|
||||
|
||||
if (!response.ok) {
|
||||
if (this.root.dataset.embedded === '1') {
|
||||
// Vom Widget „Anfrage“ eingebettet: Der Besucher hat das Formular gewählt, also sagen wir, dass es fehlt.
|
||||
this.root.replaceChildren(h('p', { class: 'inquiry-note', role: 'alert', text: 'Dieses Anfrageformular ist zurzeit nicht verfügbar. Bitte versuchen Sie es später noch einmal.' }));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
this.root.replaceChildren();
|
||||
this.root.hidden = true;
|
||||
|
||||
@@ -913,6 +920,7 @@ class InquiryForm {
|
||||
|
||||
success(reference) {
|
||||
this.finished = true;
|
||||
this.root.dispatchEvent(new CustomEvent('inquiry:sent', { bubbles: true }));
|
||||
const preview = reference === 'Vorschau';
|
||||
const box = h('div', { class: 'inquiry-success', role: 'status', tabindex: '-1' },
|
||||
h('h3', { text: this.def.texts.success_title }),
|
||||
|
||||
Reference in new issue
Block a user