Ejemplo n.º 1
0
class ChartBlock(StructBlock):
    charts = ListBlock(
        StructBlock([
            ('Title', CharBlock(classname="title", required=False)),
            ('Subtitle', CharBlock(required=False)),
            ('UniqueID', CharBlock(required=True)),
            ('Blocktype',
             ChoiceBlock(choices=[
                 ('bar', 'Bar Chart'),
                 ('pie', 'Pie Chart'),
                 ('doughnut', 'Doughnut Chart'),
                 ('line', 'Line Chart'),
             ],
                         default='bar',
                         required=True)),
            ('Data',
             TextBlock(
                 rows=10,
                 required=True,
                 help_text=
                 "Data for Chart on the form: label1, value1, label2, value2, ..."
             )),
            ('Options',
             TextBlock(rows=10,
                       required=False,
                       help_text="Extended options for the chart"))
        ]))
    contained_charts = BooleanBlock(default=False, required=False)
    extra_classes = CharBlock(required=False)

    class Meta:
        icon = 'radio-empty'
Ejemplo n.º 2
0
class PullQuoteBlock(StructBlock):
    quote = CharBlock(classname="quote title")
    attribution = CharBlock(required=False)
    extra_classes = CharBlock(required=False)

    class Meta:
        icon = "openquote"
Ejemplo n.º 3
0
class ImageBlock(StructBlock):
    image = ImageChooserBlock()
    alignment = ImageFormatChoiceBlock()
    caption = CharBlock()
    attribution = CharBlock(required=False)

    class Meta:
        icon = "image"
Ejemplo n.º 4
0
class ImageBlock(StructBlock):
    image = ImageChooserBlock()
    alignment = ImageFormatChoiceBlock()
    caption = CharBlock(required=False)
    overlay_text = RichTextBlock(required=False)
    attribution = CharBlock(required=False)
    extra_classes = CharBlock(required=False)

    class Meta:
        icon = "image"
Ejemplo n.º 5
0
class StoryBlock(StreamBlock):
    h2 = CharBlock(icon="title", classname="title")
    h3 = CharBlock(icon="title", classname="title")
    h4 = CharBlock(icon="title", classname="title")
    intro = RichTextBlock(icon="pilcrow")
    paragraph = RichTextBlock(icon="pilcrow")
    aligned_image = ImageBlock(label="Aligned image")
    bustout = BustoutBlock()
    pullquote = PullQuoteBlock()
    raw_html = RawHTMLBlock(label='Raw HTML', icon="code")
    embed = EmbedBlock(icon="code")
Ejemplo n.º 6
0
class ImageCollection(StructBlock):
    images = ListBlock(
        StructBlock([
            ('image', ImageChooserBlock(required=True)),
            ('caption', CharBlock(required=False)),
            ('credit', CharBlock(required=False)),
        ]))
    extra_classes = CharBlock(required=False)

    class Meta:
        icon = 'image'
Ejemplo n.º 7
0
class TableBlock(StructBlock):
    table = TextBlock(
        rows=10,
        help_text=
        u'Enter your table as comma separated values, one line for each row.')
    caption = CharBlock(required=False)
    header_row = BooleanBlock(
        required=False, help_text=u'Render first row as header if checked')
    footer_row = BooleanBlock(
        required=False, help_text=u'Render last row as footer if checked')
    header_column = BooleanBlock(
        required=False, help_text=u'Render first column as header if checked')
    extra_classes = CharBlock(required=False)

    class Meta:
        icon = 'icon icon-fa-table'
Ejemplo n.º 8
0
class GridBlock(StructBlock):
    template = TextBlock(rows=10,
                         help_text='Enter your template as a plain HTML.')
    content_blocks = ListBlock(GridBlocks())
    extra_classes = CharBlock(required=False)

    class Meta:
        icon = 'placeholder'
Ejemplo n.º 9
0
class PullQuoteImageBlock(StructBlock):
    quote = CharBlock()
    attribution = CharBlock()
    image = ImageChooserBlock(required=False)
Ejemplo n.º 10
0
class PullQuoteBlock(StructBlock):
    quote = CharBlock(classname="quote title")
    attribution = CharBlock()

    class Meta:
        icon = "openquote"
Ejemplo n.º 11
0
class ParagraphBlock(StructBlock):
    paragraph = RichTextBlock()
    extra_classes = CharBlock(required=False)