How to use the coderedcms.blocks.base_blocks.ButtonMixin function in coderedcms

To help you get started, we’ve selected a few coderedcms examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github coderedcorp / coderedcms / coderedcms / blocks / content_blocks.py View on Github external
"""
    Show a collection of images with interactive previews that expand to
    full size images in a modal.
    """
    collection = CollectionChooserBlock(
        required=True,
        label=_('Image Collection'),
    )

    class Meta:
        template = 'coderedcms/blocks/image_gallery_block.html'
        icon = 'image'
        label = _('Image Gallery')


class ModalBlock(ButtonMixin, BaseLayoutBlock):
    """
    Renders a button that then opens a popup/modal with content.
    """
    header = blocks.CharBlock(
        required=False,
        max_length=255,
        label=_('Modal heading'),
    )
    content = blocks.StreamBlock(
        [],
        label=_('Modal content'),
    )
    footer = blocks.StreamBlock(
        [
            ('text', blocks.CharBlock(icon='fa-file-text-o', max_length=255, label=_('Simple Text'))),
            ('button', ButtonBlock()),
github coderedcorp / coderedcms / coderedcms / blocks / html_blocks.py View on Github external
from wagtail.images.blocks import ImageChooserBlock

from .base_blocks import (
    BaseBlock,
    BaseLinkBlock,
    ButtonMixin,
    ClassifierTermChooserBlock,
    CoderedAdvTrackingSettings,
    LinkStructValue,
)


logger = logging.getLogger('coderedcms')


class ButtonBlock(ButtonMixin, BaseLinkBlock):
    """
    A link styled as a button.
    """
    class Meta:
        template = 'coderedcms/blocks/button_block.html'
        icon = 'fa-hand-pointer-o'
        label = _('Button Link')
        value_class = LinkStructValue


class DownloadBlock(ButtonMixin, BaseBlock):
    """
    Link to a file that can be downloaded.
    """
    automatic_download = blocks.BooleanBlock(
        required=False,
github coderedcorp / coderedcms / coderedcms / blocks / html_blocks.py View on Github external
logger = logging.getLogger('coderedcms')


class ButtonBlock(ButtonMixin, BaseLinkBlock):
    """
    A link styled as a button.
    """
    class Meta:
        template = 'coderedcms/blocks/button_block.html'
        icon = 'fa-hand-pointer-o'
        label = _('Button Link')
        value_class = LinkStructValue


class DownloadBlock(ButtonMixin, BaseBlock):
    """
    Link to a file that can be downloaded.
    """
    automatic_download = blocks.BooleanBlock(
        required=False,
        label=_('Auto download'),
    )
    downloadable_file = DocumentChooserBlock(
        required=False,
        label=_('Document link'),
    )

    advsettings_class = CoderedAdvTrackingSettings

    class Meta:
        template = 'coderedcms/blocks/download_block.html'