Coverage for src / lexigram / contracts / admin / page_content.py: 100%
15 statements
« prev ^ index » next coverage.py v7.13.5, created at 2026-08-19 05:41 +0800
« prev ^ index » next coverage.py v7.13.5, created at 2026-08-19 05:41 +0800
1"""Structured content for management pages contributed to the admin dashboard.
3Contributors return ``PageContent`` instead of raw HTML so the host owns all
4page markup. ``body`` reuses the ``WidgetContent`` union — the same renderer
5used for dashboard widgets renders page bodies.
6"""
8from __future__ import annotations
10from dataclasses import dataclass
12from lexigram.contracts.admin.widget_content import WidgetContent
15@dataclass(frozen=True)
16class PaginationContent:
17 """Pagination state for a structured management page."""
19 page: int
20 total: int
21 per_page: int
22 base_url: str
25@dataclass(frozen=True)
26class PageContent:
27 """A management page contributed as structured content — never raw HTML."""
29 title: str
30 body: WidgetContent
31 pagination: PaginationContent | None = None
34__all__ = ["PageContent", "PaginationContent"]