Forum: search, muting members, archived topics, the public threads in the sitemap

- Search (/forum/kereses, the magnifier in the forum bar): thread titles
  and posts the viewer may read, Hungarian stems and word beginnings
  without accents ("alvas" finds "alvásban"), one result per thread with
  the matching words marked.
- Muting a member (post menu, profile; the list in the settings): their
  threads leave the lists, their posts fold up, their replies and mentions
  no longer count or send e-mails. They are not told.
- The admin archives a topic (Moderálás → Témák): it stays readable but
  takes no new threads or replies, and folds away on the front page.
- The public topics and threads are in the sitemap; the forum's own pages
  are kept from robots.
- A reply e-mail goes to the one answered, also on the second level.
- Migration 0043 also prepares charts attached to a forum question.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
This commit is contained in:
feco
2026-11-26 14:31:05 +00:00
co-authored by Claude Opus 5.5
parent 4800a30e6d
commit 9ca3f478be
30 changed files with 879 additions and 105 deletions
+84 -58
View File
@@ -173,73 +173,99 @@ export default async function ForumHomePage() {
<h2 id="fh-topics">Témák</h2>
</div>
<ul className="fh-card fh-flush fh-topics">
{topics.map((t) =>
t.visibility === "restricted" && !t.readable ? (
<li key={t.slug}>
<div className="fh-topic fh-topic-closed">
<span className="fh-topic-icon">
<TopicIcon slug={t.slug} />
</span>
<span className="fh-topic-text">
<span className="fh-topic-name">
{t.name}
<svg viewBox="0 0 24 24" className="fh-lock" role="img" aria-label="Zárt téma">
<rect x="5" y="11" width="14" height="9" rx="2" />
<path d="M8 11V8a4 4 0 0 1 8 0v3" />
</svg>
{topics
.filter((t) => !t.archived)
.map((t) =>
t.visibility === "restricted" && !t.readable ? (
<li key={t.slug}>
<div className="fh-topic fh-topic-closed">
<span className="fh-topic-icon">
<TopicIcon slug={t.slug} />
</span>
<span className="fh-topic-desc">{t.description}</span>
<span className="fh-topic-last">Zárt kör: jóváhagyás után olvasható</span>
</span>
{viewer.member && <JoinTopic slug={t.slug} pending={t.membership === "pending"} />}
</div>
</li>
) : (
<li key={t.slug}>
<Link
href={t.readable ? `/forum/${t.slug}` : `/belepes?vissza=/forum/${t.slug}`}
className="fh-topic"
>
<span className="fh-topic-icon">
<TopicIcon slug={t.slug} />
</span>
<span className="fh-topic-text">
<span className="fh-topic-name">
{t.name}
{t.visibility !== "public" && (
<svg viewBox="0 0 24 24" className="fh-lock" role="img" aria-label="Csak tagoknak">
<span className="fh-topic-text">
<span className="fh-topic-name">
{t.name}
<svg viewBox="0 0 24 24" className="fh-lock" role="img" aria-label="Zárt téma">
<rect x="5" y="11" width="14" height="9" rx="2" />
<path d="M8 11V8a4 4 0 0 1 8 0v3" />
</svg>
)}
</span>
<span className="fh-topic-desc">{t.description}</span>
<span className="fh-topic-last">Zárt kör: jóváhagyás után olvasható</span>
</span>
<span className="fh-topic-desc">{t.description}</span>
{t.readable && t.last && (
<span className="fh-topic-last">
{t.last.author && (
<Avatar avatar={t.last.author.avatar} size={18} online={t.last.author.online} />
{viewer.member && <JoinTopic slug={t.slug} pending={t.membership === "pending"} />}
</div>
</li>
) : (
<li key={t.slug}>
<Link
href={t.readable ? `/forum/${t.slug}` : `/belepes?vissza=/forum/${t.slug}`}
className="fh-topic"
>
<span className="fh-topic-icon">
<TopicIcon slug={t.slug} />
</span>
<span className="fh-topic-text">
<span className="fh-topic-name">
{t.name}
{t.visibility !== "public" && (
<svg viewBox="0 0 24 24" className="fh-lock" role="img" aria-label="Csak tagoknak">
<rect x="5" y="11" width="14" height="9" rx="2" />
<path d="M8 11V8a4 4 0 0 1 8 0v3" />
</svg>
)}
{t.last.author?.nickname ?? "Törölt tag"},{" "}
<time suppressHydrationWarning dateTime={t.last.at}>
{ago(t.last.at)}
</time>
</span>
<span className="fh-topic-desc">{t.description}</span>
{t.readable && t.last && (
<span className="fh-topic-last">
{t.last.author && (
<Avatar avatar={t.last.author.avatar} size={18} online={t.last.author.online} />
)}
{t.last.author?.nickname ?? "Törölt tag"},{" "}
<time suppressHydrationWarning dateTime={t.last.at}>
{ago(t.last.at)}
</time>
</span>
)}
{!t.readable && <span className="fh-topic-last">Belépés után olvasható</span>}
</span>
{t.readable && (
<span className="fh-topic-count">
<strong>{t.thread_count ?? 0}</strong> szál
</span>
)}
{!t.readable && <span className="fh-topic-last">Belépés után olvasható</span>}
</span>
{t.readable && (
<span className="fh-topic-count">
<strong>{t.thread_count ?? 0}</strong> szál
</span>
)}
{t.readable && t.new_count ? (
<span className="ft-new">{t.new_count > 99 ? "99+" : t.new_count} új</span>
) : null}
</Link>
</li>
),
)}
{t.readable && t.new_count ? (
<span className="ft-new">{t.new_count > 99 ? "99+" : t.new_count} új</span>
) : null}
</Link>
</li>
),
)}
</ul>
{topics.some((t) => t.archived) && (
<details className="fh-archived">
<summary>Archivált témák ({topics.filter((t) => t.archived).length})</summary>
<ul className="fh-card fh-flush fh-links">
{topics
.filter((t) => t.archived && t.readable)
.map((t) => (
<li key={t.slug}>
<Link href={`/forum/${t.slug}`} className="fh-link">
<span className="fh-link-text">
{t.name}
<span className="hint">
{t.description} · {t.thread_count ?? 0} szál
</span>
</span>
<span className="fh-link-arrow" aria-hidden="true">
›
</span>
</Link>
</li>
))}
</ul>
</details>
)}
</section>
</div>