org.elements ============ .. py:module:: org.elements .. autoapi-nested-parse:: Contains small helper classes used as abstraction for various templating macros. Classes ------- .. autoapisummary:: org.elements.Link org.elements.QrCodeLink org.elements.DeleteLink org.elements.ConfirmLink Module Contents --------------- .. py:class:: Link(text: str, url: str, classes: collections.abc.Collection[str] | None = None, request_method: str = 'GET', attributes: dict[str, Any] | None = None, active: bool = False, model: Any | None = None, subtitle: str | None = None) Bases: :py:obj:`_Base` Represents a link rendered in a template. .. py:attribute:: __slots__ :value: ('active', 'attributes', 'classes', 'model', 'request_method', 'subtitle', 'text', 'url') .. py:attribute:: text :type: str .. py:attribute:: url .. py:attribute:: classes :value: None .. py:attribute:: request_method :value: 'GET' .. py:attribute:: attributes .. py:attribute:: active :value: False .. py:attribute:: model :value: None .. py:attribute:: subtitle :value: None .. py:method:: __eq__(other: object) -> bool .. py:method:: __call__(request: onegov.core.elements.ChameleonLayout | onegov.core.request.CoreRequest, extra_classes: collections.abc.Iterable[str] | None = None) -> markupsafe.Markup Renders the element. .. py:method:: __repr__() -> str .. py:class:: QrCodeLink(text: str, url: str, title: str | None = None, attrs: dict[str, Any] | None = None, traits: collections.abc.Iterable[onegov.core.elements.Trait] | onegov.core.elements.Trait = (), **props: Any) Bases: :py:obj:`onegov.core.elements.Link` Implements a qr code link that shows a modal with the QrCode. Thu url is sent to the qr endpoint url which generates the image and sends it back. .. py:attribute:: id :value: 'qr_code_link' .. py:attribute:: __slots__ :value: ('active', 'attributes', 'classes', 'text', 'url', 'title') .. py:attribute:: title :value: None .. py:method:: __repr__() -> str .. py:class:: DeleteLink(text: str, url: str, confirm: str, yes_button_text: str | None = None, no_button_text: str | None = None, extra_information: str | None = None, redirect_after: str | None = None, request_method: str = 'DELETE', classes: collections.abc.Collection[str] = ('confirm', 'delete-link'), target: str | None = None) Bases: :py:obj:`Link` Represents a link rendered in a template. .. py:class:: ConfirmLink(text: str, url: str, confirm: str, yes_button_text: str | None = None, no_button_text: str | None = None, extra_information: str | None = None, redirect_after: str | None = None, request_method: str = 'POST', classes: collections.abc.Collection[str] = ('confirm', )) Bases: :py:obj:`DeleteLink` Represents a link rendered in a template.