Skip to content

Commit

Permalink
DSRC-37: Contact block (#1694)
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesbiggs authored Aug 2, 2024
1 parent d01ed71 commit 0f21478
Show file tree
Hide file tree
Showing 4 changed files with 561 additions and 0 deletions.
2 changes: 2 additions & 0 deletions etna/core/blocks/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from .accordion import AccordionsBlock
from .base import SectionDepthAwareStructBlock
from .contact import ContactBlock
from .cta import ButtonBlock, CallToActionBlock, LargeCardLinksBlock
from .document import DocumentsBlock
from .featured_content import (
Expand Down Expand Up @@ -31,6 +32,7 @@
"AuthorPromotedPagesBlock",
"ButtonBlock",
"CallToActionBlock",
"ContactBlock",
"ContentImageBlock",
"ContentTableBlock",
"DescriptionListBlock",
Expand Down
24 changes: 24 additions & 0 deletions etna/core/blocks/contact.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
from django.conf import settings

from wagtail import blocks

from .paragraph import APIRichTextBlock


class ContactBlock(blocks.StructBlock):
title = blocks.CharBlock()
address = blocks.TextBlock(
required=False, features=settings.INLINE_RICH_TEXT_FEATURES
)
telephone = blocks.CharBlock(required=False)
chat_link = blocks.URLBlock(required=False)
chat_note = APIRichTextBlock(required=False)
email = blocks.EmailBlock(required=False)
website_link = blocks.URLBlock(required=False)
social_media = APIRichTextBlock(
required=False, features=settings.INLINE_RICH_TEXT_FEATURES
)

class Meta:
icon = "mail"
label = "Contact"
2 changes: 2 additions & 0 deletions etna/generic_pages/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
AccordionsBlock,
ButtonBlock,
CallToActionBlock,
ContactBlock,
ContentImageBlock,
ContentTableBlock,
DescriptionListBlock,
Expand Down Expand Up @@ -33,6 +34,7 @@ class SectionContentBlock(blocks.StreamBlock):
accordions = AccordionsBlock()
button = ButtonBlock()
call_to_action = CallToActionBlock()
contact = ContactBlock()
description_list = DescriptionListBlock()
document = DocumentsBlock()
do_dont_list = DoDontListBlock()
Expand Down
Loading

0 comments on commit 0f21478

Please sign in to comment.