Skip to main content

Module render

Module render 

Source
Expand description

The markup contract (ADR 0010, docs/UI.md). Every element carries a cf-* class and, where it maps to the surface, a data-cf-* attribute. No shadow DOM, no inline styles, no ids except the ones that tie a <label> to its control. Changing a class name here is a breaking change of the UI contract; the snapshot test guards it.

Structs§

FormSpec
What a form needs to render, independent of where it came from.
PageSpec
What a full page needs around a fragment.
TableRow
One row of a table: cells in column order, plus the per-row forms (a delete button whose confirm step is a normal post).

Constants§

TURNSTILE_ORIGIN
Cloudflare Turnstile’s script and iframe origin, allowed by the page CSP only when a captcha widget is rendered.
TURNSTILE_SCRIPT
Turnstile’s loader. Shared with auth-core’s hosted pages so both render the same script, from the same origin the CSP allows.

Functions§

admin_index
The admin index: per module, its tables and its form actions.
confirm
The confirm step of a destructive row action: the same hidden fields plus confirm=1, and a way back.
form
The form fragment.
notice
A notice: the outcome of a successful action, or a landing page.
page
Wraps a fragment in the page shell. Scripts: none of ours; Turnstile’s only when a captcha widget is on the page.
raw
Raw markup from a trusted source (the base stylesheet, the embed script), for the tests that snapshot them.
status
A Json outcome rendered as a definition list, one row per top-level key. Nested values are shown as JSON text.
table
An admin Table view.