Skip to content

Commit

Permalink
Add cookies and cookie details pages (#1712)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahosgood authored Aug 29, 2024
1 parent 4f27186 commit 0a04e0f
Show file tree
Hide file tree
Showing 8 changed files with 421 additions and 0 deletions.
1 change: 1 addition & 0 deletions config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"etna.analytics",
"etna.articles",
"etna.people",
"etna.cookies",
"etna.categories",
"etna.ciim",
"etna.collections",
Expand Down
Empty file added etna/cookies/__init__.py
Empty file.
7 changes: 7 additions & 0 deletions etna/cookies/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from django.apps import AppConfig


class CookiesAppConfig(AppConfig):
default_auto_field = "django.db.models.AutoField"
name = "etna.cookies"
verbose_name = "Cookies"
36 changes: 36 additions & 0 deletions etna/cookies/blocks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
from wagtail import blocks

from etna.core.blocks import (
ContentTableBlock,
DescriptionListBlock,
InsetTextBlock,
ParagraphBlock,
SectionDepthAwareStructBlock,
SubHeadingBlock,
)


class SectionContentBlock(blocks.StreamBlock):
inset_text = InsetTextBlock()
paragraph = ParagraphBlock()
description_list = DescriptionListBlock()
sub_heading = SubHeadingBlock()
table = ContentTableBlock()


class ContentSectionBlock(SectionDepthAwareStructBlock):
heading = blocks.CharBlock(max_length=100, label="Heading")
content = SectionContentBlock(required=False)

class Meta:
label = "Section"
template = "articles/blocks/section.html"


class CookieDetailsStreamBlock(SectionContentBlock):
"""
A block for the CookieDetailsPage model.
"""

content_section = ContentSectionBlock()
sub_heading = None
7 changes: 7 additions & 0 deletions etna/cookies/factories.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from etna.cookies import models as app_models
from etna.core.factories import BasePageFactory


class CookiesPageFactory(BasePageFactory):
class Meta:
model = app_models.CookiesPage
Loading

0 comments on commit 0a04e0f

Please sign in to comment.