hhhh
All checks were successful
Deploy / deploy (push) Successful in 48s

This commit is contained in:
2026-07-19 03:08:35 +02:00
parent 3ff5767900
commit b9673814b5
4 changed files with 38 additions and 21 deletions

View File

@@ -31,9 +31,9 @@ return [
'title' => 'Alltag mit Kindern', 'title' => 'Alltag mit Kindern',
'boards' => [ 'boards' => [
[ [
'slug' => 'kleinkindalter', 'slug' => 'kinderalltag',
'title' => 'Kleinkindalter', 'title' => 'Kinderalltag',
'description' => 'Erfahrungen, Fragen und Gedanken rund um die ersten Jahre mit Kindern.', 'description' => 'Erfahrungen, Fragen und Gedanken rund um das tägliche Leben mit Kindern.',
'icon' => '🧸', 'icon' => '🧸',
], ],
[ [

View File

@@ -78,12 +78,24 @@ $roleAssignments = $canManageRoles && $access ? $access->listRoleAssignments() :
<h1>Community</h1> <h1>Community</h1>
<p class="forum-hero__copy">Fragen stellen, Erfahrungen teilen, Antworten finden und gemeinsam weiterdenken.</p> <p class="forum-hero__copy">Fragen stellen, Erfahrungen teilen, Antworten finden und gemeinsam weiterdenken.</p>
</div> </div>
<div class="forum-hero__actions"> <div class="forum-hero__actions forum-hero__actions--stack">
<?php if ($userId): ?> <form method="get" class="forum-search forum-search--hero">
<button class="btn" type="button" data-modal-open="modalThread">Neues Thema</button> <?php if ($boardSlug !== ''): ?>
<?php else: ?> <input type="hidden" name="board" value="<?= htmlspecialchars($boardSlug, ENT_QUOTES) ?>">
<a class="btn" href="/login">Einloggen und schreiben</a> <?php endif; ?>
<?php endif; ?> <label class="label" for="searchQHero">Suche</label>
<div class="forum-search__row">
<input id="searchQHero" name="q" class="input" value="<?= htmlspecialchars($search, ENT_QUOTES) ?>" placeholder="Thema oder Stichwort suchen">
<button class="btn" type="submit">Suchen</button>
</div>
</form>
<div class="forum-hero__cta">
<?php if ($userId): ?>
<button class="btn" type="button" data-modal-open="modalThread">Neues Thema</button>
<?php else: ?>
<a class="btn" href="/login">Einloggen und schreiben</a>
<?php endif; ?>
</div>
</div> </div>
</div> </div>
@@ -147,21 +159,14 @@ $roleAssignments = $canManageRoles && $access ? $access->listRoleAssignments() :
<div class="forum-board" style="margin-top:24px;"> <div class="forum-board" style="margin-top:24px;">
<div class="forum-board__head"> <div class="forum-board__head">
<div> <div>
<h2><?= htmlspecialchars($selectedBoard['title'] ?? 'Themenübersicht', ENT_QUOTES) ?></h2> <h2><?= htmlspecialchars($selectedBoard['title'] ?? 'Neueste Themen', ENT_QUOTES) ?></h2>
<p class="muted"> <p class="muted">
<?= htmlspecialchars($selectedBoard['description'] ?? 'Hier findest du die neuesten Themen, Antworten und laufenden Gespräche.', ENT_QUOTES) ?> <?= htmlspecialchars($selectedBoard['description'] ?? 'Hier siehst du die zuletzt erstellten oder zuletzt aktiven Themen aus der Community.', ENT_QUOTES) ?>
</p> </p>
</div> </div>
<form method="get" class="forum-search"> <?php if ($selectedBoard): ?>
<?php if ($boardSlug !== ''): ?> <a class="btn ghost" href="/community">Alle Bereiche anzeigen</a>
<input type="hidden" name="board" value="<?= htmlspecialchars($boardSlug, ENT_QUOTES) ?>"> <?php endif; ?>
<?php endif; ?>
<label class="label" for="searchQ">Suche</label>
<div class="forum-search__row">
<input id="searchQ" name="q" class="input" value="<?= htmlspecialchars($search, ENT_QUOTES) ?>" placeholder="Schlagwort eingeben">
<button class="btn" type="submit">Suchen</button>
</div>
</form>
</div> </div>
<div class="forum-list"> <div class="forum-list">

View File

@@ -154,6 +154,8 @@ body {
.forum-hero h1 { margin: 6px 0 8px; } .forum-hero h1 { margin: 6px 0 8px; }
.forum-hero__copy { margin: 0; max-width: 70ch; color: var(--color-muted); font-size: 16px; } .forum-hero__copy { margin: 0; max-width: 70ch; color: var(--color-muted); font-size: 16px; }
.forum-hero__actions { display: flex; align-items: center; gap: 12px; } .forum-hero__actions { display: flex; align-items: center; gap: 12px; }
.forum-hero__actions--stack { flex-direction: column; align-items: stretch; min-width: min(100%, 360px); }
.forum-hero__cta { display: flex; justify-content: flex-end; }
.forum-stats { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; margin: 18px 0 24px; } .forum-stats { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; margin: 18px 0 24px; }
.forum-stats--compact { grid-template-columns: repeat(2, minmax(0,1fr)); max-width: 540px; } .forum-stats--compact { grid-template-columns: repeat(2, minmax(0,1fr)); max-width: 540px; }
.forum-stat { padding: 18px 20px; background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-md); box-shadow: var(--shadow-card); } .forum-stat { padding: 18px 20px; background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-md); box-shadow: var(--shadow-card); }
@@ -176,6 +178,7 @@ body {
.forum-board__head { display: flex; justify-content: space-between; gap: 20px; align-items: end; padding: 22px 24px; border-bottom: 1px solid var(--color-border); background: #fffdfa; } .forum-board__head { display: flex; justify-content: space-between; gap: 20px; align-items: end; padding: 22px 24px; border-bottom: 1px solid var(--color-border); background: #fffdfa; }
.forum-board__head h2 { margin: 0 0 6px; } .forum-board__head h2 { margin: 0 0 6px; }
.forum-search { display: grid; gap: 8px; min-width: min(100%, 360px); } .forum-search { display: grid; gap: 8px; min-width: min(100%, 360px); }
.forum-search--hero { width: 100%; }
.forum-search__row { display: flex; gap: 10px; } .forum-search__row { display: flex; gap: 10px; }
.forum-list__header { display: grid; grid-template-columns: minmax(0, 1fr) 120px 220px; gap: 16px; padding: 14px 24px; background: #f8f4ec; color: var(--color-muted); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .35px; } .forum-list__header { display: grid; grid-template-columns: minmax(0, 1fr) 120px 220px; gap: 16px; padding: 14px 24px; background: #f8f4ec; color: var(--color-muted); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .35px; }
.forum-row { display: grid; grid-template-columns: minmax(0, 1fr) 120px 220px; gap: 16px; padding: 20px 24px; border-top: 1px solid var(--color-border); align-items: start; } .forum-row { display: grid; grid-template-columns: minmax(0, 1fr) 120px 220px; gap: 16px; padding: 20px 24px; border-top: 1px solid var(--color-border); align-items: start; }

View File

@@ -466,6 +466,15 @@ final class Community
]); ]);
} }
} }
// Migrate legacy uncategorized threads into a default board once board support is available.
if ($this->hasColumn('forum_threads', 'board_id')) {
$defaultBoard = $this->getBoardBySlug('wochenendideen');
if ($defaultBoard && !empty($defaultBoard['id'])) {
$stmt = $this->pdo->prepare('UPDATE forum_threads SET board_id = :boardId WHERE board_id IS NULL');
$stmt->execute(['boardId' => (int)$defaultBoard['id']]);
}
}
} }
private function hasTable(string $table): bool private function hasTable(string $table): bool