diff --git a/apps/cms/blocks.py b/apps/cms/blocks.py index fa2fb471e..8d48f81b6 100644 --- a/apps/cms/blocks.py +++ b/apps/cms/blocks.py @@ -15,6 +15,7 @@ class Meta: icon = 'plus-inverse' +# 1-col, img, richtext, CTA btn class ImageCTABlock(blocks.StructBlock): image = ImageChooserBlock(required=False) body = blocks.RichTextBlock(required=False) @@ -28,23 +29,7 @@ class Meta: icon = 'view' -# 2-col, headline, text, CTA btn, background colors, text colors -class ColumnsImageCTABlock(blocks.StructBlock): - columns_count = blocks.ChoiceBlock(choices=[ - (1, 'One column'), - (2, 'Two columns') - - ], default=2) - - columns = blocks.ListBlock( - ImageCTABlock(label='List and Image') - ) - - class Meta: - template = 'a4_candy_cms_pages/blocks/col_img_cta_block.html' - icon = 'list-ul' - - +# 2-col, richtext, CTA btn, background colour class ColBackgroundCTABlock(blocks.StructBlock): columns_count = blocks.ChoiceBlock(choices=[ (1, 'One column'), @@ -61,8 +46,7 @@ class Meta: icon = 'tick-inverse' -# 3 column block with an optional button/link for each col, -# Call-to-action block can have up to 3 big CTA btn +# 1-3 col, optional richtext, link cta class ColumnsCTABlock(blocks.StructBlock): columns_count = blocks.ChoiceBlock(choices=[ (1, 'One column'), diff --git a/apps/cms/pages/migrations/0011_auto_20220616_1529.py b/apps/cms/pages/migrations/0011_auto_20220616_1529.py new file mode 100644 index 000000000..32e3c2e8b --- /dev/null +++ b/apps/cms/pages/migrations/0011_auto_20220616_1529.py @@ -0,0 +1,52 @@ +# Generated by Django 3.2.13 on 2022-06-16 13:29 + +import apps.cms.blocks +from django.db import migrations +import wagtail.blocks +import wagtail.fields +import wagtail.images.blocks + + +class Migration(migrations.Migration): + + dependencies = [ + ('a4_candy_cms_pages', '0010_auto_20220614_1427'), + ] + + operations = [ + migrations.AlterField( + model_name='homepage', + name='body_streamfield_de', + field=wagtail.fields.StreamField([('background_cta_block', wagtail.blocks.StructBlock([('columns_count', wagtail.blocks.ChoiceBlock(choices=[(1, 'One column'), (2, 'Two columns')])), ('columns', wagtail.blocks.ListBlock(wagtail.blocks.StructBlock([('body', wagtail.blocks.RichTextBlock(required=False)), ('link', wagtail.blocks.CharBlock(required=False)), ('link_text', wagtail.blocks.CharBlock(label='Link Text', max_length=50, required=False))], label='CTA with Background')))])), ('columns_cta', wagtail.blocks.StructBlock([('columns_count', wagtail.blocks.ChoiceBlock(choices=[(1, 'One column'), (2, 'Two columns'), (3, 'Three columns')])), ('columns', wagtail.blocks.ListBlock(wagtail.blocks.StructBlock([('body', wagtail.blocks.RichTextBlock(required=False)), ('link', wagtail.blocks.CharBlock(required=False)), ('link_text', wagtail.blocks.CharBlock(label='Link Text', max_length=50, required=False))], label='CTA Column')))])), ('html', wagtail.blocks.RawHTMLBlock()), ('paragraph', wagtail.blocks.RichTextBlock()), ('news', wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock()), ('news_page', wagtail.blocks.PageChooserBlock(page_type=['a4_candy_cms_news.NewsIndexPage']))])), ('use_cases', wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock()), ('use_cases', wagtail.blocks.ListBlock(wagtail.blocks.PageChooserBlock(page_type=['a4_candy_cms_use_cases.UseCasePage']))), ('demo_platform', wagtail.blocks.URLBlock()), ('use_case_page', wagtail.blocks.PageChooserBlock(page_type=['a4_candy_cms_use_cases.UseCaseIndexPage']))]))], blank=True, use_json_field=True), + ), + migrations.AlterField( + model_name='homepage', + name='body_streamfield_en', + field=wagtail.fields.StreamField([('background_cta_block', wagtail.blocks.StructBlock([('columns_count', wagtail.blocks.ChoiceBlock(choices=[(1, 'One column'), (2, 'Two columns')])), ('columns', wagtail.blocks.ListBlock(wagtail.blocks.StructBlock([('body', wagtail.blocks.RichTextBlock(required=False)), ('link', wagtail.blocks.CharBlock(required=False)), ('link_text', wagtail.blocks.CharBlock(label='Link Text', max_length=50, required=False))], label='CTA with Background')))])), ('columns_cta', wagtail.blocks.StructBlock([('columns_count', wagtail.blocks.ChoiceBlock(choices=[(1, 'One column'), (2, 'Two columns'), (3, 'Three columns')])), ('columns', wagtail.blocks.ListBlock(wagtail.blocks.StructBlock([('body', wagtail.blocks.RichTextBlock(required=False)), ('link', wagtail.blocks.CharBlock(required=False)), ('link_text', wagtail.blocks.CharBlock(label='Link Text', max_length=50, required=False))], label='CTA Column')))])), ('html', wagtail.blocks.RawHTMLBlock()), ('paragraph', wagtail.blocks.RichTextBlock()), ('news', wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock()), ('news_page', wagtail.blocks.PageChooserBlock(page_type=['a4_candy_cms_news.NewsIndexPage']))])), ('use_cases', wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock()), ('use_cases', wagtail.blocks.ListBlock(wagtail.blocks.PageChooserBlock(page_type=['a4_candy_cms_use_cases.UseCasePage']))), ('demo_platform', wagtail.blocks.URLBlock()), ('use_case_page', wagtail.blocks.PageChooserBlock(page_type=['a4_candy_cms_use_cases.UseCaseIndexPage']))]))], blank=True, use_json_field=True), + ), + migrations.AlterField( + model_name='simplepage', + name='body_streamfield_de', + field=wagtail.fields.StreamField([('html', wagtail.blocks.RawHTMLBlock()), ('richtext', wagtail.blocks.RichTextBlock()), ('image', wagtail.images.blocks.ImageChooserBlock()), ('faq', wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock(required=False)), ('entries', wagtail.blocks.ListBlock(apps.cms.blocks.AccordeonBlock))])), ('image_cta', wagtail.blocks.StructBlock([('image', wagtail.images.blocks.ImageChooserBlock(required=False)), ('body', wagtail.blocks.RichTextBlock(required=False)), ('link', wagtail.blocks.CharBlock(required=False)), ('link_text', wagtail.blocks.CharBlock(label='Link Text', max_length=50, required=False))])), ('columns_cta', wagtail.blocks.StructBlock([('columns_count', wagtail.blocks.ChoiceBlock(choices=[(1, 'One column'), (2, 'Two columns'), (3, 'Three columns')])), ('columns', wagtail.blocks.ListBlock(wagtail.blocks.StructBlock([('body', wagtail.blocks.RichTextBlock(required=False)), ('link', wagtail.blocks.CharBlock(required=False)), ('link_text', wagtail.blocks.CharBlock(label='Link Text', max_length=50, required=False))], label='CTA Column')))])), ('downloads', wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock(required=False)), ('documents', wagtail.blocks.ListBlock(apps.cms.blocks.DownloadBlock))])), ('quote', wagtail.blocks.StructBlock([('color', wagtail.blocks.ChoiceBlock(choices=[('turquoise', 'turquoise'), ('blue', 'dark blue')])), ('image', wagtail.images.blocks.ImageChooserBlock()), ('quote', wagtail.blocks.TextBlock()), ('quote_author', wagtail.blocks.CharBlock(required=False)), ('link', wagtail.blocks.URLBlock(required=False)), ('link_text', wagtail.blocks.CharBlock(label='Link Text', max_length=50, required=False))]))], use_json_field=True), + ), + migrations.AlterField( + model_name='simplepage', + name='body_streamfield_en', + field=wagtail.fields.StreamField([('html', wagtail.blocks.RawHTMLBlock()), ('richtext', wagtail.blocks.RichTextBlock()), ('image', wagtail.images.blocks.ImageChooserBlock()), ('faq', wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock(required=False)), ('entries', wagtail.blocks.ListBlock(apps.cms.blocks.AccordeonBlock))])), ('image_cta', wagtail.blocks.StructBlock([('image', wagtail.images.blocks.ImageChooserBlock(required=False)), ('body', wagtail.blocks.RichTextBlock(required=False)), ('link', wagtail.blocks.CharBlock(required=False)), ('link_text', wagtail.blocks.CharBlock(label='Link Text', max_length=50, required=False))])), ('columns_cta', wagtail.blocks.StructBlock([('columns_count', wagtail.blocks.ChoiceBlock(choices=[(1, 'One column'), (2, 'Two columns'), (3, 'Three columns')])), ('columns', wagtail.blocks.ListBlock(wagtail.blocks.StructBlock([('body', wagtail.blocks.RichTextBlock(required=False)), ('link', wagtail.blocks.CharBlock(required=False)), ('link_text', wagtail.blocks.CharBlock(label='Link Text', max_length=50, required=False))], label='CTA Column')))])), ('downloads', wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock(required=False)), ('documents', wagtail.blocks.ListBlock(apps.cms.blocks.DownloadBlock))])), ('quote', wagtail.blocks.StructBlock([('color', wagtail.blocks.ChoiceBlock(choices=[('turquoise', 'turquoise'), ('blue', 'dark blue')])), ('image', wagtail.images.blocks.ImageChooserBlock()), ('quote', wagtail.blocks.TextBlock()), ('quote_author', wagtail.blocks.CharBlock(required=False)), ('link', wagtail.blocks.URLBlock(required=False)), ('link_text', wagtail.blocks.CharBlock(label='Link Text', max_length=50, required=False))]))], blank=True, use_json_field=True), + ), + migrations.AlterField( + model_name='simplepage', + name='body_streamfield_ky', + field=wagtail.fields.StreamField([('html', wagtail.blocks.RawHTMLBlock()), ('richtext', wagtail.blocks.RichTextBlock()), ('image', wagtail.images.blocks.ImageChooserBlock()), ('faq', wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock(required=False)), ('entries', wagtail.blocks.ListBlock(apps.cms.blocks.AccordeonBlock))])), ('image_cta', wagtail.blocks.StructBlock([('image', wagtail.images.blocks.ImageChooserBlock(required=False)), ('body', wagtail.blocks.RichTextBlock(required=False)), ('link', wagtail.blocks.CharBlock(required=False)), ('link_text', wagtail.blocks.CharBlock(label='Link Text', max_length=50, required=False))])), ('columns_cta', wagtail.blocks.StructBlock([('columns_count', wagtail.blocks.ChoiceBlock(choices=[(1, 'One column'), (2, 'Two columns'), (3, 'Three columns')])), ('columns', wagtail.blocks.ListBlock(wagtail.blocks.StructBlock([('body', wagtail.blocks.RichTextBlock(required=False)), ('link', wagtail.blocks.CharBlock(required=False)), ('link_text', wagtail.blocks.CharBlock(label='Link Text', max_length=50, required=False))], label='CTA Column')))])), ('downloads', wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock(required=False)), ('documents', wagtail.blocks.ListBlock(apps.cms.blocks.DownloadBlock))])), ('quote', wagtail.blocks.StructBlock([('color', wagtail.blocks.ChoiceBlock(choices=[('turquoise', 'turquoise'), ('blue', 'dark blue')])), ('image', wagtail.images.blocks.ImageChooserBlock()), ('quote', wagtail.blocks.TextBlock()), ('quote_author', wagtail.blocks.CharBlock(required=False)), ('link', wagtail.blocks.URLBlock(required=False)), ('link_text', wagtail.blocks.CharBlock(label='Link Text', max_length=50, required=False))]))], blank=True, use_json_field=True), + ), + migrations.AlterField( + model_name='simplepage', + name='body_streamfield_nl', + field=wagtail.fields.StreamField([('html', wagtail.blocks.RawHTMLBlock()), ('richtext', wagtail.blocks.RichTextBlock()), ('image', wagtail.images.blocks.ImageChooserBlock()), ('faq', wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock(required=False)), ('entries', wagtail.blocks.ListBlock(apps.cms.blocks.AccordeonBlock))])), ('image_cta', wagtail.blocks.StructBlock([('image', wagtail.images.blocks.ImageChooserBlock(required=False)), ('body', wagtail.blocks.RichTextBlock(required=False)), ('link', wagtail.blocks.CharBlock(required=False)), ('link_text', wagtail.blocks.CharBlock(label='Link Text', max_length=50, required=False))])), ('columns_cta', wagtail.blocks.StructBlock([('columns_count', wagtail.blocks.ChoiceBlock(choices=[(1, 'One column'), (2, 'Two columns'), (3, 'Three columns')])), ('columns', wagtail.blocks.ListBlock(wagtail.blocks.StructBlock([('body', wagtail.blocks.RichTextBlock(required=False)), ('link', wagtail.blocks.CharBlock(required=False)), ('link_text', wagtail.blocks.CharBlock(label='Link Text', max_length=50, required=False))], label='CTA Column')))])), ('downloads', wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock(required=False)), ('documents', wagtail.blocks.ListBlock(apps.cms.blocks.DownloadBlock))])), ('quote', wagtail.blocks.StructBlock([('color', wagtail.blocks.ChoiceBlock(choices=[('turquoise', 'turquoise'), ('blue', 'dark blue')])), ('image', wagtail.images.blocks.ImageChooserBlock()), ('quote', wagtail.blocks.TextBlock()), ('quote_author', wagtail.blocks.CharBlock(required=False)), ('link', wagtail.blocks.URLBlock(required=False)), ('link_text', wagtail.blocks.CharBlock(label='Link Text', max_length=50, required=False))]))], blank=True, use_json_field=True), + ), + migrations.AlterField( + model_name='simplepage', + name='body_streamfield_ru', + field=wagtail.fields.StreamField([('html', wagtail.blocks.RawHTMLBlock()), ('richtext', wagtail.blocks.RichTextBlock()), ('image', wagtail.images.blocks.ImageChooserBlock()), ('faq', wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock(required=False)), ('entries', wagtail.blocks.ListBlock(apps.cms.blocks.AccordeonBlock))])), ('image_cta', wagtail.blocks.StructBlock([('image', wagtail.images.blocks.ImageChooserBlock(required=False)), ('body', wagtail.blocks.RichTextBlock(required=False)), ('link', wagtail.blocks.CharBlock(required=False)), ('link_text', wagtail.blocks.CharBlock(label='Link Text', max_length=50, required=False))])), ('columns_cta', wagtail.blocks.StructBlock([('columns_count', wagtail.blocks.ChoiceBlock(choices=[(1, 'One column'), (2, 'Two columns'), (3, 'Three columns')])), ('columns', wagtail.blocks.ListBlock(wagtail.blocks.StructBlock([('body', wagtail.blocks.RichTextBlock(required=False)), ('link', wagtail.blocks.CharBlock(required=False)), ('link_text', wagtail.blocks.CharBlock(label='Link Text', max_length=50, required=False))], label='CTA Column')))])), ('downloads', wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock(required=False)), ('documents', wagtail.blocks.ListBlock(apps.cms.blocks.DownloadBlock))])), ('quote', wagtail.blocks.StructBlock([('color', wagtail.blocks.ChoiceBlock(choices=[('turquoise', 'turquoise'), ('blue', 'dark blue')])), ('image', wagtail.images.blocks.ImageChooserBlock()), ('quote', wagtail.blocks.TextBlock()), ('quote_author', wagtail.blocks.CharBlock(required=False)), ('link', wagtail.blocks.URLBlock(required=False)), ('link_text', wagtail.blocks.CharBlock(label='Link Text', max_length=50, required=False))]))], blank=True, use_json_field=True), + ), + ] diff --git a/apps/cms/pages/models.py b/apps/cms/pages/models.py index ee23fb6e8..63baf57db 100644 --- a/apps/cms/pages/models.py +++ b/apps/cms/pages/models.py @@ -92,7 +92,6 @@ class HomePage(Page): body_en = fields.RichTextField(blank=True) body_streamfield_de = fields.StreamField([ - ('col_list_image_cta_block', cms_blocks.ColumnsImageCTABlock()), ('background_cta_block', cms_blocks.ColBackgroundCTABlock()), ('columns_cta', cms_blocks.ColumnsCTABlock()), ('html', blocks.RawHTMLBlock()), @@ -102,7 +101,6 @@ class HomePage(Page): ], use_json_field=True, blank=True) body_streamfield_en = fields.StreamField([ - ('col_list_image_cta_block', cms_blocks.ColumnsImageCTABlock()), ('background_cta_block', cms_blocks.ColBackgroundCTABlock()), ('columns_cta', cms_blocks.ColumnsCTABlock()), ('html', blocks.RawHTMLBlock()), @@ -197,7 +195,6 @@ class SimplePage(Page): ('image', ImageChooserBlock()), ('faq', cms_blocks.AccordeonListBlock()), ('image_cta', cms_blocks.ImageCTABlock()), - ('col_list_image_cta_block', cms_blocks.ColumnsImageCTABlock()), ('columns_cta', cms_blocks.ColumnsCTABlock()), ('downloads', cms_blocks.DownloadListBlock()), ('quote', cms_blocks.QuoteBlock()) @@ -208,7 +205,6 @@ class SimplePage(Page): ('image', ImageChooserBlock()), ('faq', cms_blocks.AccordeonListBlock()), ('image_cta', cms_blocks.ImageCTABlock()), - ('col_list_image_cta_block', cms_blocks.ColumnsImageCTABlock()), ('columns_cta', cms_blocks.ColumnsCTABlock()), ('downloads', cms_blocks.DownloadListBlock()), ('quote', cms_blocks.QuoteBlock()) @@ -220,7 +216,6 @@ class SimplePage(Page): ('image', ImageChooserBlock()), ('faq', cms_blocks.AccordeonListBlock()), ('image_cta', cms_blocks.ImageCTABlock()), - ('col_list_image_cta_block', cms_blocks.ColumnsImageCTABlock()), ('columns_cta', cms_blocks.ColumnsCTABlock()), ('downloads', cms_blocks.DownloadListBlock()), ('quote', cms_blocks.QuoteBlock()) @@ -232,7 +227,6 @@ class SimplePage(Page): ('image', ImageChooserBlock()), ('faq', cms_blocks.AccordeonListBlock()), ('image_cta', cms_blocks.ImageCTABlock()), - ('col_list_image_cta_block', cms_blocks.ColumnsImageCTABlock()), ('columns_cta', cms_blocks.ColumnsCTABlock()), ('downloads', cms_blocks.DownloadListBlock()), ('quote', cms_blocks.QuoteBlock()) @@ -244,7 +238,6 @@ class SimplePage(Page): ('image', ImageChooserBlock()), ('faq', cms_blocks.AccordeonListBlock()), ('image_cta', cms_blocks.ImageCTABlock()), - ('col_list_image_cta_block', cms_blocks.ColumnsImageCTABlock()), ('columns_cta', cms_blocks.ColumnsCTABlock()), ('downloads', cms_blocks.DownloadListBlock()), ('quote', cms_blocks.QuoteBlock()) diff --git a/apps/cms/pages/templates/a4_candy_cms_pages/blocks/col_img_cta_block.html b/apps/cms/pages/templates/a4_candy_cms_pages/blocks/col_img_cta_block.html deleted file mode 100644 index dd6a7e494..000000000 --- a/apps/cms/pages/templates/a4_candy_cms_pages/blocks/col_img_cta_block.html +++ /dev/null @@ -1,18 +0,0 @@ -{% load wagtailcore_tags wagtailimages_tags %} - -