gazette.layout

Module Contents

Classes

Layout

Extends the base layout class with methods related to chameleon

MailLayout

A special layout for creating HTML E-Mails.

Attributes

NestedMenu

gazette.layout.NestedMenu: typing_extensions.TypeAlias[source]
class gazette.layout.Layout(model: Any, request: onegov.gazette.request.GazetteRequest)[source]

Bases: onegov.core.layout.ChameleonLayout

Extends the base layout class with methods related to chameleon template rendering.

This class assumes the existance of two templates:

  • layout.pt -> Contains the page skeleton with headers, body and so on.

  • macros.pt -> Contains chameleon macros.

property menu: NestedMenu[source]
property current_issue: onegov.gazette.models.Issue | None[source]
request: onegov.gazette.request.GazetteRequest[source]
date_with_weekday_format = 'EEEE dd.MM.yyyy'[source]
date_long_format = 'd. MMMM yyyy'[source]
datetime_with_weekday_format = 'EEEE dd.MM.yyyy HH:mm'[source]
title() str[source]
principal() onegov.gazette.models.Principal[source]
user() User | None[source]
font_awesome_path() str[source]
sentry_init_path() str[source]
copyright_year() int[source]
sortable_url_template() str[source]
publishing() bool[source]
importation() bool[source]
format_date(dt: datetime | date | None, format: str) str[source]

Returns a readable version of the given date while automatically converting to the principals timezone if the date is timezone aware.

format_issue(issue: onegov.gazette.models.Issue, date_format: str = 'date', notice: GazetteNotice | None = None) str[source]

Returns the issues number and date and optionally the publication number of the given notice.

format_text(text: str | None) str[source]
class gazette.layout.MailLayout(model: Any, request: onegov.gazette.request.GazetteRequest)[source]

Bases: Layout

A special layout for creating HTML E-Mails.

base() chameleon.PageTemplateFile[source]

Returns the layout, which defines the base layout of all pages.

See templates/layout.pt.

primary_color() str[source]