Example #1
0
class IconHeaderBlock(StructBlock):
    headline = TextBlock(help_text='Write a title for this section.')
    icon = IconBlock(help_text='Optional icon', required=False)
    visible = BooleanBlock(default=True, required=False)

    class Meta:
        icon = 'fa-header'
        template = 'blocks/icon_banner_header.html'
        help_text = 'A red banner headline with optional icon'
Example #2
0
    class FeatureBlock(blocks.StructBlock):
        icon = IconBlock()
        title = blocks.CharBlock(min_length=5,
                                 max_length=100,
                                 help_text='Titulo')
        text = blocks.TextBlock(help_text='DescripciĆ³n')

        class Meta:
            icon = 'placeholder'
class IconBlock(blocks.StructBlock):
    """Basic fontawesome icons"""
    icon_color = NativeColorBlock(required=True)
    icon_size = blocks.CharBlock(
        max_length=10,
        required=True,
        help_text="any CSS unit supported px, %, rem, vh enz")
    icon_icon = IconBlock(required=True)

    class Meta:
        icon = 'pick'
        template = 'wagtail_block_collection/basic/icon_block.html'
        group = "Basic"
        label = "icon"
    google_font = blocks.CharBlock(required=False,
                                   help_text="Choose a font from Google Font")

    class Meta:
        icon = 'fa-clock'
        template = 'wagtail_block_collection/special/countdown_block.html'
        label = "Countdown"
        group = "Special"


content_blocks = [
    ("TextBlock", TextBlock()),
    ("TextAndImageBlock", TextAndImageBlock()),
    ("BasicTitleBlock", BasicTitleBlock()),
    ("BasicCardDeck", BasicCardDeck()),
    ("IconBlock", IconBlock()),
    ("BasicButtonBlock", BasicButtonBlock()),
    ("ImageBlock", ImageBlock()),
    ("YoutubeVideoBlock", YoutubeVideoBlock()),
    ("EmbedBlock", EmbedBlock()),
    ("Spacer", Spacer()),
    ("Line", Line()),
    ("GoogleMapsBlock", GoogleMapsBlock()),
    ("TypeWriter", TypeWriter()),
    ("ImageSlider", ImageSlider()),
    ("AlertBlock", AlertBlock()),
    ("CountdownBlock", CountdownBlock()),
]


#################
Example #5
0
class PeriodicBlock(StructBlock):
    icon = IconBlock(required=False)
    title = CharBlock()
    link = CharBlock(required=False)
Example #6
0
class DetailedFlowBlock(StructBlock):
    origin_icon = IconBlock(required=False)
    origin_title = CharBlock(required=False)
    icon = IconBlock(required=False)
    title = CharBlock()