|
@@ -13,6 +13,9 @@ $schema = new FormSchema();
|
|
|
$steps = $schema->getSteps();
|
|
$steps = $schema->getSteps();
|
|
|
$csrf = Csrf::token();
|
|
$csrf = Csrf::token();
|
|
|
$app = Bootstrap::config('app');
|
|
$app = Bootstrap::config('app');
|
|
|
|
|
+$disclaimerTitle = (string) ($app['disclaimer']['title'] ?? 'Hinweis');
|
|
|
|
|
+$disclaimerText = (string) ($app['disclaimer']['text'] ?? '');
|
|
|
|
|
+$disclaimerAcceptLabel = (string) ($app['disclaimer']['accept_label'] ?? 'Hinweis gelesen, weiter');
|
|
|
|
|
|
|
|
/** @param array<string, mixed> $field */
|
|
/** @param array<string, mixed> $field */
|
|
|
function renderField(array $field): void
|
|
function renderField(array $field): void
|
|
@@ -45,8 +48,17 @@ function renderField(array $field): void
|
|
|
echo '</select>';
|
|
echo '</select>';
|
|
|
} elseif ($type === 'file') {
|
|
} elseif ($type === 'file') {
|
|
|
$accept = htmlspecialchars((string) ($field['accept'] ?? ''));
|
|
$accept = htmlspecialchars((string) ($field['accept'] ?? ''));
|
|
|
- echo '<input id="' . $key . '" type="file" name="' . $key . '" accept="' . $accept . '">';
|
|
|
|
|
- echo '<small>Original-Dateiname wird übernommen und im System sicher gespeichert.</small>';
|
|
|
|
|
|
|
+ $fileInputId = $key . '_file';
|
|
|
|
|
+ $cameraInputId = $key . '_camera';
|
|
|
|
|
+ echo '<div class="upload-control" data-upload-key="' . $key . '">';
|
|
|
|
|
+ echo '<div class="upload-actions">';
|
|
|
|
|
+ echo '<label class="upload-action-btn" for="' . $fileInputId . '">Datei auswählen</label>';
|
|
|
|
|
+ echo '<label class="upload-action-btn upload-action-btn-camera" for="' . $cameraInputId . '">Foto aufnehmen</label>';
|
|
|
|
|
+ echo '</div>';
|
|
|
|
|
+ echo '<input id="' . $fileInputId . '" class="upload-native-input" type="file" name="' . $key . '" accept="' . $accept . '">';
|
|
|
|
|
+ echo '<input id="' . $cameraInputId . '" class="upload-native-input" type="file" name="' . $key . '__camera" accept="image/*" capture="environment">';
|
|
|
|
|
+ echo '<p class="upload-selected" data-upload-selected="' . $key . '">Keine Datei gewählt</p>';
|
|
|
|
|
+ echo '</div>';
|
|
|
echo '<div class="upload-list" data-upload-list="' . $key . '"></div>';
|
|
echo '<div class="upload-list" data-upload-list="' . $key . '"></div>';
|
|
|
} else {
|
|
} else {
|
|
|
$inputType = htmlspecialchars($type);
|
|
$inputType = htmlspecialchars($type);
|
|
@@ -76,24 +88,34 @@ function renderField(array $field): void
|
|
|
<main class="container">
|
|
<main class="container">
|
|
|
<h1>Digitaler Mitgliedsantrag Feuerwehrverein</h1>
|
|
<h1>Digitaler Mitgliedsantrag Feuerwehrverein</h1>
|
|
|
|
|
|
|
|
- <section id="startSection" class="card">
|
|
|
|
|
- <h2>Start & Status</h2>
|
|
|
|
|
- <p>Bitte E-Mail eingeben. Bestehende Entwürfe werden automatisch geladen.</p>
|
|
|
|
|
|
|
+ <section id="disclaimerSection" class="card">
|
|
|
|
|
+ <h2><?= htmlspecialchars($disclaimerTitle) ?></h2>
|
|
|
|
|
+ <p class="disclaimer-text"><?= nl2br(htmlspecialchars($disclaimerText)) ?></p>
|
|
|
|
|
+ <button id="acceptDisclaimerBtn" type="button"><?= htmlspecialchars($disclaimerAcceptLabel) ?></button>
|
|
|
|
|
+ </section>
|
|
|
|
|
+
|
|
|
|
|
+ <section id="startSection" class="card hidden">
|
|
|
|
|
+ <h2>Start</h2>
|
|
|
|
|
+ <p id="startIntroText">Bitte E-Mail eingeben. Bestehende Entwürfe werden automatisch geladen.</p>
|
|
|
<form id="startForm" novalidate>
|
|
<form id="startForm" novalidate>
|
|
|
<input type="hidden" name="csrf" value="<?= htmlspecialchars($csrf) ?>">
|
|
<input type="hidden" name="csrf" value="<?= htmlspecialchars($csrf) ?>">
|
|
|
<div class="hp-field" aria-hidden="true">
|
|
<div class="hp-field" aria-hidden="true">
|
|
|
<label for="website">Website</label>
|
|
<label for="website">Website</label>
|
|
|
<input id="website" type="text" name="website" autocomplete="off" tabindex="-1">
|
|
<input id="website" type="text" name="website" autocomplete="off" tabindex="-1">
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="field">
|
|
|
|
|
|
|
+ <div class="field" id="startEmailField">
|
|
|
<label for="startEmail">E-Mail</label>
|
|
<label for="startEmail">E-Mail</label>
|
|
|
- <input id="startEmail" type="email" name="email" required>
|
|
|
|
|
|
|
+ <input id="startEmail" type="email" name="email" required inputmode="email" autocomplete="email">
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="inline-actions">
|
|
|
|
|
|
|
+ <div class="inline-actions" id="startActions">
|
|
|
<button id="startSubmitBtn" type="submit">Formular laden</button>
|
|
<button id="startSubmitBtn" type="submit">Formular laden</button>
|
|
|
- <button id="resetDataBtn" type="button" class="hidden">Gespeicherte Daten löschen und neu starten</button>
|
|
|
|
|
</div>
|
|
</div>
|
|
|
- <p id="statusMessage" class="status-text" role="status" aria-live="polite"></p>
|
|
|
|
|
|
|
+ <div id="compactStatusBox" class="compact-status hidden">
|
|
|
|
|
+ <p><strong>E-Mail:</strong> <span id="statusEmailValue">-</span></p>
|
|
|
|
|
+ <p><strong>Speicherstatus:</strong> <span id="draftStatusValue">Noch nicht gespeichert</span></p>
|
|
|
|
|
+ <button id="resetDataBtn" type="button">Gespeicherte Daten löschen und neu starten</button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <p id="feedbackMessage" class="status-text" role="status" aria-live="polite"></p>
|
|
|
</form>
|
|
</form>
|
|
|
</section>
|
|
</section>
|
|
|
|
|
|
|
@@ -113,10 +135,6 @@ function renderField(array $field): void
|
|
|
<?php foreach (($step['fields'] ?? []) as $field): ?>
|
|
<?php foreach (($step['fields'] ?? []) as $field): ?>
|
|
|
<?php if (is_array($field)) { renderField($field); } ?>
|
|
<?php if (is_array($field)) { renderField($field); } ?>
|
|
|
<?php endforeach; ?>
|
|
<?php endforeach; ?>
|
|
|
-
|
|
|
|
|
- <?php if ((int) ($index + 1) === 3): ?>
|
|
|
|
|
- <button type="button" id="uploadNowBtn">Dateien jetzt speichern</button>
|
|
|
|
|
- <?php endif; ?>
|
|
|
|
|
</section>
|
|
</section>
|
|
|
<?php endforeach; ?>
|
|
<?php endforeach; ?>
|
|
|
|
|
|