コード例 #1
0
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
コード例 #2
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',
    )
コード例 #3
0
ファイル: blocks.py プロジェクト: octoberclub/nhsx-website
]


page_link_blocks = [
    ('link', LinkBlock()),
]


content_blocks = [
    ('rich_text', blocks.RichTextBlock(group=" Content")),
    ('block_quote', blocks.BlockQuoteBlock(group=" Content")),
    ('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")),
]

nhsx_blocks = content_blocks + nhs_blocks
コード例 #4
0
ファイル: blocks.py プロジェクト: nickmoreton/nhsx-website
page_link_blocks = [
    ("link", LinkBlock()),
]


content_blocks = [
    ("rich_text", blocks.RichTextBlock(group=" Content")),
    ("block_quote", blocks.BlockQuoteBlock(group=" Content")),
    ("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
コード例 #5
0
ファイル: blocks.py プロジェクト: nhsx/nhsx-website
page_link_blocks = [
    ("link", LinkBlock()),
]

content_blocks = [
    ("rich_text", blocks.RichTextBlock(group=" Content")),
    ("block_quote", blocks.BlockQuoteBlock(group=" Content")),
    ("embed", EmbedBlock(group=" Content")),
    ("captioned_embed", CaptionedEmbedBlock(group=" Content")),
    ("html_anchor", HTMLAnchorBlock(group=" Content")),
]

deprecated_blocks = [
    ("grey_panel", GreyPanelBlock(group="Deprecated")),
    ("panel", PanelBlock(group="Deprecated")),
    ("panel_list", PanelListBlock(group="Deprecated")),
    ("promo", PromoBlock(group="Deprecated")),
    ("promo_group", PromoGroupBlock(group="Deprecated")),
]

v5_blocks = [
    ("care_card", CareCardBlock(group=" NHS Components")),
    ("expander_group", ExpanderGroupBlock(group=" NHS Components")),
    ("details", DetailsBlock(group=" NHS Components")),
    ("card_group", CardGroupBlock(group=" NHS Components")),
    ("card_feature", CardFeatureBlock(group=" NHS Components")),
    ("card_image", CardImageBlock(group=" NHS Components")),
    ("card_clickable", CardClickableBlock(group=" NHS Components")),
    ("card_basic", CardBasicBlock(group=" NHS Components")),
    ("summary_list", SummaryListBlock(group=" NHS Components")),