Expand description
Extensible report framework — a registerable Report trait
- the three reports the hardcoded set was missing: page-types usage, unpublished changes, and your pages in a workflow.
A report is a slug, a title, a set of typed columns, and an async
rows() that returns one JSON object per row (keyed by column key,
plus an optional edit_url the table links the first cell to). The
admin serves every registered report through one chrome’d dispatcher
at /cms-admin/report/<slug> (+ a .csv export), and _base.html
lists them under the Reports sidebar group via the registry — so a
host adds a report with register_report! and it appears in the
nav with no routing or template work.
The seven pre-existing reports (aging / locked / scheduled / workflow / revisions / search / media-unused) keep their bespoke handlers for now — they carry extra UI (pagination, prune + edit actions, bulk delete) beyond a plain table; migrating them onto this framework is follow-up cleanup, not a prerequisite.
Structs§
- Page
Types Usage Report - Page-types usage — how many pages exist of each registered page type. Surfaces unused types + content distribution.
- Report
Column - One report column: a
keyinto each row object, a headerlabel, and a renderkind. - Report
Registration - Inventory registration — mirrors
crate::admin::admin_page. - Unpublished
Changes Report - Unpublished changes — pages that were published once but now sit
in draft (the editor saved a draft of a live page). In this CMS the
page row’s
statusis the editor’s chosen status, so a previously published page (published_atset) currently atstatus = drafthas edits not yet re-published. - Workflow
Your Pages Report - Your pages in a workflow — pages the signed-in user submitted that are still in flight (in progress or sent back for changes).
Enums§
- Column
Kind - How a column’s cell renders in the shared report table.
Traits§
- Report
- A registerable admin report. Implementors are zero-field structs
registered with
register_report!.
Functions§
- find_
report - The report registered under
slug, if any. - registered_
reports - Every registered report, sorted by title.