Community Orte Veranstalungen
All checks were successful
Deploy / deploy (push) Successful in 57s

This commit is contained in:
2026-08-21 02:02:24 +02:00
parent a303d9ff70
commit fae2dcc830
11 changed files with 89 additions and 24 deletions

View File

@@ -13,6 +13,7 @@ $restoreEventDraftActive = !empty($restoreEventDraftActive);
$editingEvent = isset($editEvent) && $editEvent !== null;
$editingListing = isset($editListing) && $editListing !== null;
$editing = $editingEvent || $editingListing;
$editingSuggestionDirectly = $editingListing && (string)($editListing['status'] ?? '') !== 'published';
$eventDraftValues = (!$editing && (($section ?? '') === 'events') && $restoreEventDraftActive && is_array($restoredEventDraft ?? null))
? $restoredEventDraft
: [];
@@ -31,8 +32,8 @@ if ($editingEvent && !empty($editEvent['starts_at'])) {
$withChildrenValue = $editingEvent
? (((int)($editEvent['allow_kids'] ?? 1)) === 1 ? 'yes' : 'no')
: (!empty($eventDraftValues['with_children']) ? (string)$eventDraftValues['with_children'] : (($editingListing && $currentEntryKind === 'editorial_event' && !empty($editListing['supports_registration'])) ? 'yes' : 'yes'));
$eventTitle = $editingEvent ? 'Event bearbeiten' : ($editingListing ? ($currentEntryKind === 'place' ? 'Änderung für Ort anfragen' : 'Änderung für Veranstaltung anfragen') : ((($section ?? 'events') === 'places') ? 'Ort oder Veranstaltung anlegen' : 'Neues Event anlegen'));
$submitLabel = $editingEvent ? 'Event speichern' : ($editingListing ? 'Änderungsanfrage senden' : ((($section ?? 'events') === 'places') ? 'Eintrag zur Freigabe einreichen' : 'Event anlegen'));
$eventTitle = $editingEvent ? 'Event bearbeiten' : ($editingListing ? ($editingSuggestionDirectly ? (($currentEntryKind === 'place') ? 'Ort bearbeiten' : 'Veranstaltung bearbeiten') : (($currentEntryKind === 'place') ? 'Änderung für Ort anfragen' : 'Änderung für Veranstaltung anfragen')) : ((($section ?? 'events') === 'places') ? 'Ort oder Veranstaltung anlegen' : 'Neues Event anlegen'));
$submitLabel = $editingEvent ? 'Event speichern' : ($editingListing ? ($editingSuggestionDirectly ? 'Änderungen speichern' : 'Änderungsanfrage senden') : ((($section ?? 'events') === 'places') ? 'Eintrag zur Freigabe einreichen' : 'Event anlegen'));
$titleValue = $editingEvent ? (string)($editEvent['title'] ?? '') : (!empty($eventDraftValues['title']) ? (string)$eventDraftValues['title'] : (string)($editListing['title'] ?? ''));
$teaserValue = $editingEvent ? (string)($editEvent['teaser_public'] ?? '') : (string)($editListing['teaser_public'] ?? '');
$descriptionValue = $editingEvent ? (string)($editEvent['description'] ?? '') : (!empty($eventDraftValues['description']) ? (string)$eventDraftValues['description'] : (string)($editListing['description'] ?? ''));
@@ -751,15 +752,25 @@ if (!empty($canManageSystemSettings)) {
<?php else: ?>
<ul class="dash-list" style="margin-top:12px;">
<?php foreach ($pendingListings as $entry): ?>
<?php $canEditPendingEntry = ((int)($entry['created_by'] ?? 0) === $dashboardUserId) || !empty($canReviewListings); ?>
<li>
<strong><?= htmlspecialchars((string)$entry['title'], ENT_QUOTES) ?></strong>
<span class="badge"><?= ($entry['listing_type'] ?? '') === 'place' ? 'Ort' : 'Veranstaltung' ?></span>
<span class="badge" style="background:#fff7e6; color:#8a5a00;">
<?= (string)($entry['moderation_request_status'] ?? '') === 'rejected' ? 'Abgelehnt' : 'Wartet auf Freigabe' ?>
</span>
<?php if (!empty($entry['moderation_review_note'])): ?>
<div class="muted small" style="margin-top:6px;">Admin-Hinweis: <?= htmlspecialchars((string)$entry['moderation_review_note'], ENT_QUOTES) ?></div>
<?php endif; ?>
<div style="display:flex; justify-content:space-between; gap:12px; align-items:flex-start; flex-wrap:wrap;">
<div>
<strong><?= htmlspecialchars((string)$entry['title'], ENT_QUOTES) ?></strong>
<span class="badge"><?= ($entry['listing_type'] ?? '') === 'place' ? 'Ort' : 'Veranstaltung' ?></span>
<span class="badge" style="background:#fff7e6; color:#8a5a00;">
<?= (string)($entry['moderation_request_status'] ?? '') === 'rejected' ? 'Abgelehnt' : 'Wartet auf Freigabe' ?>
</span>
<?php if (!empty($entry['moderation_review_note'])): ?>
<div class="muted small" style="margin-top:6px;">Admin-Hinweis: <?= htmlspecialchars((string)$entry['moderation_review_note'], ENT_QUOTES) ?></div>
<?php endif; ?>
</div>
<?php if ($canEditPendingEntry): ?>
<div class="flex gap-8" style="flex-wrap:wrap;">
<a class="btn ghost" href="/dashboard?section=places&edit_listing=<?= (int)$entry['id'] ?>#places">Bearbeiten</a>
</div>
<?php endif; ?>
</div>
</li>
<?php endforeach; ?>
</ul>
@@ -1593,12 +1604,14 @@ if (!empty($canManageSystemSettings)) {
</select>
</div>
<?php endif; ?>
<?php if ($editingListing): ?>
<?php if ($editingListing && !$editingSuggestionDirectly): ?>
<div class="stack gap-6">
<label class="label" for="listingModerationReason">Begründung für die Änderungsanfrage</label>
<textarea id="listingModerationReason" name="moderation_reason" class="textarea" rows="3" placeholder="Was stimmt nicht oder was soll angepasst werden?" required></textarea>
<p class="muted small" style="margin:0;">Die Änderung wird erst nach Prüfung durch einen Admin freigegeben.</p>
</div>
<?php elseif ($editingSuggestionDirectly): ?>
<p class="muted small" style="margin:0;">Dieser Vorschlag ist noch nicht veröffentlicht und kann direkt aktualisiert werden.</p>
<?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>
<?php endif; ?>