Skip to content

Commit

Permalink
Merge pull request #1391 from devinit/feature/content-banner-block
Browse files Browse the repository at this point in the history
Section-optional banner block for mid-content
  • Loading branch information
akmiller01 authored Apr 18, 2024
2 parents 3b342e3 + 79d30bd commit 2e4d848
Show file tree
Hide file tree
Showing 4 changed files with 112 additions and 2 deletions.
5 changes: 5 additions & 0 deletions di_website/common/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,11 @@ class Meta():
label = 'Banner Block'


class ContentBannerBlock(BannerBlock):
class Meta():
template = 'blocks/banner/content_banner_block.html'


class SectionParagraphBlock(StructBlock):
text = RichTextBlock(features=RICHTEXT_FEATURES_NO_FOOTNOTES)
center = BooleanBlock(default=False, required=False)
Expand Down
5 changes: 3 additions & 2 deletions di_website/publications/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

from di_website.common.constants import RICHTEXT_FEATURES, RICHTEXT_FEATURES_NO_FOOTNOTES, FOOTNOTE_RICHTEXT_FEATURES
from .infographic import PublicationInfographic
from di_website.common.blocks import AccordionBlock, AnchorBlock, CallToActionBlock, SectionBlockQuote
from di_website.common.blocks import AccordionBlock, AnchorBlock, CallToActionBlock, SectionBlockQuote, ContentBannerBlock


class CaptionedImage(StructBlock):
Expand Down Expand Up @@ -337,7 +337,8 @@ class Meta:
('advanced_interactive_chart', AdvancedInteractiveChartBlock()),
('cta', CallToActionBlock()),
('accordion', AccordionBlock()),
('so_what', SoWhat())
('so_what', SoWhat()),
('content_banner', ContentBannerBlock()),
]

def flexible_content_streamfield(blank=False):
Expand Down
Loading

0 comments on commit 2e4d848

Please sign in to comment.