Exemple #1
0
class CoreBlocks(StreamBlock):
    action_link = ActionLinkBlock(group='Base')
    care_card = CareCardBlock(group='Base')
    details = DetailsBlock(group='Base')
    do_list = DoBlock(group='Base')
    dont_list = DontBlock(group='Base')
    expander = ExpanderBlock(group='Base')
    expander_group = ExpanderGroupBlock(group='Base')
    inset_text = InsetTextBlock(group='Base')
    image = ImageBlock(group='Base')
    panel = PanelBlock(group='Base')
    panel_list = PanelListBlock(group='Base')
    # panel_with_image = PanelBlockWithImage(group='Base')
    grey_panel = GreyPanelBlock(group='Base')
    warning_callout = WarningCalloutBlock(group='Base')
    summary_list = SummaryListBlock(group='Base')
    promo = PromoBlock(group='Base')
    promo_group = PromoGroupBlock(group='Base')

    recent_posts = RecentPostsBlock(group='Custom')
    text = RichTextBlock(group='Custom',
                         help_text="""
            Use this block to add formatted text into a page e.g. 
            paragraph with heading and/or links and images
        """,
                         template='blocks/text_block.html',
                         features=RICHTEXT_FEATURES_ALL)
    html = RawHTMLBlock(
        group='custom',
        help_text="""
            Use this block to add raw html
        """,
        template='blocks/html_block.html',
    )
class HomePage(HeroMixin, ReviewDateMixin, Page):

    parent_page_types = ['wagtailcore.Page']

    body = StreamField([
        ('action_link', ActionLinkBlock()),
        ('care_card', CareCardBlock()),
        ('details', DetailsBlock()),
        ('do_list', DoBlock()),
        ('dont_list', DontBlock()),
        ('expander', ExpanderBlock()),
        ('expander_group', ExpanderGroupBlock()),
        ('inset_text', InsetTextBlock()),
        ('image', ImageBlock()),
        ('panel', PanelBlock()),
        ('panel_list', PanelListBlock()),
        ('grey_panel', GreyPanelBlock()),
        ('warning_callout', WarningCalloutBlock()),
        ('summary_list', SummaryListBlock()),
    ])

    content_panels = Page.content_panels + HeroMixin.content_panels + [
        StreamFieldPanel('body'),
    ]

    settings_panels = Page.settings_panels + ReviewDateMixin.settings_panels
Exemple #3
0
    ("embed", EmbedBlock(group=" Content")),
    ("captioned_embed", CaptionedEmbedBlock(group=" Content")),
]

nhs_blocks = [
    ("image", ImageBlock(group=" NHS Components")),
    ("panel", PanelBlock(group=" NHS Components")),
    ("promo", PromoBlock(group=" NHS Components")),
    ("expander", NHSXExpanderBlock(group=" NHS Components")),
    ("grey_panel", GreyPanelBlock(group=" NHS Components")),
    ("inset_text", InsetTextBlock(group=" NHS Components")),
    ("panel_list", PanelListBlock(group=" NHS Components")),
    ("promo_group", PromoGroupBlock(group=" NHS Components")),
    ("warning_callout", WarningCalloutBlock(group=" NHS Components")),
    ("table", TableBlock(group=" NHS Components")),
    ("panel_table", PanelTableBlock(group=" NHS Components")),
    ("action_link", ActionLinkBlock(group=" NHS Components")),
    ("legal_information", LegalInformationBlock(group=" NHS Components")),
]

nhsx_blocks = content_blocks + nhs_blocks

section_page_blocks = nhsx_blocks + [
    ("latest_blog_posts", LatestBlogPostsBlock(group=" Content")),
    ("latest_news", LatestNewsBlock(group=" Content")),
    ("promo_banner", PromoBanner(group=" Content")),
    ("newsletter_signup", NewsletterBlock(group=" Content")),
    ("step_group", StepGroupBlock(group=" Content")),
    ("case_studies", CaseStudiesBlock(group=" Content")),
]