Forum: whom a reply answers, icon badges, the new features on the pages

- Replies stay two levels deep, but a reply to a reply says whom it is
  for ("↪ Holdfény"): posts.reply_to_id.
- The question stands apart on its own card; the listening reminder above
  the reply box is gone.
- Every rank and badge has its own line icon (Vándor, Kereső, Fonó,
  Csillagfonó, Sorsfonó; Moderátor, Meghallgató, Támogató, Szálindító).
- Pages for the new features: own avatar upload and the moderator's reset,
  the listener and supporter switches, mention and weekly summary e-mails
  (the weekly one off by default), "@" suggestions and mention links, the
  daily sky thread by "Sorsfonalak", "Most itt vannak", joining restricted
  topics, and the moderators' Témák tab (requests; topics for the admin).
- Members-only topics say so to members too.
- The privacy notice (HU, EN) and point 8.1 of the terms cover own
  pictures, badges, mentions, restricted topics and the weekly summary;
  the data export and account deletion include them.

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 13:02:38 +00:00
co-authored by Claude Opus 5.5
parent 564c22176f
commit 8bc426460d
28 changed files with 1112 additions and 100 deletions
@@ -1,10 +1,20 @@
import Link from "next/link";
import { notFound } from "next/navigation";
import { type ModLogEntry, type ReportEntry, banText, memberHref, threadHref } from "@/lib/forum";
import {
type ForumTopic,
type ModLogEntry,
type ReportEntry,
type TopicRequest,
banText,
memberHref,
threadHref,
} from "@/lib/forum";
import { forumGet } from "@/lib/forumServer";
import { getMe } from "@/lib/server";
import { ReportsList } from "./ReportsList";
import { TopicsAdmin } from "./TopicsAdmin";
export const metadata = { title: "Moderálás", robots: { index: false } };
@@ -21,25 +31,35 @@ const ACTIONS: Record<string, string> = {
unpin: "levette a kitűzést",
resolve_report: "lezárt egy jelentést",
dismiss_report: "alaptalannak ítélt egy jelentést",
approve_member: "felvette egy zárt témába",
reject_member: "elutasította a jelentkezését",
remove_member: "eltávolította egy zárt témából",
reset_avatar: "eltávolította a saját képét",
topic: "témát kezelt",
};
type Props = { searchParams: Promise<{ nezet?: string }> };
/** Moderators: the open reports, and the log of every moderation step. */
export default async function ModerationPage({ searchParams }: Props) {
const log = (await searchParams).nezet === "naplo";
const view = (await searchParams).nezet;
const log = view === "naplo";
const topics = view === "temak";
return (
<div className="fh">
<h1 className="fpage-title">Moderálás</h1>
<nav className="fmod-tabs" aria-label="Moderálás">
<Link href="/forum/moderalas" aria-current={log ? undefined : "page"}>
<Link href="/forum/moderalas" aria-current={log || topics ? undefined : "page"}>
Jelentések
</Link>
<Link href="/forum/moderalas?nezet=temak" aria-current={topics ? "page" : undefined}>
Témák
</Link>
<Link href="/forum/moderalas?nezet=naplo" aria-current={log ? "page" : undefined}>
Napló
</Link>
</nav>
{log ? <LogView /> : <ReportsView />}
{log ? <LogView /> : topics ? <TopicsView /> : <ReportsView />}
</div>
);
}
@@ -50,6 +70,22 @@ async function ReportsView() {
return <ReportsList initial={res.data.reports} />;
}
async function TopicsView() {
const [requests, list, me] = await Promise.all([
forumGet<{ requests: TopicRequest[] }>("/v1/forum/mod/topic-requests"),
forumGet<{ topics: ForumTopic[] }>("/v1/forum/topics"),
getMe(),
]);
if (!requests.ok) notFound();
return (
<TopicsAdmin
requests={requests.data.requests}
topics={list.ok ? list.data.topics : []}
admin={me?.user.roles.includes("admin") ?? false}
/>
);
}
async function LogView() {
const res = await forumGet<{ entries: ModLogEntry[] }>("/v1/forum/mod/log");
if (!res.ok) notFound();