Forum: founders are the first fifteen; the admin can take or give the badge

The site has few members yet, some of them test accounts: the badge goes to
the first fifteen, and the admin can take it from a test account on its
profile (the place goes to the next newcomer) or give it.

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 15:46:44 +00:00
co-authored by Claude Opus 5.5
parent 8fc550662e
commit 493539bf56
10 changed files with 106 additions and 11 deletions
@@ -152,7 +152,7 @@ export default async function PrivacyPage() {
Fórumprofilod: az álneved (a korábbiakat 90 napig, hogy más ne vehesse fel), az avatarod vagy a
feltöltött saját képed (kicsinyítve, a kép rejtett adatai, például a helyszín nélkül), a
bemutatkozásod, a képletedből megosztott jegyek, hogy önkéntes kísérő vagy-e, a Támogató
jelvény (ha bekapcsolod, mások látják, hogy vásároltál), hogy az első száz tag közé tartozol-e
jelvény (ha bekapcsolod, mások látják, hogy vásároltál), hogy az első tizenöt tag közé tartozol-e
(Alapító tag), a láthatatlan mód és az e-mail-értesítések beállítása
</td>
<td>Részvétel a fórumon; a jegyek megosztása és a jelvények a saját döntésed</td>
@@ -0,0 +1,49 @@
"use client";
import { useRouter } from "next/navigation";
import { useState } from "react";
import { api, errorText } from "@/lib/api";
/** The admin's switch for the "Alapító tag" badge (e.g. off for a test account; the place goes to the next newcomer). */
export function FounderToggle({ nickname, founder }: { nickname: string; founder: boolean }) {
const router = useRouter();
const [busy, setBusy] = useState(false);
const [error, setError] = useState<string | null>(null);
return (
<div className="fmute">
<button
type="button"
className="btn btn-sm btn-ghost"
disabled={busy}
onClick={async () => {
if (
founder &&
!window.confirm(`Elveszed ${nickname} Alapító tag jelvényét? A helyét a következő új tag kapja.`)
)
return;
setBusy(true);
setError(null);
try {
await api(`/forum/members/${encodeURIComponent(nickname)}/founder`, {
method: "PUT",
body: { founder: !founder },
});
router.refresh();
} catch (e) {
setError(errorText(e));
} finally {
setBusy(false);
}
}}
>
{founder ? "Alapító tag jelvény elvétele" : "Alapító tag jelvény megadása"}
</button>
{error && (
<p className="msg msg-error" role="alert">
{error}
</p>
)}
</div>
);
}
@@ -8,8 +8,10 @@ import { Badge, RankBadge } from "@/components/forum/Badges";
import { PostBody } from "@/components/forum/PostBody";
import { type MemberProfile, ago, banText, threadHref } from "@/lib/forum";
import { forumGet } from "@/lib/forumServer";
import { getMe } from "@/lib/server";
import { BanPanel } from "./BanPanel";
import { FounderToggle } from "./FounderToggle";
import { MuteButton } from "./MuteButton";
import { RequestPanel } from "./RequestPanel";
@@ -37,6 +39,7 @@ export default async function MemberPage({ params }: Props) {
if (!res.ok) notFound();
const { member, recent, viewer } = res.data;
const a = member.author;
const admin = viewer.logged_in ? ((await getMe())?.user.roles.includes("admin") ?? false) : false;
const signs = signsText(a.signs);
const since = new Date(member.created_at).toLocaleDateString("hu-HU", { year: "numeric", month: "long" });
return (
@@ -73,6 +76,7 @@ export default async function MemberPage({ params }: Props) {
</Link>
)}
{viewer.member && !member.own && <MuteButton nickname={a.nickname} muted={member.muted} />}
{admin && <FounderToggle nickname={a.nickname} founder={a.founder ?? false} />}
{viewer.moderator && !member.own && !a.moderator && (
<BanPanel
nickname={a.nickname}
+1 -1
View File
@@ -85,7 +85,7 @@ const DATA: [string, string, string][] = [
"Legitimate interest (Art. 6(1)(f))",
],
[
"Your forum profile: your nickname (earlier ones for 90 days, so nobody else can take them), your avatar or the picture you uploaded (made smaller, without its hidden data such as the location), introduction, the signs of your chart you share, whether you are a volunteer companion (Kísérő), the Támogató (supporter) badge (if you switch it on, others see that you bought something), whether you were among the first hundred members (Alapító tag – founder), the invisible mode and your e-mail notification settings",
"Your forum profile: your nickname (earlier ones for 90 days, so nobody else can take them), your avatar or the picture you uploaded (made smaller, without its hidden data such as the location), introduction, the signs of your chart you share, whether you are a volunteer companion (Kísérő), the Támogató (supporter) badge (if you switch it on, others see that you bought something), whether you were among the first fifteen members (Alapító tag – founder), the invisible mode and your e-mail notification settings",
"Taking part in the forum; sharing the signs and the badges is your choice",
"Performance of the contract",
],
@@ -60,7 +60,7 @@ const BADGES: Record<BadgeKind, { label: string; title: string; icon: React.Reac
// A sprout: there from the beginning.
founder: {
label: "Alapító tag",
title: "A fórum első száz tagja közül való",
title: "A fórum első tizenöt tagja közül való",
icon: (
<>
<path d="M12 20.5V11" />