Beispiel #1
0
class NColumnImageWithTextBlock(NColumnImageBlock):
    align_columnar_images = blocks.ChoiceBlock(choices=ALIGNMENT_CHOICES,
                                               default=ALIGNMENT_CHOICES[0][0])
    content = PargraphBlockWithOptionalContent(required=False)

    class Meta:
        icon = 'image'
        label = 'Columnar images with text'
Beispiel #2
0
class ParagraphWithBlockQuoteBlock(blocks.StructBlock):
    quote = CustomRichTextBlock(editor='hallo_for_quote')
    align_quote = blocks.ChoiceBlock(choices=ALIGNMENT_CHOICES,
                                     default=ALIGNMENT_CHOICES[1][0])
    content = ParagraphBlock()

    class Meta:
        icon = 'openquote'
        label = 'Quote with text'
        template = 'article/blocks/paragraph_with_block_quote.html'
Beispiel #3
0
class ImageWithBlockQuote(blocks.StructBlock):
    image = ImageWithCaptionAndHeightBlock()
    quote = CustomRichTextBlock(editor='hallo_for_quote', required=True)
    align_quote = blocks.ChoiceBlock(choices=ALIGNMENT_CHOICES,
                                     default=ALIGNMENT_CHOICES[0][0])

    class Meta:
        icon = 'image'
        template = 'article/blocks/image_with_block_quote.html'
        label = 'Image with block quote'
Beispiel #4
0
class ParagraphWithMapBlock(blocks.StructBlock):
    locations = ModelMultipleChoiceBlock(target_model=Location)
    map_align = blocks.ChoiceBlock(choices=ALIGNMENT_CHOICES,
                                   default=ALIGNMENT_CHOICES[0][0])
    content = ParagraphBlock()

    class Meta:
        label = 'Map with text'
        template = 'article/blocks/paragraph_with_map.html'
        icon = 'site'
Beispiel #5
0
class ParagraphWithImageBlock(blocks.StructBlock):
    image = ImageBlock()
    align_image = blocks.ChoiceBlock(choices=ALIGNMENT_CHOICES,
                                     default=ALIGNMENT_CHOICES[0][0])
    content = ParagraphBlock()

    class Meta:
        icon = 'doc-full'
        label = 'Paragraphs with an image'
        template = 'article/blocks/paragraph_with_image.html'
Beispiel #6
0
class ParagraphBlock(blocks.StructBlock):
    ALIGN_CONTENT_CHOICES = [('default', 'Default'), ('center', 'Center')]
    content = CustomRichTextBlock(editor='hallo_for_paragraph')
    align_content = blocks.ChoiceBlock(choices=ALIGN_CONTENT_CHOICES,
                                       default=ALIGN_CONTENT_CHOICES[0][0])

    class Meta:
        icon = 'title'
        label = 'Text'
        template = 'article/blocks/paragraph.html'
Beispiel #7
0
class ParagraphWithPageBlock(blocks.StructBlock):
    page = PageTypeChooserBlock(
        for_models=['article.models.Article', Album, Face, Resource])
    align_image = blocks.ChoiceBlock(choices=ALIGNMENT_CHOICES,
                                     default=ALIGNMENT_CHOICES[0][0])
    content = ParagraphBlock()

    class Meta:
        icon = 'link'
        template = 'article/blocks/paragraph_with_page.html'
        label = 'Page reference with text'
Beispiel #8
0
class ImageWithQuoteAndParagraphBlock(blocks.StructBlock):
    image = ImageWithCaptionAndHeightBlock(required=True)
    align_image = blocks.ChoiceBlock(choices=ALIGNMENT_CHOICES,
                                     default=ALIGNMENT_CHOICES[0][0])
    content_1 = PargraphBlockWithOptionalContent(required=False)
    quote = FullWidthBlockQuote(required=True)
    content_2 = PargraphBlockWithOptionalContent(required=False)

    class Meta:
        icon = "image"
        label = 'Image with quote and text'
        template = 'article/blocks/image_with_quote_and_paragraph.html'
Beispiel #9
0
class VideoWithQuoteBlock(blocks.StructBlock):
    video = EmbedBlock(help_text="YouTube video URL")
    video_caption = CustomRichTextBlock(editor='hallo_for_quote',
                                        required=False)
    quote = CustomRichTextBlock(editor='hallo_for_quote')
    align_quote = blocks.ChoiceBlock(choices=ALIGNMENT_CHOICES,
                                     default=ALIGNMENT_CHOICES[0][1])

    class Meta:
        icon = 'openquote'
        label = 'Video with quote'
        template = 'article/blocks/video_with_block_quote.html'
Beispiel #10
0
class ParagraphWithRawEmbedBlock(blocks.StructBlock):
    embed = RawHTMLBlock(help_text="Embed HTML code(an iframe)")
    embed_caption = CustomRichTextBlock(editor='hallo_for_quote',
                                        required=False)
    embed_align = blocks.ChoiceBlock(choices=ALIGNMENT_CHOICES,
                                     default=ALIGNMENT_CHOICES[0][0])
    content = PargraphBlockWithOptionalContent(required=False)

    class Meta:
        icon = 'media'
        label = 'Raw embed with text'
        template = 'article/blocks/paragraph_with_raw_embed.html'
Beispiel #11
0
class ParagraphWithEmbedBlock(blocks.StructBlock):
    embed = EmbedBlock()
    embed_caption = CustomRichTextBlock(editor='hallo_for_quote',
                                        required=False)
    embed_max_width = IntegerBlock(
        required=False,
        help_text="Optional field. Maximum width of the content in pixels to"
        " be requested from the content provider(e.g YouTube). "
        "If the requested width is not supported, provider will be"
        " supplying the content with nearest available width.")
    embed_align = blocks.ChoiceBlock(choices=ALIGNMENT_CHOICES,
                                     default=ALIGNMENT_CHOICES[0][0])
    content = ParagraphBlock()

    class Meta:
        icon = 'media'
        label = 'Embed with text'
        template = 'article/blocks/paragraph_with_embed.html'