Source code for pas.layouts.commission

from functools import cached_property
from onegov.core.elements import Confirm
from onegov.core.elements import Intercooler
from onegov.core.elements import Link
from onegov.core.elements import LinkGroup
from onegov.pas import _
from onegov.pas.collections import CommissionCollection
from onegov.pas.layouts.default import DefaultLayout


[docs] class CommissionCollectionLayout(DefaultLayout): @cached_property
[docs] def title(self) -> str: return _('Commissions')
@cached_property
[docs] def og_description(self) -> str: return self.request.translate(self.title)
@cached_property
[docs] def breadcrumbs(self) -> list[Link]: return [ Link(_('Homepage'), self.homepage_url), Link(_('PAS settings'), self.pas_settings_url), Link(self.title, self.request.link(self.model)) ]
@cached_property
[docs] class CommissionLayout(DefaultLayout): @cached_property
[docs] def collection(self) -> CommissionCollection: return CommissionCollection(self.request.session)
@cached_property
[docs] def title(self) -> str: return self.model.name
@cached_property
[docs] def og_description(self) -> str: return self.request.translate(self.title)
@cached_property
[docs] def breadcrumbs(self) -> list[Link]: return [ Link(_('Homepage'), self.homepage_url), Link(_('PAS settings'), self.pas_settings_url), Link( _('Commissions'), self.request.link(self.collection) ), Link(self.title, self.request.link(self.model)) ]
@cached_property