Translate the whole site to English: English routes with 301 redirects from the Dutch paths, English UI, docs, seeds and captions, one-time live content migration
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
# retoor <retoor@molodetz.nl>
|
||||
from molodetz.docs_api import account, admin, community, content
|
||||
from molodetz.docs_api import account, admin, content, join
|
||||
from molodetz.docs_api.registry import endpoint, field, substitute
|
||||
|
||||
|
||||
def ordered_groups():
|
||||
return [content.GROUP, community.GROUP, account.GROUP, admin.GROUP]
|
||||
return [content.GROUP, join.GROUP, account.GROUP, admin.GROUP]
|
||||
|
||||
|
||||
def all_endpoints():
|
||||
|
||||
@@ -4,26 +4,26 @@ from molodetz.docs_api.registry import endpoint, field
|
||||
GROUP = {
|
||||
"slug": "account",
|
||||
"title": "Account",
|
||||
"description": "Inloggen met sessies, API-sleutel, meldingen. Geen JWT, geen OAuth.",
|
||||
"description": "Session login, API key, notifications. No JWT, no OAuth.",
|
||||
"endpoints": [
|
||||
endpoint("GET", "/auth/login", "Inlogpagina", sample={"errors": [], "next": "/admin"}),
|
||||
endpoint("GET", "/auth/login", "Login page", sample={"errors": [], "next": "/admin"}),
|
||||
endpoint(
|
||||
"POST",
|
||||
"/auth/login",
|
||||
"Inloggen",
|
||||
"Zet een httponly sessiecookie (7 dagen, 30 met onthouden).",
|
||||
"Log in",
|
||||
"Sets an httponly session cookie (7 days, 30 with remember me).",
|
||||
fields=[field("username", required=True, example="{{username}}"), field("password", required=True, type="password"), field("remember", type="boolean")],
|
||||
sample={"ok": True, "redirect": "/admin", "data": None},
|
||||
interactive=False,
|
||||
),
|
||||
endpoint("POST", "/auth/logout", "Uitloggen", sample={"ok": True, "redirect": "/", "data": None}, interactive=False),
|
||||
endpoint("GET", "/profile/api-key", "API-sleutel bekijken", auth="member", sample={"api_key": "{{api_key}}"}),
|
||||
endpoint("POST", "/profile/api-key/regenerate", "API-sleutel vernieuwen", auth="member", destructive=True, sample={"ok": True, "redirect": "/profile/api-key", "data": {"api_key": "..."}}, interactive=False),
|
||||
endpoint("POST", "/profile/avatar/regenerate", "Avatar vernieuwen", auth="member", destructive=True, sample={"ok": True}, interactive=False),
|
||||
endpoint("GET", "/notifications", "Meldingen", auth="member", sample={"notifications": [], "unread": 0}),
|
||||
endpoint("POST", "/notifications/read", "Alles gelezen", auth="member", sample={"ok": True, "redirect": "/notifications"}),
|
||||
endpoint("GET", "/voorwaarden", "Voorwaarden", sample={"title": "Voorwaarden"}),
|
||||
endpoint("POST", "/voorwaarden/accept", "Voorwaarden accepteren", auth="member", sample={"ok": True, "redirect": "/"}),
|
||||
endpoint("POST", "/auth/logout", "Log out", sample={"ok": True, "redirect": "/", "data": None}, interactive=False),
|
||||
endpoint("GET", "/profile/api-key", "View API key", auth="member", sample={"api_key": "{{api_key}}"}),
|
||||
endpoint("POST", "/profile/api-key/regenerate", "Renew API key", auth="member", destructive=True, sample={"ok": True, "redirect": "/profile/api-key", "data": {"api_key": "..."}}, interactive=False),
|
||||
endpoint("POST", "/profile/avatar/regenerate", "Renew avatar", auth="member", destructive=True, sample={"ok": True}, interactive=False),
|
||||
endpoint("GET", "/notifications", "Notifications", auth="member", sample={"notifications": [], "unread": 0}),
|
||||
endpoint("POST", "/notifications/read", "Mark all read", auth="member", sample={"ok": True, "redirect": "/notifications"}),
|
||||
endpoint("GET", "/terms", "Terms", sample={"title": "Terms"}),
|
||||
endpoint("POST", "/terms/accept", "Accept terms", auth="member", sample={"ok": True, "redirect": "/"}),
|
||||
endpoint("GET", "/privacy", "Privacy", sample={"title": "Privacy"}),
|
||||
],
|
||||
}
|
||||
|
||||
+31
-31
@@ -2,51 +2,51 @@
|
||||
from molodetz.docs_api.registry import endpoint, field
|
||||
|
||||
GROUP = {
|
||||
"slug": "beheer",
|
||||
"title": "Beheer",
|
||||
"description": "Alleen voor beheerders. Berichten schrijven en publiceren, aanmeldingen, services, prullenbak, instellingen.",
|
||||
"slug": "admin",
|
||||
"title": "Admin",
|
||||
"description": "Administrators only. Writing and publishing posts, join requests, services, trash, settings.",
|
||||
"endpoints": [
|
||||
endpoint("GET", "/admin", "Overzicht", auth="admin", sample={"post_count": 5, "open_joins": 0, "user_count": 1, "deleted_count": 0}),
|
||||
endpoint("GET", "/admin/posts", "Berichten", auth="admin", sample={"posts": []}),
|
||||
endpoint("GET", "/admin/posts/new", "Nieuw bericht", auth="admin", sample={}),
|
||||
endpoint("GET", "/admin", "Overview", auth="admin", sample={"post_count": 5, "open_joins": 0, "user_count": 1, "deleted_count": 0}),
|
||||
endpoint("GET", "/admin/posts", "Posts", auth="admin", sample={"posts": []}),
|
||||
endpoint("GET", "/admin/posts/new", "New post", auth="admin", sample={}),
|
||||
endpoint(
|
||||
"POST",
|
||||
"/admin/posts",
|
||||
"Bericht aanmaken",
|
||||
"Markdown-bericht aanmaken; status draft of published.",
|
||||
"Post creation",
|
||||
"Adds a markdown post; status draft or published.",
|
||||
auth="admin",
|
||||
fields=[
|
||||
field("title", required=True, example="Een titel"),
|
||||
field("body", required=True, example="Tekst in **markdown**."),
|
||||
field("topic", enum=["rol", "standaard"], example="rol"),
|
||||
field("title", required=True, example="A title"),
|
||||
field("body", required=True, example="Text in **markdown**."),
|
||||
field("topic", enum=["roll", "standard"], example="roll"),
|
||||
field("status", enum=["draft", "published"], example="draft"),
|
||||
field("is_placeholder", type="boolean"),
|
||||
],
|
||||
sample={"ok": True, "redirect": "/admin/posts", "data": {"uid": "..."}},
|
||||
probe_body={"title": "x"},
|
||||
),
|
||||
endpoint("GET", "/admin/posts/{uid}/edit", "Bericht bewerken", auth="admin", fields=[field("uid", required=True, location="path")], probe_path="/admin/posts/onbekend/edit"),
|
||||
endpoint("POST", "/admin/posts/{uid}", "Bericht opslaan", auth="admin", fields=[field("uid", required=True, location="path")], probe_path="/admin/posts/onbekend", probe_body={"title": "x"}),
|
||||
endpoint("POST", "/admin/posts/{uid}/publish", "Publiceren", auth="admin", fields=[field("uid", required=True, location="path")], probe_path="/admin/posts/onbekend/publish"),
|
||||
endpoint("POST", "/admin/posts/{uid}/delete", "Bericht verwijderen", "Zachte verwijdering; herstel via prullenbak.", auth="admin", destructive=True, fields=[field("uid", required=True, location="path")], probe_path="/admin/posts/onbekend/delete"),
|
||||
endpoint("GET", "/admin/joins", "Aanmeldingen", auth="admin", sample={"requests": []}),
|
||||
endpoint("POST", "/admin/joins/{uid}/status", "Status aanmelding", auth="admin", fields=[field("uid", required=True, location="path"), field("status", enum=["open", "contacted", "accepted", "declined"])], probe_path="/admin/joins/onbekend/status", probe_body={"status": "open"}),
|
||||
endpoint("POST", "/admin/joins/{uid}/check", "Repo-link controleren", "Haalt de titel op via de beveiligde uitgaande client.", auth="admin", fields=[field("uid", required=True, location="path")], probe_path="/admin/joins/onbekend/check"),
|
||||
endpoint("GET", "/admin/posts/{uid}/edit", "Edit post", auth="admin", fields=[field("uid", required=True, location="path")], probe_path="/admin/posts/unknown/edit"),
|
||||
endpoint("POST", "/admin/posts/{uid}", "Save post", auth="admin", fields=[field("uid", required=True, location="path")], probe_path="/admin/posts/unknown", probe_body={"title": "x"}),
|
||||
endpoint("POST", "/admin/posts/{uid}/publish", "Publish", auth="admin", fields=[field("uid", required=True, location="path")], probe_path="/admin/posts/unknown/publish"),
|
||||
endpoint("POST", "/admin/posts/{uid}/delete", "Post removal", "Soft delete; restore from the trash.", auth="admin", destructive=True, fields=[field("uid", required=True, location="path")], probe_path="/admin/posts/unknown/delete"),
|
||||
endpoint("GET", "/admin/joins", "Join requests", auth="admin", sample={"requests": []}),
|
||||
endpoint("POST", "/admin/joins/{uid}/status", "Join request status", auth="admin", fields=[field("uid", required=True, location="path"), field("status", enum=["open", "contacted", "accepted", "declined"])], probe_path="/admin/joins/unknown/status", probe_body={"status": "open"}),
|
||||
endpoint("POST", "/admin/joins/{uid}/check", "Check repo link", "Fetches the title through the guarded outbound client.", auth="admin", fields=[field("uid", required=True, location="path")], probe_path="/admin/joins/unknown/check"),
|
||||
endpoint("GET", "/admin/services", "Services", auth="admin", sample={"services": []}),
|
||||
endpoint("GET", "/admin/services/{name}", "Service", auth="admin", fields=[field("name", required=True, location="path", example="backup")], probe_path="/admin/services/backup"),
|
||||
endpoint("POST", "/admin/services/{name}/command", "Service-commando", auth="admin", fields=[field("name", required=True, location="path"), field("verb", enum=["start", "stop", "run", "clear"])], probe_path="/admin/services/backup/command", probe_body={"verb": "noop"}),
|
||||
endpoint("POST", "/admin/services/{name}/config", "Service-configuratie", auth="admin", fields=[field("name", required=True, location="path")], probe_path="/admin/services/backup/config", probe_body={}),
|
||||
endpoint("GET", "/admin/trash", "Prullenbak", auth="admin", sample={"items": []}),
|
||||
endpoint("POST", "/admin/trash/restore", "Herstellen", auth="admin", fields=[field("stamp", required=True)], probe_body={"stamp": "none"}),
|
||||
endpoint("POST", "/admin/trash/purge", "Definitief verwijderen", auth="admin", destructive=True, fields=[field("stamp", required=True)], probe_body={"stamp": "none"}),
|
||||
endpoint("GET", "/admin/settings", "Instellingen", auth="admin", sample={"settings": {}}),
|
||||
endpoint("POST", "/admin/settings", "Instellingen opslaan", auth="admin", probe_body={}),
|
||||
endpoint("POST", "/admin/services/{name}/command", "Service command", auth="admin", fields=[field("name", required=True, location="path"), field("verb", enum=["start", "stop", "run", "clear"])], probe_path="/admin/services/backup/command", probe_body={"verb": "noop"}),
|
||||
endpoint("POST", "/admin/services/{name}/config", "Service configuration", auth="admin", fields=[field("name", required=True, location="path")], probe_path="/admin/services/backup/config", probe_body={}),
|
||||
endpoint("GET", "/admin/trash", "Trash", auth="admin", sample={"items": []}),
|
||||
endpoint("POST", "/admin/trash/restore", "Restore", auth="admin", fields=[field("stamp", required=True)], probe_body={"stamp": "none"}),
|
||||
endpoint("POST", "/admin/trash/purge", "Permanent purge", auth="admin", destructive=True, fields=[field("stamp", required=True)], probe_body={"stamp": "none"}),
|
||||
endpoint("GET", "/admin/settings", "Settings", auth="admin", sample={"settings": {}}),
|
||||
endpoint("POST", "/admin/settings", "Save settings", auth="admin", probe_body={}),
|
||||
endpoint("GET", "/admin/users", "Accounts", auth="admin", sample={"users": []}),
|
||||
endpoint("POST", "/admin/users/{uid}/role", "Rol wijzigen", auth="admin", fields=[field("uid", required=True, location="path"), field("role", enum=["Admin", "Member"])], probe_path="/admin/users/onbekend/role", probe_body={"role": "Member"}),
|
||||
endpoint("GET", "/admin/audit", "Auditlog", auth="admin", sample={"rows": []}),
|
||||
endpoint("GET", "/admin/backups", "Back-ups", auth="admin", sample={"backups": []}),
|
||||
endpoint("POST", "/admin/backups", "Back-up inplannen", auth="admin", fields=[field("target", enum=["database", "uploads", "keys", "full"])], probe_body={"target": "nope"}),
|
||||
endpoint("GET", "/admin/backups/{uid}/download", "Back-up downloaden", "Alleen de primaire beheerder.", auth="admin", negotiation="none", interactive=False, probe_path="/admin/backups/onbekend/download"),
|
||||
endpoint("GET", "/admin/stats", "Statistieken", auth="admin", sample={"top_paths": [], "daily": []}),
|
||||
endpoint("POST", "/admin/users/{uid}/role", "Change role", auth="admin", fields=[field("uid", required=True, location="path"), field("role", enum=["Admin", "Member"])], probe_path="/admin/users/unknown/role", probe_body={"role": "Member"}),
|
||||
endpoint("GET", "/admin/audit", "Audit log", auth="admin", sample={"rows": []}),
|
||||
endpoint("GET", "/admin/backups", "Backups", auth="admin", sample={"backups": []}),
|
||||
endpoint("POST", "/admin/backups", "Schedule backup", auth="admin", fields=[field("target", enum=["database", "uploads", "keys", "full"])], probe_body={"target": "nope"}),
|
||||
endpoint("GET", "/admin/backups/{uid}/download", "Download backup", "Primary administrator only.", auth="admin", negotiation="none", interactive=False, probe_path="/admin/backups/unknown/download"),
|
||||
endpoint("GET", "/admin/stats", "Statistics", auth="admin", sample={"top_paths": [], "daily": []}),
|
||||
],
|
||||
}
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
# retoor <retoor@molodetz.nl>
|
||||
from molodetz.docs_api.registry import endpoint, field
|
||||
|
||||
GROUP = {
|
||||
"slug": "binnen",
|
||||
"title": "Binnen",
|
||||
"description": "Aanmelden om mee te schrijven. Opgeslagen voor beheerders, nergens publiek.",
|
||||
"endpoints": [
|
||||
endpoint("GET", "/binnen", "Aanmeldformulier", sample={"submitted": False}),
|
||||
endpoint(
|
||||
"POST",
|
||||
"/binnen",
|
||||
"Ik schrijf mee",
|
||||
"Slaat een aanmelding op: naam, contact en optioneel een repo-link.",
|
||||
fields=[
|
||||
field("name", required=True, example="Ada"),
|
||||
field("contact", required=True, example="ada@example.nl"),
|
||||
field("repo_url", example="https://git.example.nl/ada"),
|
||||
field("message", example="Ik schrijf over afmaken."),
|
||||
],
|
||||
sample={"ok": True, "redirect": "/binnen?ok=1", "data": {"uid": "0190..."}},
|
||||
probe_body={"name": "Probe", "contact": "probe@example.nl"},
|
||||
),
|
||||
],
|
||||
}
|
||||
@@ -2,45 +2,45 @@
|
||||
from molodetz.docs_api.registry import endpoint, field
|
||||
|
||||
GROUP = {
|
||||
"slug": "inhoud",
|
||||
"title": "Inhoud",
|
||||
"description": "Publieke leesroutes: de rol, de standaard, berichten, galerijen en mensen.",
|
||||
"slug": "content",
|
||||
"title": "Content",
|
||||
"description": "Public read routes: the roll, the standard, posts, galleries and people.",
|
||||
"endpoints": [
|
||||
endpoint("GET", "/", "Voorpagina", "Laatste berichten en uitgelichte flyer.", sample={"posts": [], "flyer_count": 4, "meme_count": 20}),
|
||||
endpoint("GET", "/", "Home", "Latest posts and the featured flyer.", sample={"posts": [], "flyer_count": 4, "meme_count": 20}),
|
||||
endpoint(
|
||||
"GET",
|
||||
"/rol",
|
||||
"De rol",
|
||||
"Gepubliceerde notities in het onderwerp rol, nieuwste eerst, cursor-gepagineerd.",
|
||||
fields=[field("before", description="Cursor uit next_cursor", location="query")],
|
||||
sample={"title": "Rol", "topic": "rol", "posts": [], "next_cursor": None},
|
||||
"/roll",
|
||||
"The roll",
|
||||
"Published notes in the roll topic, newest first, cursor paginated.",
|
||||
fields=[field("before", description="Cursor from next_cursor", location="query")],
|
||||
sample={"title": "Roll", "topic": "roll", "posts": [], "next_cursor": None},
|
||||
),
|
||||
endpoint("GET", "/standaard", "De standaard", "Gepubliceerde berichten in het onderwerp standaard.", sample={"title": "Standaard", "topic": "standaard", "posts": []}),
|
||||
endpoint("GET", "/standard", "The standard", "Published posts in the standard topic.", sample={"title": "Standard", "topic": "standard", "posts": []}),
|
||||
endpoint(
|
||||
"GET",
|
||||
"/posts/{slug}",
|
||||
"Bericht",
|
||||
"Een gepubliceerd bericht via slug of uid.",
|
||||
fields=[field("slug", required=True, location="path", example="een-zes-is-geen-ambitie")],
|
||||
sample={"post": {"title": "Een zes is geen ambitie.", "topic": "rol"}, "author": {"username": "retoor"}},
|
||||
probe_path="/posts/bestaat-niet",
|
||||
"Post",
|
||||
"A published post by slug or uid. Old slugs redirect with 301 to the canonical slug.",
|
||||
fields=[field("slug", required=True, location="path", example="a-pass-is-not-an-ambition")],
|
||||
sample={"post": {"title": "A pass is not an ambition.", "topic": "roll"}, "author": {"username": "retoor"}},
|
||||
probe_path="/posts/does-not-exist",
|
||||
),
|
||||
endpoint("GET", "/flyers", "Flyers", "Galerij met flyers.", sample={"kind": "flyer", "title": "Flyers", "items": []}),
|
||||
endpoint("GET", "/memes", "Memes", "Galerij met memes.", sample={"kind": "meme", "title": "Memes", "items": []}),
|
||||
endpoint("GET", "/mensen", "Mensen", "Mensen op de rol.", sample={"people": [{"username": "retoor", "post_count": 5}]}),
|
||||
endpoint("GET", "/flyers", "Flyers", "Flyer gallery.", sample={"kind": "flyer", "title": "Flyers", "items": []}),
|
||||
endpoint("GET", "/memes", "Memes", "Meme gallery.", sample={"kind": "meme", "title": "Memes", "items": []}),
|
||||
endpoint("GET", "/people", "People", "People on the roll.", sample={"people": [{"username": "retoor", "post_count": 5}]}),
|
||||
endpoint(
|
||||
"GET",
|
||||
"/mensen/{username}",
|
||||
"Persoon",
|
||||
"Profiel met berichten.",
|
||||
"/people/{username}",
|
||||
"Person",
|
||||
"Profile with posts.",
|
||||
fields=[field("username", required=True, location="path", example="retoor")],
|
||||
sample={"person": {"username": "retoor"}, "posts": []},
|
||||
probe_path="/mensen/retoor",
|
||||
probe_path="/people/retoor",
|
||||
),
|
||||
endpoint("GET", "/robots.txt", "robots.txt", negotiation="none", interactive=False),
|
||||
endpoint("GET", "/sitemap.xml", "Sitemap", negotiation="none", interactive=False),
|
||||
endpoint("GET", "/avatar/svg/{seed}", "Avatar", "Deterministische SVG-avatar.", negotiation="none", interactive=False, probe_path="/avatar/svg/retoor"),
|
||||
endpoint("GET", "/health", "Health", "Liveness en versie.", negotiation="json", sample={"status": "ok", "version": "1.0.0"}),
|
||||
endpoint("GET", "/presence/roster", "Presence", "Online-set (uids).", negotiation="json", sample={"online": [], "tracked": 0}),
|
||||
endpoint("GET", "/avatar/svg/{seed}", "Avatar", "Deterministic SVG avatar.", negotiation="none", interactive=False, probe_path="/avatar/svg/retoor"),
|
||||
endpoint("GET", "/health", "Health", "Liveness and version.", negotiation="json", sample={"status": "ok", "version": "1.0.0"}),
|
||||
endpoint("GET", "/presence/roster", "Presence", "Online set (uids).", negotiation="json", sample={"online": [], "tracked": 0}),
|
||||
],
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
# retoor <retoor@molodetz.nl>
|
||||
from molodetz.docs_api.registry import endpoint, field
|
||||
|
||||
GROUP = {
|
||||
"slug": "join",
|
||||
"title": "Join",
|
||||
"description": "Sign up to write along. Stored for administrators, never public.",
|
||||
"endpoints": [
|
||||
endpoint("GET", "/join", "Join form", sample={"submitted": False}),
|
||||
endpoint(
|
||||
"POST",
|
||||
"/join",
|
||||
"I'm in",
|
||||
"Stores a join request: name, contact and an optional repo link.",
|
||||
fields=[
|
||||
field("name", required=True, example="Ada"),
|
||||
field("contact", required=True, example="ada@example.com"),
|
||||
field("repo_url", example="https://git.example.com/ada"),
|
||||
field("message", example="I write about finishing things."),
|
||||
],
|
||||
sample={"ok": True, "redirect": "/join?ok=1", "data": {"uid": "0190..."}},
|
||||
probe_body={"name": "Probe", "contact": "probe@example.com"},
|
||||
),
|
||||
],
|
||||
}
|
||||
Reference in New Issue
Block a user