Skip to main content

Module report

Module report 

Source
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§

PageTypesUsageReport
Page-types usage — how many pages exist of each registered page type. Surfaces unused types + content distribution.
ReportColumn
One report column: a key into each row object, a header label, and a render kind.
ReportRegistration
Inventory registration — mirrors crate::admin::admin_page.
UnpublishedChangesReport
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 status is the editor’s chosen status, so a previously published page (published_at set) currently at status = draft has edits not yet re-published.
WorkflowYourPagesReport
Your pages in a workflow — pages the signed-in user submitted that are still in flight (in progress or sent back for changes).

Enums§

ColumnKind
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.