diff --git a/messages/de.json b/messages/de.json index f8bf6c3..7ebd62e 100644 --- a/messages/de.json +++ b/messages/de.json @@ -274,7 +274,8 @@ "manage": "Verwalten", "postTypes": "Beitragsarten", "api": "API", - "settings": "Einstellungen" + "settings": "Einstellungen", + "guide": "Anleitung" }, "messages": { "created": "Angelegt.", @@ -635,9 +636,9 @@ "back": "Zurück zur Liste", "saving": "Wird gespeichert", "emptyTitle": "Noch kein Konto", - "empty": "Es gibt noch kein Konto. Leg eins mit dem Befehl pnpm admin:create an.", + "empty": "Es gibt noch kein Konto. Sobald sich jemand zum ersten Mal anmeldet, erscheint er hier.", "newAccountTitle": "Neues Konto", - "newAccount": "Konten entstehen über den Befehl pnpm admin:create. Danach vergibst du hier die Rechte.", + "newAccount": "Konten entstehen bei der ersten Anmeldung. Wer eine Adresse auf einer erlaubten Domain hat, holt sich unter Anmelden selbst einen Link per E-Mail. Danach vergibst du hier die Rechte.", "adminSection": "Verwaltungsrecht", "isAdmin": "Dieses Konto verwaltet alles und hat Zugriff auf jedes Projekt.", "isNotAdmin": "Dieses Konto arbeitet nur in den Projekten, für die es freigeschaltet ist.", @@ -779,7 +780,16 @@ "neverSent": "Noch nichts verschickt. Der erste Bericht umfasst die letzten sieben Tage.", "resetWindow": "Zeitraum zurücksetzen", "resetting": "Wird zurückgesetzt" - } + }, + "guide": { + "eyebrow": "Verwaltung", + "title": "Anleitung", + "intro": "Wofür Logbuch da ist, wie ein Eintrag aufgebaut ist und wie er klingen soll. Derselbe Text, den auch ein KI-Zugang über die Schnittstelle liest.", + "missing": "Der Leitfaden ist nicht auffindbar." + }, + "welcomeTitle": "Worum es hier geht", + "welcome": "Logbuch hält fest, was in den Produkten passiert ist. Ein Eintrag sagt in ganzen Sätzen, was sich geändert hat und was der Leser davon hat, ohne Ticketnummern und ohne Fachjargon. Geschrieben wird pro Projekt, veröffentlicht wird von Hand.", + "welcomeAction": "Anleitung lesen" }, "filter": { "type": "Art", diff --git a/messages/en.json b/messages/en.json index 7e8a064..8b67cb9 100644 --- a/messages/en.json +++ b/messages/en.json @@ -274,7 +274,8 @@ "manage": "Manage", "postTypes": "Post types", "api": "API", - "settings": "Settings" + "settings": "Settings", + "guide": "Guide" }, "messages": { "created": "Created.", @@ -635,9 +636,9 @@ "back": "Back to the list", "saving": "Saving", "emptyTitle": "No account yet", - "empty": "There is no account yet. Create one with the command pnpm admin:create.", + "empty": "No account yet. As soon as someone signs in for the first time, they show up here.", "newAccountTitle": "New account", - "newAccount": "Accounts are created with the command pnpm admin:create. After that you hand out the rights here.", + "newAccount": "Accounts appear on the first sign in. Anyone with an address on an allowed domain requests a link themselves. You grant the rights here afterwards.", "adminSection": "Administration right", "isAdmin": "This account administers everything and reaches every project.", "isNotAdmin": "This account works only in the projects it has been released for.", @@ -779,7 +780,16 @@ "neverSent": "Nothing sent yet. The first digest covers the last seven days.", "resetWindow": "Reset the window", "resetting": "Resetting" - } + }, + "guide": { + "eyebrow": "Administration", + "title": "Guide", + "intro": "What Logbuch is for, how an entry is built and how it should sound. The same text an API client reads.", + "missing": "The guide could not be found." + }, + "welcomeTitle": "What this is for", + "welcome": "Logbuch records what happened in the products. An entry says in plain sentences what changed and what the reader gets from it, without ticket numbers or jargon. Writing happens per project, publishing by hand.", + "welcomeAction": "Read the guide" }, "filter": { "type": "Type", diff --git a/next.config.ts b/next.config.ts index 03585df..e09c052 100644 --- a/next.config.ts +++ b/next.config.ts @@ -14,6 +14,7 @@ const config: NextConfig = { '/api/v1/skill': ['./docs/skill.md'], '/admin/api/files/skill': ['./docs/skill.md'], '/admin/api/files/style-guide': ['./docs/style-guide.md'], + '/admin/guide': ['./docs/style-guide.md'], '/': ['./node_modules/drizzle-orm/**'], '/api/v1/media': sharpNative, '/admin/media': sharpNative, diff --git a/src/app/admin/guide/page.tsx b/src/app/admin/guide/page.tsx new file mode 100644 index 0000000..95be9ec --- /dev/null +++ b/src/app/admin/guide/page.tsx @@ -0,0 +1,45 @@ +import type { Metadata } from 'next' +import Markdown from 'react-markdown' +import remarkGfm from 'remark-gfm' +import { getTranslations } from 'next-intl/server' +import { AdminHeading } from '~/components/admin/AdminHeading' +import { AdminNotice } from '~/components/admin/AdminNotice' +import { readStyleGuide } from '~/lib/api-docs' +import { requireAdminArea } from '~/lib/auth-guards' + +export async function generateMetadata(): Promise { + const app = await getTranslations('app') + const t = await getTranslations('admin.guide') + + return { title: `${t('title')} - ${app('name')}` } +} + +export default async function AdminGuidePage() { + await requireAdminArea() + + const t = await getTranslations('admin.guide') + const text = await readStyleGuide() + + return ( +
+ + + {text === null ? ( + {t('missing')} + ) : ( +
+ null, + h2: props =>

, + a: props => , + }} + > + {text} + +

+ )} +
+ ) +} diff --git a/src/app/admin/page.tsx b/src/app/admin/page.tsx index 59539bf..58c5fe7 100644 --- a/src/app/admin/page.tsx +++ b/src/app/admin/page.tsx @@ -19,6 +19,7 @@ import { adminNewEntryPath, adminEntriesPath, adminEntryPath, + adminGuidePath, adminNewProjectPath, adminProjectEntriesPath, adminProjectPath, @@ -92,6 +93,12 @@ export default async function AdminPage() { } /> + {t('welcomeAction')} + }> + {t('welcome')} + + {tiles.length > 0 ? (