diff --git a/district/models.py b/district/models.py index 68ffebb2deb57847507fb32294c08d53dc6ff194..ba654fa53d1a5d96b3ff87034d8cc3f321f482d0 100644 --- a/district/models.py +++ b/district/models.py @@ -125,15 +125,6 @@ class DistrictHomePage(CalendarMixin, MainHomePageMixin): "Text tlačítka kalendáře", max_length=256, default="Kalendář" ) - gdpr_and_cookies_page = models.ForeignKey( - # Keep this a reference to the main website's GDPR page. Not ideal, but works (for now). - "main.MainSimplePage", - verbose_name="Stránka pro GDPR", - on_delete=models.PROTECT, - blank=True, - null=True, - ) - # --- END New fields --- # Extra komentar v paticce @@ -170,6 +161,10 @@ class DistrictHomePage(CalendarMixin, MainHomePageMixin): ### EDIT HANDLERS + settings_panels = [ + FieldPanel("matomo_id"), + ] + edit_handler = TabbedInterface( [ ObjectList(MainHomePageMixin.content_panels, heading="Obsah"), @@ -201,6 +196,12 @@ class DistrictHomePage(CalendarMixin, MainHomePageMixin): class Meta: verbose_name = "Oblastní sdružení" + @property + def gdpr_and_cookies_page(self): + from main.models import MainHomePage + + return MainHomePage.objects.first().gdpr_and_cookies_page + @property def articles_page_model(self): return DistrictArticlesPage diff --git a/shared/models/main.py b/shared/models/main.py index 472c87515c1168b9a6e9c8fb0f727438c163a829..e74103ef36ba6a6c4b0824b266d713f436d94d96 100644 --- a/shared/models/main.py +++ b/shared/models/main.py @@ -1492,7 +1492,7 @@ class MainArticlePageMixin( ### BEGIN Panels - content_panels = [ + content_panels = Page.content_panels + [ FieldPanel("timestamp"), FieldPanel("perex"), FieldPanel("content"), diff --git a/uniweb/blocks.py b/uniweb/blocks.py index c93513ee00f4c5956de8a0c9c54f509e43182c62..b69c71ae41b58fd4ba0dfe506ece11c517631d00 100644 --- a/uniweb/blocks.py +++ b/uniweb/blocks.py @@ -74,7 +74,10 @@ class PersonContactBlock(StructBlock): position = CharBlock(label="Název pozice", required=False) person = PageChooserBlock( label="Osoba", - page_type=["uniweb.UniwebPersonPage"], + page_type=[ + "uniweb.UniwebPersonPage", + "district.DistrictPersonPage", + ], ) class Meta: diff --git a/uniweb/models.py b/uniweb/models.py index 76c6842567594d1a9df083ffaf303cd4a0738c46..39383094cc153c4457306a17cf0dea1143e79779 100644 --- a/uniweb/models.py +++ b/uniweb/models.py @@ -205,6 +205,7 @@ class MenuItemBlock(blocks.StructBlock): "uniweb.UniwebPeoplePage", "uniweb.UniwebPersonPage", "uniweb.UniwebPdfPage", + "district.DistrictPersonPage", ], )