Skip to content

Commit

Permalink
DSRC-40: Warning Text (#1667)
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesbiggs authored Jul 2, 2024
1 parent 536a22d commit 99d9efd
Show file tree
Hide file tree
Showing 5 changed files with 586 additions and 2 deletions.
3 changes: 2 additions & 1 deletion etna/core/blocks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
)
from .quote import QuoteBlock
from .section import SectionBlock, SubHeadingBlock
from .text import InsetTextBlock
from .text import InsetTextBlock, WarningTextBlock

__all__ = [
"APIPageChooserBlock",
Expand All @@ -46,4 +46,5 @@
"SectionBlock",
"SectionDepthAwareStructBlock",
"SubHeadingBlock",
"WarningTextBlock",
]
2 changes: 1 addition & 1 deletion etna/core/blocks/lists.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ class DoDontListBlock(blocks.StructBlock):
)

class Meta:
icon = "list-ul"
icon = "tasks"
label = "Do/Don't List"
template = "blocks/do-dont-list.html"
12 changes: 12 additions & 0 deletions etna/core/blocks/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,15 @@ class InsetTextBlock(blocks.StructBlock):
class Meta:
icon = "indent"
label = "Inset text"


class WarningTextBlock(blocks.StructBlock):
heading = blocks.CharBlock(
required=False,
help_text="Optional heading for the warning text, for screen readers",
)
body = APIRichTextBlock(features=settings.RESTRICTED_RICH_TEXT_FEATURES)

class Meta:
icon = "warning"
label = "Warning text"
2 changes: 2 additions & 0 deletions etna/generic_pages/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
QuoteBlock,
SectionDepthAwareStructBlock,
SubHeadingBlock,
WarningTextBlock,
)

from ..media.blocks import MediaBlock
Expand All @@ -33,6 +34,7 @@ class SectionContentBlock(blocks.StreamBlock):
quote = QuoteBlock()
record_links = RecordLinksBlock()
sub_heading = SubHeadingBlock()
warning_text = WarningTextBlock()


class ContentSectionBlock(SectionDepthAwareStructBlock):
Expand Down
Loading

0 comments on commit 99d9efd

Please sign in to comment.