org.models.dashboard ==================== .. py:module:: org.models.dashboard Classes ------- .. autoapisummary:: org.models.dashboard.Dashboard org.models.dashboard.CitizenDashboard org.models.dashboard.Boardlet org.models.dashboard.BoardletFact Module Contents --------------- .. py:class:: Dashboard(request: onegov.org.request.OrgRequest) .. py:attribute:: kind :type: ClassVar[Literal['user', 'citizen']] :value: 'user' .. py:attribute:: request .. py:property:: boardlet_configs :type: dict[str, onegov.org.directives.BoardletConfig] The appropriate set of `BoardletConfig` for our kind. .. py:property:: is_available :type: bool True if there are `Boardlet`s to display. .. py:method:: boardlets() -> list[tuple[Boardlet, ...]] Returns the boardlets, grouped/ordered by their order tuple. .. py:class:: CitizenDashboard(request: onegov.org.request.OrgRequest) Bases: :py:obj:`Dashboard` .. py:attribute:: kind :value: 'citizen' .. py:class:: Boardlet(name: str, order: tuple[int, int], icon: str, request: onegov.org.request.OrgRequest) Base class used by all boardlets. Use as follows:: from onegov.app import App @App.boardlet(name='foo', order=(1, 1), icon='') class MyBoardlet(Boardlet): pass .. py:attribute:: name .. py:attribute:: order .. py:attribute:: icon .. py:attribute:: request .. py:property:: title :type: str :abstractmethod: The title of the boardlet — typically the most important metric. .. py:property:: url :type: str | None A URL the title of the boardlet should link to. .. py:property:: facts :type: collections.abc.Iterator[BoardletFact] :abstractmethod: Facts as :class:`BoardletFact` instances. .. py:property:: is_available :type: bool True if the boardlet is active/has data. .. py:property:: state :type: Literal['success', 'warning', 'failure'] One of three states: * 'success' * 'warning' * 'failure' .. py:class:: BoardletFact A single boardlet fact. .. py:attribute:: text :type: str .. py:attribute:: number :type: int | float | str | None :value: None .. py:attribute:: link :type: tuple[str, str] | None :value: None .. py:attribute:: icon :type: str | None :value: None .. py:attribute:: visibility_icon :type: str | None :value: None .. py:attribute:: icon_title :type: str | None :value: None .. py:attribute:: css_class :type: str | None :value: None