asdasd
All checks were successful
Deploy / deploy (push) Successful in 53s

This commit is contained in:
2026-08-17 00:49:49 +02:00
parent f7a6b34a97
commit c2eaa5c186
8 changed files with 86 additions and 37 deletions

View File

@@ -148,6 +148,7 @@ if (!empty($canManageProfileLevels)) {
$showEventTypeChoice = !$editing && (($section ?? 'events') === 'places') && $requestedCreateListingKind === null;
$modalSectionTarget = ($editingListing || ($section ?? '') === 'places') ? 'places' : 'events';
if (!empty($canManageSystemSettings)) {
$sectionLinks['categories'] = 'Kategorien';
$sectionLinks['system'] = 'System';
}
?>
@@ -946,44 +947,56 @@ if (!empty($canManageSystemSettings)) {
<li>Fehlende Tabellen: <?= !empty($listingCatalogStatus['missing']) ? htmlspecialchars(implode(', ', $listingCatalogStatus['missing']), ENT_QUOTES) : 'Keine' ?></li>
</ul>
</div>
</div>
</section>
<?php endif; ?>
<div class="card" style="margin-top:18px;">
<strong>Kategorien prüfen und zusammenführen</strong>
<p class="muted small" style="margin:10px 0 14px;">Neue Kategorien werden automatisch angelegt. Hier kannst du sie prüfen und bei Bedarf mit einer bestehenden Kategorie zusammenführen.</p>
<?php if (!empty($categoryReviewItems)): ?>
<div class="stack gap-10">
<?php foreach ($categoryReviewItems as $categoryItem): ?>
<div class="card" style="padding:12px;">
<div class="flex between center-y" style="gap:12px; flex-wrap:wrap;">
<div>
<strong><?= htmlspecialchars((string)$categoryItem['title'], ENT_QUOTES) ?></strong>
<?php if (!empty($categoryItem['needs_review'])): ?>
<span class="badge" style="margin-left:8px;">Neu</span>
<?php endif; ?>
<div class="muted small" style="margin-top:6px;">
Slug: <?= htmlspecialchars((string)$categoryItem['slug'], ENT_QUOTES) ?> · Einträge: <?= (int)($categoryItem['listing_count'] ?? 0) ?> · Orte: <?= (int)($categoryItem['place_count'] ?? 0) ?> · Eigene Events: <?= (int)($categoryItem['event_count'] ?? 0) ?>
</div>
</div>
<?php if ($section === 'categories' && !empty($canManageSystemSettings)): ?>
<section class="account-panel">
<div class="account-panel__head">
<h2>Kategorien</h2>
</div>
<div class="account-panel__body">
<?php if (!empty($categoryReviewItems)): ?>
<datalist id="categoryMergeSuggestions">
<?php foreach ($listingCategories as $targetCategory): ?>
<option value="<?= htmlspecialchars((string)$targetCategory['title'], ENT_QUOTES) ?>"></option>
<?php endforeach; ?>
</datalist>
<div class="stack gap-10">
<?php foreach ($categoryReviewItems as $categoryItem): ?>
<div class="card" style="padding:12px;">
<div>
<strong><?= htmlspecialchars((string)$categoryItem['title'], ENT_QUOTES) ?></strong>
<span class="badge" style="margin-left:8px;">Neu</span>
<div class="muted small" style="margin-top:6px;">
Slug: <?= htmlspecialchars((string)$categoryItem['slug'], ENT_QUOTES) ?> · Einträge: <?= (int)($categoryItem['listing_count'] ?? 0) ?> · Orte: <?= (int)($categoryItem['place_count'] ?? 0) ?> · Eigene Events: <?= (int)($categoryItem['event_count'] ?? 0) ?>
</div>
<form method="post" class="flex gap-8" style="margin-top:12px; flex-wrap:wrap;">
<input type="hidden" name="action" value="category_merge">
<input type="hidden" name="source_category_slug" value="<?= htmlspecialchars((string)$categoryItem['slug'], ENT_QUOTES) ?>">
<select name="target_category_slug" class="select" style="min-width:260px;">
<option value="">Mit Kategorie zusammenführen</option>
<?php foreach ($listingCategories as $targetCategory): ?>
<?php if ((string)$targetCategory['slug'] === (string)$categoryItem['slug']) { continue; } ?>
<option value="<?= htmlspecialchars((string)$targetCategory['slug'], ENT_QUOTES) ?>"><?= htmlspecialchars((string)$targetCategory['title'], ENT_QUOTES) ?></option>
<?php endforeach; ?>
</select>
<button class="btn ghost" type="submit">Zusammenführen</button>
</form>
</div>
<?php endforeach; ?>
</div>
<?php else: ?>
<p class="muted small" style="margin:12px 0 0;">Aktuell gibt es keine Kategorien zur Prüfung.</p>
<?php endif; ?>
</div>
<form method="post" class="stack gap-8" style="margin-top:12px;">
<input type="hidden" name="action" value="category_merge">
<input type="hidden" name="source_category_slug" value="<?= htmlspecialchars((string)$categoryItem['slug'], ENT_QUOTES) ?>">
<div class="stack gap-6">
<label class="label" for="targetCategoryInput<?= (int)($categoryItem['id'] ?? 0) ?>">Mit bestehender Kategorie zusammenführen</label>
<input
id="targetCategoryInput<?= (int)($categoryItem['id'] ?? 0) ?>"
name="target_category_input"
class="input"
list="categoryMergeSuggestions"
placeholder="Kategorie suchen"
required
>
</div>
<div class="flex gap-8" style="flex-wrap:wrap;">
<button class="btn ghost" type="submit">Zusammenführen</button>
</div>
</form>
</div>
<?php endforeach; ?>
</div>
<?php else: ?>
<p class="muted small">Aktuell gibt es keine neuen Kategorien.</p>
<?php endif; ?>
</div>
</section>
<?php endif; ?>