Skip to content
Snippets Groups Projects
Commit 2bc2907f authored by Dan Nepejchal's avatar Dan Nepejchal
Browse files

Fix:

- navigation
- parent_page_types
parent 47d631d1
No related branches found
No related tags found
2 merge requests!163release,!162Fix:
Pipeline #2091 passed
# Generated by Django 3.1.1 on 2021-01-10 22:51
import datetime
import wagtail.core.blocks
import wagtail.core.fields
import wagtail.images.blocks
from django.db import migrations
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
("green_deal", "0003_auto_20210107_1120"),
]
operations = [
migrations.AlterField(
model_name="greendealhomepage",
name="content",
field=wagtail.core.fields.StreamField(
[
(
"text_2_columns",
wagtail.core.blocks.StructBlock(
[
(
"left_text",
wagtail.core.blocks.RichTextBlock(
features=[
"h2",
"h3",
"h4",
"h5",
"bold",
"italic",
"ol",
"ul",
"hr",
"link",
"document-link",
"image",
],
label="levý sloupec",
),
),
(
"right_text",
wagtail.core.blocks.RichTextBlock(
features=[
"h2",
"h3",
"h4",
"h5",
"bold",
"italic",
"ol",
"ul",
"hr",
"link",
"document-link",
"image",
],
label="pravý sloupec",
),
),
]
),
),
(
"text_1_column",
wagtail.core.blocks.StructBlock(
[
("header", wagtail.core.blocks.CharBlock()),
(
"text",
wagtail.core.blocks.RichTextBlock(
features=[
"h2",
"h3",
"h4",
"h5",
"bold",
"italic",
"ol",
"ul",
"hr",
"link",
"document-link",
"image",
]
),
),
]
),
),
(
"FAQ_columns",
wagtail.core.blocks.StructBlock(
[
(
"left_text",
wagtail.core.blocks.RichTextBlock(
features=[
"h2",
"h3",
"h4",
"h5",
"bold",
"italic",
"ol",
"ul",
"hr",
"link",
"document-link",
"image",
],
label="levý sloupec",
),
),
(
"faqs",
wagtail.core.blocks.ListBlock(
wagtail.core.blocks.StructBlock(
[
(
"question",
wagtail.core.blocks.TextBlock(),
),
(
"answer",
wagtail.core.blocks.RichTextBlock(),
),
]
),
label="faq",
),
),
]
),
),
(
"news",
wagtail.core.blocks.ListBlock(
wagtail.core.blocks.StructBlock(
[
("header", wagtail.core.blocks.CharBlock()),
(
"perex",
wagtail.core.blocks.RichTextBlock(
features=[
"h2",
"h3",
"h4",
"h5",
"bold",
"italic",
"ol",
"ul",
"hr",
"link",
"document-link",
"image",
]
),
),
("img", wagtail.images.blocks.ImageChooserBlock()),
("link", wagtail.core.blocks.URLBlock()),
(
"date",
wagtail.core.blocks.DateBlock(
default=datetime.datetime(
2021,
1,
10,
22,
51,
27,
691203,
tzinfo=utc,
)
),
),
]
),
label="aktuality",
),
),
],
blank=True,
verbose_name="obsah stránky",
),
),
migrations.AlterField(
model_name="greendealsubpage",
name="content",
field=wagtail.core.fields.StreamField(
[
(
"text_2_columns",
wagtail.core.blocks.StructBlock(
[
(
"left_text",
wagtail.core.blocks.RichTextBlock(
features=[
"h2",
"h3",
"h4",
"h5",
"bold",
"italic",
"ol",
"ul",
"hr",
"link",
"document-link",
"image",
],
label="levý sloupec",
),
),
(
"right_text",
wagtail.core.blocks.RichTextBlock(
features=[
"h2",
"h3",
"h4",
"h5",
"bold",
"italic",
"ol",
"ul",
"hr",
"link",
"document-link",
"image",
],
label="pravý sloupec",
),
),
]
),
),
(
"text_1_column",
wagtail.core.blocks.StructBlock(
[
("header", wagtail.core.blocks.CharBlock()),
(
"text",
wagtail.core.blocks.RichTextBlock(
features=[
"h2",
"h3",
"h4",
"h5",
"bold",
"italic",
"ol",
"ul",
"hr",
"link",
"document-link",
"image",
]
),
),
]
),
),
(
"FAQ_columns",
wagtail.core.blocks.StructBlock(
[
(
"left_text",
wagtail.core.blocks.RichTextBlock(
features=[
"h2",
"h3",
"h4",
"h5",
"bold",
"italic",
"ol",
"ul",
"hr",
"link",
"document-link",
"image",
],
label="levý sloupec",
),
),
(
"faqs",
wagtail.core.blocks.ListBlock(
wagtail.core.blocks.StructBlock(
[
(
"question",
wagtail.core.blocks.TextBlock(),
),
(
"answer",
wagtail.core.blocks.RichTextBlock(),
),
]
),
label="faq",
),
),
]
),
),
(
"news",
wagtail.core.blocks.ListBlock(
wagtail.core.blocks.StructBlock(
[
("header", wagtail.core.blocks.CharBlock()),
(
"perex",
wagtail.core.blocks.RichTextBlock(
features=[
"h2",
"h3",
"h4",
"h5",
"bold",
"italic",
"ol",
"ul",
"hr",
"link",
"document-link",
"image",
]
),
),
("img", wagtail.images.blocks.ImageChooserBlock()),
("link", wagtail.core.blocks.URLBlock()),
(
"date",
wagtail.core.blocks.DateBlock(
default=datetime.datetime(
2021,
1,
10,
22,
51,
27,
691203,
tzinfo=utc,
)
),
),
]
),
label="aktuality",
),
),
],
blank=True,
verbose_name="obsah stránky",
),
),
]
...@@ -175,6 +175,9 @@ class GreenDealSubPage(Page, MetadataPageMixin): ...@@ -175,6 +175,9 @@ class GreenDealSubPage(Page, MetadataPageMixin):
### RELATIONS ### RELATIONS
parent_page_types = [
"green_deal.GreenDealHomePage",
]
subpage_types = [ subpage_types = [
"green_deal.GreenDealSubPage", "green_deal.GreenDealSubPage",
] ]
...@@ -186,4 +189,8 @@ class GreenDealSubPage(Page, MetadataPageMixin): ...@@ -186,4 +189,8 @@ class GreenDealSubPage(Page, MetadataPageMixin):
@property @property
def root_page(self): def root_page(self):
return self if not hasattr(self, "_root_page"):
self._root_page = (
self.get_ancestors().type(GreenDealHomePage).specific().last()
)
return self._root_page
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment