This commit is contained in:
@@ -62,6 +62,12 @@ $categoryInputValue = $categoryTitleMap[$categorySlugValue] ?? $categorySlugValu
|
|||||||
$eventLocationModeValue = $editingEvent ? (string)($editEvent['location_source_type'] ?? 'custom') : 'custom';
|
$eventLocationModeValue = $editingEvent ? (string)($editEvent['location_source_type'] ?? 'custom') : 'custom';
|
||||||
$eventLocationSourceIdValue = $editingEvent && !empty($editEvent['location_source_listing_id']) ? (int)$editEvent['location_source_listing_id'] : 0;
|
$eventLocationSourceIdValue = $editingEvent && !empty($editEvent['location_source_listing_id']) ? (int)$editEvent['location_source_listing_id'] : 0;
|
||||||
$eventLocationSourceInputValue = '';
|
$eventLocationSourceInputValue = '';
|
||||||
|
$usesDatabaseEventLocation = $currentEntryKind === 'event' && $eventLocationModeValue !== 'custom';
|
||||||
|
$eventAddressInfoValue = trim(implode(', ', array_filter([
|
||||||
|
$streetValue,
|
||||||
|
trim($zipValue . ' ' . $cityValue),
|
||||||
|
$regionValue,
|
||||||
|
])));
|
||||||
foreach (($eventLocationOptions ?? []) as $locationOption) {
|
foreach (($eventLocationOptions ?? []) as $locationOption) {
|
||||||
if ((int)($locationOption['id'] ?? 0) !== $eventLocationSourceIdValue) {
|
if ((int)($locationOption['id'] ?? 0) !== $eventLocationSourceIdValue) {
|
||||||
continue;
|
continue;
|
||||||
@@ -1200,7 +1206,7 @@ if (!empty($canManageSystemSettings)) {
|
|||||||
<a class="btn ghost" href="/dashboard?section=places&create_listing=editorial_event#places">Neue Veranstaltung anlegen</a>
|
<a class="btn ghost" href="/dashboard?section=places&create_listing=editorial_event#places">Neue Veranstaltung anlegen</a>
|
||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<div class="stack gap-6" id="categoryInputWrap">
|
<div class="stack gap-6" id="categoryInputWrap"<?= $usesDatabaseEventLocation ? ' hidden' : '' ?>>
|
||||||
<label class="label" for="categoryInput">Kategorie</label>
|
<label class="label" for="categoryInput">Kategorie</label>
|
||||||
<input id="categoryInput" name="category_input" class="input" list="listingCategoryList" placeholder="z. B. Spielplatz, Café, Zirkus" value="<?= htmlspecialchars($categoryInputValue, ENT_QUOTES) ?>">
|
<input id="categoryInput" name="category_input" class="input" list="listingCategoryList" placeholder="z. B. Spielplatz, Café, Zirkus" value="<?= htmlspecialchars($categoryInputValue, ENT_QUOTES) ?>">
|
||||||
<input type="hidden" id="listingCategorySlug" name="category_slug" value="<?= htmlspecialchars($categorySlugValue, ENT_QUOTES) ?>">
|
<input type="hidden" id="listingCategorySlug" name="category_slug" value="<?= htmlspecialchars($categorySlugValue, ENT_QUOTES) ?>">
|
||||||
@@ -1211,9 +1217,9 @@ if (!empty($canManageSystemSettings)) {
|
|||||||
</datalist>
|
</datalist>
|
||||||
<div id="categoryInputStatus" class="muted small" style="margin:0;"></div>
|
<div id="categoryInputStatus" class="muted small" style="margin:0;"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="card" id="eventCategoryInfoWrap" hidden>
|
<div class="card" id="eventCategoryInfoWrap"<?= $usesDatabaseEventLocation ? '' : ' hidden' ?>>
|
||||||
<strong>Kategorie</strong>
|
<strong>Kategorie</strong>
|
||||||
<div class="muted small" id="eventCategoryInfoText" style="margin-top:8px;">Keine Kategorie ausgewählt.</div>
|
<div class="muted small" id="eventCategoryInfoText" style="margin-top:8px;"><?= htmlspecialchars($categoryInputValue !== '' ? $categoryInputValue : 'Keine Kategorie ausgewählt.', ENT_QUOTES) ?></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-grid" id="eventDateRow">
|
<div class="form-grid" id="eventDateRow">
|
||||||
<div class="stack gap-6">
|
<div class="stack gap-6">
|
||||||
@@ -1233,11 +1239,12 @@ if (!empty($canManageSystemSettings)) {
|
|||||||
<label class="label" for="maxParticipants">Platzzahl (optional)</label>
|
<label class="label" for="maxParticipants">Platzzahl (optional)</label>
|
||||||
<input id="maxParticipants" name="max_participants" class="input" type="number" min="1" value="<?= htmlspecialchars($capacityValue, ENT_QUOTES) ?>" placeholder="leer = offen">
|
<input id="maxParticipants" name="max_participants" class="input" type="number" min="1" value="<?= htmlspecialchars($capacityValue, ENT_QUOTES) ?>" placeholder="leer = offen">
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php if ($editingListing || ($section ?? '') === 'places'): ?>
|
||||||
<div class="stack gap-6" id="eventValidUntilWrap"<?= $currentEntryKind === 'event' ? ' hidden' : '' ?>>
|
<div class="stack gap-6" id="eventValidUntilWrap"<?= $currentEntryKind === 'event' ? ' hidden' : '' ?>>
|
||||||
<label class="label" for="recurrenceUntil">Gültig bis</label>
|
<label class="label" for="recurrenceUntil">Gültig bis</label>
|
||||||
<input id="recurrenceUntil" name="recurrence_until" class="input" type="date" value="<?= htmlspecialchars($recurrenceUntilValue, ENT_QUOTES) ?>">
|
<input id="recurrenceUntil" name="recurrence_until" class="input" type="date" value="<?= htmlspecialchars($recurrenceUntilValue, ENT_QUOTES) ?>">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<div class="stack gap-6" id="eventRecurrenceWrap"<?= $currentEntryKind === 'event' ? ' hidden' : '' ?>>
|
<div class="stack gap-6" id="eventRecurrenceWrap"<?= $currentEntryKind === 'event' ? ' hidden' : '' ?>>
|
||||||
<label class="label" for="recurrenceMode">Wiederholung</label>
|
<label class="label" for="recurrenceMode">Wiederholung</label>
|
||||||
<select id="recurrenceMode" name="recurrence_mode" class="select">
|
<select id="recurrenceMode" name="recurrence_mode" class="select">
|
||||||
@@ -1246,6 +1253,7 @@ if (!empty($canManageSystemSettings)) {
|
|||||||
<option value="weekly" <?= $recurrenceModeValue === 'weekly' ? 'selected' : '' ?>>Wöchentlich</option>
|
<option value="weekly" <?= $recurrenceModeValue === 'weekly' ? 'selected' : '' ?>>Wöchentlich</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
<?php if ($editingListing): ?>
|
<?php if ($editingListing): ?>
|
||||||
<div class="stack gap-6">
|
<div class="stack gap-6">
|
||||||
<label class="label" for="listingModerationReason">Begründung für die Änderungsanfrage</label>
|
<label class="label" for="listingModerationReason">Begründung für die Änderungsanfrage</label>
|
||||||
@@ -1255,7 +1263,7 @@ if (!empty($canManageSystemSettings)) {
|
|||||||
<?php elseif (($section ?? '') === 'places'): ?>
|
<?php elseif (($section ?? '') === 'places'): ?>
|
||||||
<p class="muted small" style="margin:0;">Neue Orte und Veranstaltungen werden erst nach Prüfung durch einen Admin freigegeben.</p>
|
<p class="muted small" style="margin:0;">Neue Orte und Veranstaltungen werden erst nach Prüfung durch einen Admin freigegeben.</p>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<div class="form-grid" id="eventAddressFieldsWrap">
|
<div class="form-grid" id="eventAddressFieldsWrap"<?= $usesDatabaseEventLocation ? ' hidden' : '' ?>>
|
||||||
<div class="stack gap-6">
|
<div class="stack gap-6">
|
||||||
<label class="label" for="evZip">PLZ</label>
|
<label class="label" for="evZip">PLZ</label>
|
||||||
<input id="evZip" name="zip" class="input" maxlength="5" value="<?= htmlspecialchars($zipValue, ENT_QUOTES) ?>">
|
<input id="evZip" name="zip" class="input" maxlength="5" value="<?= htmlspecialchars($zipValue, ENT_QUOTES) ?>">
|
||||||
@@ -1265,7 +1273,7 @@ if (!empty($canManageSystemSettings)) {
|
|||||||
<input id="evCity" name="city" class="input" value="<?= htmlspecialchars($cityValue, ENT_QUOTES) ?>">
|
<input id="evCity" name="city" class="input" value="<?= htmlspecialchars($cityValue, ENT_QUOTES) ?>">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-grid" id="eventAddressStreetWrap">
|
<div class="form-grid" id="eventAddressStreetWrap"<?= $usesDatabaseEventLocation ? ' hidden' : '' ?>>
|
||||||
<div class="stack gap-6">
|
<div class="stack gap-6">
|
||||||
<label class="label" for="evStreet">Straße / Adresse</label>
|
<label class="label" for="evStreet">Straße / Adresse</label>
|
||||||
<input id="evStreet" name="street" class="input" placeholder="z. B. Musterstraße 12" value="<?= htmlspecialchars($streetValue, ENT_QUOTES) ?>">
|
<input id="evStreet" name="street" class="input" placeholder="z. B. Musterstraße 12" value="<?= htmlspecialchars($streetValue, ENT_QUOTES) ?>">
|
||||||
@@ -1275,18 +1283,18 @@ if (!empty($canManageSystemSettings)) {
|
|||||||
<input id="evRegion" name="region" class="input" value="<?= htmlspecialchars($regionValue, ENT_QUOTES) ?>">
|
<input id="evRegion" name="region" class="input" value="<?= htmlspecialchars($regionValue, ENT_QUOTES) ?>">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex gap-8" style="flex-wrap:wrap; align-items:center;" id="eventAddressActionsWrap">
|
<div class="flex gap-8" style="flex-wrap:wrap; align-items:center;<?= $usesDatabaseEventLocation ? ' display:none;' : '' ?>" id="eventAddressActionsWrap">
|
||||||
<button class="btn ghost" type="button" id="btnEventAddressSearch">Adresse suchen</button>
|
<button class="btn ghost" type="button" id="btnEventAddressSearch">Adresse suchen</button>
|
||||||
<button class="btn ghost" type="button" id="btnEventBrowserLocation">📍 Aktuellen Standort</button>
|
<button class="btn ghost" type="button" id="btnEventBrowserLocation">📍 Aktuellen Standort</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="card" id="eventAddressInfoWrap" hidden>
|
<details class="card" id="eventAddressInfoWrap"<?= $usesDatabaseEventLocation ? '' : ' hidden' ?>>
|
||||||
<strong>Adresse</strong>
|
<summary style="cursor:pointer; font-weight:600;">Adresse</summary>
|
||||||
<div class="muted small" id="eventAddressInfoText" style="margin-top:8px;">Kein Ort ausgewählt.</div>
|
<div class="muted small" id="eventAddressInfoText" style="margin-top:12px;"><?= htmlspecialchars($eventAddressInfoValue !== '' ? $eventAddressInfoValue : 'Kein Ort ausgewählt.', ENT_QUOTES) ?></div>
|
||||||
</div>
|
</details>
|
||||||
<div id="eventAddressStatus" class="muted small" style="margin:0;"></div>
|
<div id="eventAddressStatus" class="muted small" style="margin:0;<?= $usesDatabaseEventLocation ? ' display:none;' : '' ?>"></div>
|
||||||
<input type="hidden" id="evLat" name="lat" value="<?= htmlspecialchars($latValue, ENT_QUOTES) ?>">
|
<input type="hidden" id="evLat" name="lat" value="<?= htmlspecialchars($latValue, ENT_QUOTES) ?>">
|
||||||
<input type="hidden" id="evLng" name="lng" value="<?= htmlspecialchars($lngValue, ENT_QUOTES) ?>">
|
<input type="hidden" id="evLng" name="lng" value="<?= htmlspecialchars($lngValue, ENT_QUOTES) ?>">
|
||||||
<div class="card" id="mapDetails">
|
<div class="card" id="mapDetails"<?= $usesDatabaseEventLocation ? ' hidden' : '' ?>>
|
||||||
<div class="stack gap-6">
|
<div class="stack gap-6">
|
||||||
<div class="flex gap-8" style="flex-wrap:wrap; align-items:center;">
|
<div class="flex gap-8" style="flex-wrap:wrap; align-items:center;">
|
||||||
<strong>Karte</strong>
|
<strong>Karte</strong>
|
||||||
@@ -1649,11 +1657,11 @@ if (!empty($canManageSystemSettings)) {
|
|||||||
if (categoryInput) categoryInput.required = kind !== 'event';
|
if (categoryInput) categoryInput.required = kind !== 'event';
|
||||||
setSectionState(eventChildrenWrap, kind === 'event' || kind === 'editorial_event');
|
setSectionState(eventChildrenWrap, kind === 'event' || kind === 'editorial_event');
|
||||||
setSectionState(eventCapacityWrap, kind === 'event');
|
setSectionState(eventCapacityWrap, kind === 'event');
|
||||||
setSectionState(eventValidUntilWrap, kind === 'editorial_event');
|
if (eventValidUntilWrap) setSectionState(eventValidUntilWrap, kind === 'editorial_event');
|
||||||
setSectionState(eventPricingWrap, kind === 'place' || kind === 'editorial_event');
|
setSectionState(eventPricingWrap, kind === 'place' || kind === 'editorial_event');
|
||||||
setSectionState(placeContactWrap, kind === 'place' || kind === 'editorial_event');
|
setSectionState(placeContactWrap, kind === 'place' || kind === 'editorial_event');
|
||||||
setSectionState(placeOpeningHoursWrap, kind === 'place' || kind === 'editorial_event');
|
setSectionState(placeOpeningHoursWrap, kind === 'place' || kind === 'editorial_event');
|
||||||
setSectionState(eventRecurrenceWrap, kind === 'editorial_event');
|
if (eventRecurrenceWrap) setSectionState(eventRecurrenceWrap, kind === 'editorial_event');
|
||||||
setSectionState(visibilityDetails, kind === 'event');
|
setSectionState(visibilityDetails, kind === 'event');
|
||||||
if (eventDateLabel) {
|
if (eventDateLabel) {
|
||||||
eventDateLabel.textContent = kind === 'editorial_event' ? 'Gültig von' : 'Datum';
|
eventDateLabel.textContent = kind === 'editorial_event' ? 'Gültig von' : 'Datum';
|
||||||
|
|||||||
Reference in New Issue
Block a user