swissvotes.layouts.vote

Module Contents

Classes

VoteLayout

Extends the base layout class with methods related to chameleon

VoteDetailLayout

Extends the base layout class with methods related to chameleon

VoteStrengthsLayout

Extends the base layout class with methods related to chameleon

VoteCampaignMaterialLayout

Extends the base layout class with methods related to chameleon

UploadVoteAttachemtsLayout

Extends the base layout class with methods related to chameleon

ManageCampaingMaterialLayout

Extends the base layout class with methods related to chameleon

ManageCampaingMaterialYeaLayout

Extends the base layout class with methods related to chameleon

ManageCampaingMaterialNayLayout

Extends the base layout class with methods related to chameleon

DeleteVoteLayout

Extends the base layout class with methods related to chameleon

DeleteVoteAttachmentLayout

Extends the base layout class with methods related to chameleon

class swissvotes.layouts.vote.VoteLayout(model: Any, request: onegov.swissvotes.request.SwissvotesRequest)[source]

Bases: onegov.swissvotes.layouts.default.DefaultLayout

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.

title() str[source]
breadcrumbs() list[onegov.core.elements.Link][source]
attachments() onegov.core.types.RenderData[source]

Returns a dictionary with static URLS and locale for attachments.

Note that only file / locale combinations with a file_name definition have a static URL!

search_results() list[tuple[int, str, str, bool, onegov.swissvotes.models.SwissVoteFile]][source]
class swissvotes.layouts.vote.VoteDetailLayout(model: Any, request: onegov.swissvotes.request.SwissvotesRequest)[source]

Bases: onegov.swissvotes.layouts.default.DefaultLayout

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.

breadcrumbs() list[onegov.core.elements.Link][source]
class swissvotes.layouts.vote.VoteStrengthsLayout(model: Any, request: onegov.swissvotes.request.SwissvotesRequest)[source]

Bases: VoteDetailLayout

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.

title() str[source]
class swissvotes.layouts.vote.VoteCampaignMaterialLayout(model: Any, request: onegov.swissvotes.request.SwissvotesRequest)[source]

Bases: VoteDetailLayout

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.

date_month_format = 'MM.yyyy'[source]
date_year_format = 'yyyy'[source]
title() str[source]
codes() dict[str, dict[str, str]][source]
format_code(metadata: dict[str, Any] | None, key: str) str[source]
format_partial_date(metadata: dict[str, Any] | None) str[source]
format_sortable_date(metadata: dict[str, Any] | None) str[source]
metadata(filename: str | None) dict[str, Any][source]
class swissvotes.layouts.vote.UploadVoteAttachemtsLayout(model: Any, request: onegov.swissvotes.request.SwissvotesRequest)[source]

Bases: VoteDetailLayout

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.

title() str[source]
class swissvotes.layouts.vote.ManageCampaingMaterialLayout(model: Any, request: onegov.swissvotes.request.SwissvotesRequest)[source]

Bases: VoteDetailLayout

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.

title() str[source]
class swissvotes.layouts.vote.ManageCampaingMaterialYeaLayout(model: Any, request: onegov.swissvotes.request.SwissvotesRequest)[source]

Bases: VoteDetailLayout

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.

title() str[source]
class swissvotes.layouts.vote.ManageCampaingMaterialNayLayout(model: Any, request: onegov.swissvotes.request.SwissvotesRequest)[source]

Bases: VoteDetailLayout

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.

title() str[source]
class swissvotes.layouts.vote.DeleteVoteLayout(model: Any, request: onegov.swissvotes.request.SwissvotesRequest)[source]

Bases: VoteDetailLayout

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.

title() str[source]
class swissvotes.layouts.vote.DeleteVoteAttachmentLayout(model: Any, request: onegov.swissvotes.request.SwissvotesRequest)[source]

Bases: onegov.swissvotes.layouts.default.DefaultLayout

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.

parent() onegov.swissvotes.models.SwissVote[source]
breadcrumbs() list[onegov.core.elements.Link][source]
title() str[source]