Skip to content
Snippets Groups Projects
Commit 9bc97f70 authored by jan.bednarik's avatar jan.bednarik
Browse files

majak: Improve comments in code

parent ad559ac9
No related branches found
No related tags found
2 merge requests!59majak: Improve comments in code,!58majak: Improve comments in code
Pipeline #928 passed
......@@ -9,10 +9,14 @@ from tuning import help
class DistrictsHomePage(MetadataPageMixin, Page):
### FIELDS
matomo_id = models.IntegerField(
"Matomo ID pro sledování návštěvnosti", blank=True, null=True
)
### PANELS
promote_panels = [
MultiFieldPanel(
[
......@@ -29,7 +33,11 @@ class DistrictsHomePage(MetadataPageMixin, Page):
FieldPanel("matomo_id"),
]
### RELATIONS
subpage_types = []
### OTHERS
class Meta:
verbose_name = "Krajský rozcestník"
......@@ -4,12 +4,22 @@ from wagtail.core.models import Page
class HomeIndexPage(Page):
### FIELDS
body = RichTextField("obsah")
### PANELS
content_panels = Page.content_panels + [
FieldPanel("body"),
]
### RELATIONS
subpage_types = []
### OTHERS
class Meta:
verbose_name = "Maják homepage"
......
......@@ -54,6 +54,8 @@ class ContactBlock(blocks.StructBlock):
class SenatCampaignHomePage(Page, MetadataPageMixin, CalendarMixin):
### FIELDS
# top section
headline = models.CharField("podtitulek pod jménem", max_length=250, blank=True)
top_photo = models.ForeignKey(
......@@ -127,6 +129,8 @@ class SenatCampaignHomePage(Page, MetadataPageMixin, CalendarMixin):
"Matomo ID pro sledování návštěvnosti", blank=True, null=True
)
### PANELS
content_panels = Page.content_panels + [
MultiFieldPanel(
[
......@@ -185,12 +189,16 @@ class SenatCampaignHomePage(Page, MetadataPageMixin, CalendarMixin):
StreamFieldPanel("contacts"),
]
### RELATIONS
subpage_types = [
"senat_campaign.SenatCampaignNewsIndexPage",
"senat_campaign.SenatCampaignProgramPage",
"senat_campaign.SenatCampaignCookiesPage",
]
### OTHERS
# flag for rendering anchor links in menu
is_home = True
......@@ -276,8 +284,9 @@ class SenatCampaignHomePage(Page, MetadataPageMixin, CalendarMixin):
class SenatCampaignNewsIndexPage(Page, SubpageMixin, MetadataPageMixin):
parent_page_types = ["senat_campaign.SenatCampaignHomePage"]
subpage_types = ["senat_campaign.SenatCampaignNewsPage"]
### FIELDS
### PANELS
promote_panels = [
MultiFieldPanel(
......@@ -294,6 +303,13 @@ class SenatCampaignNewsIndexPage(Page, SubpageMixin, MetadataPageMixin):
settings_panels = []
### RELATIONS
parent_page_types = ["senat_campaign.SenatCampaignHomePage"]
subpage_types = ["senat_campaign.SenatCampaignNewsPage"]
### OTHERS
# flag for rendering anchor links in menu
is_home = False
......@@ -308,6 +324,8 @@ class SenatCampaignNewsIndexPage(Page, SubpageMixin, MetadataPageMixin):
class SenatCampaignNewsPage(Page, SubpageMixin, MetadataPageMixin):
### FIELDS
date = models.DateField("datum")
perex = models.TextField("perex")
body = RichTextField("článek", blank=True)
......@@ -321,6 +339,8 @@ class SenatCampaignNewsPage(Page, SubpageMixin, MetadataPageMixin):
# we will use photo as search image
search_image = None
### PANELS
content_panels = Page.content_panels + [
FieldPanel("date"),
FieldPanel("perex"),
......@@ -345,9 +365,13 @@ class SenatCampaignNewsPage(Page, SubpageMixin, MetadataPageMixin):
),
]
### RELATIONS
parent_page_types = ["senat_campaign.SenatCampaignNewsIndexPage"]
subpage_types = []
### OTHERS
# flag for rendering anchor links in menu
is_home = False
......@@ -394,6 +418,8 @@ class ProgramBlock(blocks.StructBlock):
class SenatCampaignProgramPage(Page, SubpageMixin, MetadataPageMixin):
### FIELDS
committee_preference = StreamField(
[("committee", blocks.CharBlock(label="výbor či komise"))],
verbose_name="preferované výbory a komise",
......@@ -403,6 +429,8 @@ class SenatCampaignProgramPage(Page, SubpageMixin, MetadataPageMixin):
[("item", ProgramBlock())], verbose_name="programové body", blank=True
)
### PANELS
content_panels = Page.content_panels + [
StreamFieldPanel("committee_preference"),
StreamFieldPanel("content"),
......@@ -423,9 +451,13 @@ class SenatCampaignProgramPage(Page, SubpageMixin, MetadataPageMixin):
settings_panels = []
### RELATIONS
parent_page_types = ["senat_campaign.SenatCampaignHomePage"]
subpage_types = []
### OTHERS
# flag for rendering anchor links in menu
is_home = False
......@@ -434,8 +466,12 @@ class SenatCampaignProgramPage(Page, SubpageMixin, MetadataPageMixin):
class SenatCampaignCookiesPage(Page, SubpageMixin, MetadataPageMixin):
### FIELDS
body = RichTextField("obsah", blank=True)
### PANELS
content_panels = Page.content_panels + [
FieldPanel("body", classname="full"),
]
......@@ -455,9 +491,13 @@ class SenatCampaignCookiesPage(Page, SubpageMixin, MetadataPageMixin):
settings_panels = []
### RELATIONS
parent_page_types = ["senat_campaign.SenatCampaignHomePage"]
subpage_types = []
### OTHERS
# flag for rendering anchor links in menu
is_home = False
......
......@@ -31,6 +31,8 @@ class PersonBlock(blocks.StructBlock):
class SenateHomePage(MetadataPageMixin, Page):
### FIELDS
senators = StreamField(
[("item", PersonBlock())], verbose_name="naši senátoři", blank=True
)
......@@ -41,6 +43,8 @@ class SenateHomePage(MetadataPageMixin, Page):
"Matomo ID pro sledování návštěvnosti", blank=True, null=True
)
### PANELS
content_panels = Page.content_panels + [
StreamFieldPanel("senators"),
StreamFieldPanel("candidates"),
......@@ -62,7 +66,11 @@ class SenateHomePage(MetadataPageMixin, Page):
FieldPanel("matomo_id"),
]
### RELATIONS
subpage_types = []
### OTHERS
class Meta:
verbose_name = "Senátní rozcestník"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment