Revert "Add missing admin action files and navigation links"

This reverts commit 41be6835bf.
This commit is contained in:
Simo committed 2026-07-11 20:37:56 +02:00
1 parent 4a1e1115b3
commit 4d515bc400
338 files changed
+5949 -28144

No files matched your search

+5 -1
View File
@@ -8,7 +8,11 @@ import { postThread } from "@/actions/social";
export const dynamic = "force-dynamic";
export default async function NewThreadPage({ params }: { params: Promise<{ id: string }> }) {
export default async function NewThreadPage({
params,
}: {
params: Promise<{ id: string }>;
}) {
const t = await getTranslations("pages.guildForumNew");
const { id } = await params;
const guildId = Number(id);
+18 -4
View File
@@ -22,7 +22,11 @@ function formatTimestamp(ts: number | null | undefined): string {
return new Date(ts * 1000).toISOString().slice(0, 10);
}
export default async function GuildForumPage({ params }: { params: Promise<{ id: string }> }) {
export default async function GuildForumPage({
params,
}: {
params: Promise<{ id: string }>;
}) {
const t = await getTranslations("pages.guildForum");
const { id } = await params;
const guildId = Number(id);
@@ -65,7 +69,13 @@ export default async function GuildForumPage({ params }: { params: Promise<{ id:
// Resolve opener usernames in one query (no relation exists in the schema, so
// join the users table manually by id). Falls back to the raw author id.
const openerIds = Array.from(new Set(threads.map((t) => t.openerId ?? 0).filter((v) => v > 0)));
const openerIds = Array.from(
new Set(
threads
.map((t) => t.openerId ?? 0)
.filter((v) => v > 0),
),
);
let users: { id: number; username: string }[] = [];
try {
@@ -118,7 +128,9 @@ export default async function GuildForumPage({ params }: { params: Promise<{ id:
return (
<tr key={t2.id}>
<td style={{ padding: "0.6rem 0.75rem" }}>
<span style={{ fontWeight: 700 }}>{t2.subject?.trim() || t("noSubject")}</span>
<span style={{ fontWeight: 700 }}>
{t2.subject?.trim() || t("noSubject")}
</span>
{t2.pinned ? (
<span className="online-badge online" style={{ marginLeft: "0.5rem" }}>
📌 {t("pinned")}
@@ -139,7 +151,9 @@ export default async function GuildForumPage({ params }: { params: Promise<{ id:
</span>
)}
</td>
<td style={{ padding: "0.6rem 0.75rem" }}>{t2.postsCount ?? 0}</td>
<td style={{ padding: "0.6rem 0.75rem" }}>
{t2.postsCount ?? 0}
</td>
<td className="muted" style={{ padding: "0.6rem 0.75rem" }}>
{formatTimestamp(t2.createdAt)}
</td>
+9 -2
View File
@@ -31,7 +31,11 @@ function formatTimestamp(ts: number): string {
return new Date(ts * 1000).toISOString().slice(0, 10);
}
export default async function GuildPage({ params }: { params: Promise<{ id: string }> }) {
export default async function GuildPage({
params,
}: {
params: Promise<{ id: string }>;
}) {
const t = await getTranslations("pages.guild");
const { id } = await params;
const guildId = Number(id);
@@ -193,7 +197,10 @@ export default async function GuildPage({ params }: { params: Promise<{ id: stri
<Link href={`/u/${m.username}`}>{m.username}</Link>
</h3>
{m.isOwner ? (
<span className="online-badge online" style={{ marginBottom: "0.25rem" }}>
<span
className="online-badge online"
style={{ marginBottom: "0.25rem" }}
>
👑 {t("owner")}
</span>
) : null}
+8 -2
View File
@@ -34,7 +34,11 @@ export default async function GuildsPage() {
return (
<main style={{ display: "grid", gap: "1.5rem" }}>
<ContentCard icon="🚪" title={t("title")} subtitle={t("subtitle")} />
<ContentCard
icon="🚪"
title={t("title")}
subtitle={t("subtitle")}
/>
<ContentCard padded={guilds.length === 0}>
{guilds.length === 0 ? (
@@ -65,7 +69,9 @@ export default async function GuildsPage() {
/>
) : null}
<div style={{ minWidth: 0 }}>
<h3 style={{ margin: "0 0 0.25rem", fontSize: "1rem" }}>{g.name || t("unnamedGuild")}</h3>
<h3 style={{ margin: "0 0 0.25rem", fontSize: "1rem" }}>
{g.name || t("unnamedGuild")}
</h3>
<p className="muted" style={{ margin: 0 }}>
{g.description ? excerpt(g.description, 120) : t("noDescription")}
</p>