yyxc
All checks were successful
Deploy / deploy (push) Successful in 56s

This commit is contained in:
2026-08-19 20:14:15 +02:00
parent c567d19deb
commit 39dfc97ae6
7 changed files with 147 additions and 7 deletions

View File

@@ -959,12 +959,79 @@ if (!empty($canManageSystemSettings)) {
<h2>Kategorien</h2>
</div>
<div class="account-panel__body">
<datalist id="categoryMergeSuggestions">
<?php foreach ($listingCategories as $targetCategory): ?>
<option value="<?= htmlspecialchars((string)$targetCategory['title'], ENT_QUOTES) ?>"></option>
<?php endforeach; ?>
</datalist>
<div class="card" style="margin-bottom:18px;">
<form method="get" class="stack gap-12">
<input type="hidden" name="section" value="categories">
<div class="form-grid">
<div class="stack gap-6">
<label class="label" for="categoryQuery">Kategorie suchen</label>
<input id="categoryQuery" name="category_query" class="input" value="<?= htmlspecialchars((string)($categorySearchQuery ?? ''), ENT_QUOTES) ?>" list="categoryMergeSuggestions">
</div>
<div class="stack gap-6" style="justify-content:end;">
<span class="label" aria-hidden="true">&nbsp;</span>
<button class="btn" type="submit">Suchen</button>
</div>
</div>
</form>
</div>
<?php if (($categorySearchQuery ?? '') !== ''): ?>
<div class="card" style="margin-bottom:18px;">
<strong>Suchergebnisse</strong>
<?php if (!empty($categorySearchResults)): ?>
<div class="stack gap-10" style="margin-top:12px;">
<?php foreach ($categorySearchResults as $categoryItem): ?>
<div class="card" style="padding:12px;">
<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>
<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="targetCategorySearchInput<?= (int)($categoryItem['id'] ?? 0) ?>">Mit bestehender Kategorie zusammenführen</label>
<input
id="targetCategorySearchInput<?= (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>
<?php if (!empty($categoryItem['needs_review'])): ?>
<form method="post" style="margin-top:12px;">
<input type="hidden" name="action" value="category_confirm">
<input type="hidden" name="source_category_slug" value="<?= htmlspecialchars((string)$categoryItem['slug'], ENT_QUOTES) ?>">
<button class="btn" type="submit">Bestätigen</button>
</form>
<?php endif; ?>
</div>
<?php endforeach; ?>
</div>
<?php else: ?>
<p class="muted small" style="margin-top:12px;">Keine passenden Kategorien gefunden.</p>
<?php endif; ?>
</div>
<?php endif; ?>
<?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;">