diff --git a/cms_pages/migrations/0018_auto_20170116_1050.py b/cms_pages/migrations/0018_auto_20170116_1050.py new file mode 100644 index 00000000..025bb864 --- /dev/null +++ b/cms_pages/migrations/0018_auto_20170116_1050.py @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.7 on 2017-01-15 23:50 +from __future__ import unicode_literals + +import cms_pages.models +from django.db import migrations, models +import wagtail.wagtailcore.blocks +import wagtail.wagtailcore.fields +import wagtail.wagtailimages.blocks + + +class Migration(migrations.Migration): + + dependencies = [ + ('cms_pages', '0017_auto_20160918_0945_squashed_0018_auto_20160919_0125_squashed_0018_auto_20160919_0134'), + ] + + operations = [ + migrations.AlterField( + model_name='contentpage', + name='inset_illustration', + field=models.CharField(choices=[('antarctica.svg', 'Antarctica'), ('bridge.svg', 'Bridge'), ('casino.svg', 'Casino'), ('cradle.svg', 'Cradle Mountain'), ('devil.svg', 'Tasmanian Devil'), ('falls.svg', 'Waterfall'), ('hobart.svg', 'Hobart'), ('lavender.svg', 'Lavender'), ('logo-mel.png', 'Pycon AU'), ('Python-logo-notext.svg', 'Python'), ('tuz.svg', 'Tuz'), ('wineglass.svg', 'Wineglass')], max_length=256), + ), + migrations.AlterField( + model_name='homepage', + name='body', + field=wagtail.wagtailcore.fields.StreamField([('basic_content', wagtail.wagtailcore.blocks.StructBlock([(b'panel_type', wagtail.wagtailcore.blocks.ChoiceBlock(choices=[('blue_left', 'Left-aligned image, blue-filtered image BG'), ('white_right', 'Right-aligned image, white background')])), (b'heading', wagtail.wagtailcore.blocks.CharBlock(required=True)), (b'inset_illustration', wagtail.wagtailcore.blocks.ChoiceBlock(choices=[('antarctica.svg', 'Antarctica'), ('bridge.svg', 'Bridge'), ('casino.svg', 'Casino'), ('cradle.svg', 'Cradle Mountain'), ('devil.svg', 'Tasmanian Devil'), ('falls.svg', 'Waterfall'), ('hobart.svg', 'Hobart'), ('lavender.svg', 'Lavender'), ('logo-mel.png', 'Pycon AU'), ('Python-logo-notext.svg', 'Python'), ('tuz.svg', 'Tuz'), ('wineglass.svg', 'Wineglass')])), (b'background_image', wagtail.wagtailimages.blocks.ImageChooserBlock(help_text="This is used as the background image of a blue-left block. It's not used for white-right.", required=False)), (b'body', wagtail.wagtailcore.blocks.RawHTMLBlock(required=True)), (b'link', wagtail.wagtailcore.blocks.StructBlock([(b'page', wagtail.wagtailcore.blocks.PageChooserBlock(help_text='You must specify either this, or the URL.', required=False)), (b'url', wagtail.wagtailcore.blocks.CharBlock(help_text='You must specify either this, or the URL.', required=False)), (b'title', wagtail.wagtailcore.blocks.CharBlock(required=True))])), (b'external_links', wagtail.wagtailcore.blocks.ListBlock(cms_pages.models.ExternalLinksBlock)), (b'compact', wagtail.wagtailcore.blocks.BooleanBlock(help_text="True if this block is to be displayed in 'compact' mode", required=False))])), ('keynotes', wagtail.wagtailcore.blocks.StructBlock([(b'heading', wagtail.wagtailcore.blocks.CharBlock(required=True)), (b'speakers', wagtail.wagtailcore.blocks.ListBlock(cms_pages.models.KeynoteSpeakerBlock))]))]), + ), + ] diff --git a/cms_pages/migrations/0019_auto_20170116_1334.py b/cms_pages/migrations/0019_auto_20170116_1334.py new file mode 100644 index 00000000..590622f8 --- /dev/null +++ b/cms_pages/migrations/0019_auto_20170116_1334.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.7 on 2017-01-16 02:34 +from __future__ import unicode_literals + +import cms_pages.models +from django.db import migrations +import wagtail.wagtailcore.blocks +import wagtail.wagtailcore.fields +import wagtail.wagtailimages.blocks + + +class Migration(migrations.Migration): + + dependencies = [ + ('cms_pages', '0018_auto_20170116_1050'), + ] + + operations = [ + migrations.AlterField( + model_name='homepage', + name='body', + field=wagtail.wagtailcore.fields.StreamField([('basic_content', wagtail.wagtailcore.blocks.StructBlock([(b'panel_type', wagtail.wagtailcore.blocks.ChoiceBlock(choices=[('simple', 'Simple panel, no image.'), ('blue_left', 'Left-aligned image, blue-filtered image BG'), ('white_right', 'Right-aligned image, white background')])), (b'heading', wagtail.wagtailcore.blocks.CharBlock(required=True)), (b'inset_illustration', wagtail.wagtailcore.blocks.ChoiceBlock(choices=[('antarctica.svg', 'Antarctica'), ('bridge.svg', 'Bridge'), ('casino.svg', 'Casino'), ('cradle.svg', 'Cradle Mountain'), ('devil.svg', 'Tasmanian Devil'), ('falls.svg', 'Waterfall'), ('hobart.svg', 'Hobart'), ('lavender.svg', 'Lavender'), ('logo-mel.png', 'Pycon AU'), ('Python-logo-notext.svg', 'Python'), ('tuz.svg', 'Tuz'), ('wineglass.svg', 'Wineglass')])), (b'background_image', wagtail.wagtailimages.blocks.ImageChooserBlock(help_text="This is used as the background image of a blue-left block. It's not used for white-right.", required=False)), (b'body', wagtail.wagtailcore.blocks.RawHTMLBlock(required=True)), (b'link', wagtail.wagtailcore.blocks.StructBlock([(b'page', wagtail.wagtailcore.blocks.PageChooserBlock(help_text='You must specify either this, or the URL.', required=False)), (b'url', wagtail.wagtailcore.blocks.CharBlock(help_text='You must specify either this, or the URL.', required=False)), (b'title', wagtail.wagtailcore.blocks.CharBlock(required=True))])), (b'external_links', wagtail.wagtailcore.blocks.ListBlock(cms_pages.models.ExternalLinksBlock)), (b'compact', wagtail.wagtailcore.blocks.BooleanBlock(help_text="True if this block is to be displayed in 'compact' mode", required=False))])), ('keynotes', wagtail.wagtailcore.blocks.StructBlock([(b'heading', wagtail.wagtailcore.blocks.CharBlock(required=True)), (b'speakers', wagtail.wagtailcore.blocks.ListBlock(cms_pages.models.KeynoteSpeakerBlock))]))]), + ), + ] diff --git a/cms_pages/models.py b/cms_pages/models.py index 90e71767..ba46acf3 100644 --- a/cms_pages/models.py +++ b/cms_pages/models.py @@ -106,9 +106,11 @@ class BasicContentBlock(blocks.StructBlock): class Meta: template = "cms_pages/home_page_blocks/basic_content.html" + PANEL_SIMPLE = "simple" PANEL_BLUE_LEFT = "blue_left" PANEL_WHITE_RIGHT = "white_right" PANEL_TYPES = ( + (PANEL_SIMPLE, "Simple panel, no image."), (PANEL_BLUE_LEFT, "Left-aligned image, blue-filtered image BG"), (PANEL_WHITE_RIGHT, "Right-aligned image, white background"), ) @@ -127,7 +129,8 @@ class BasicContentBlock(blocks.StructBlock): help_text="This is used as the background image of a " "blue-left block. It's not used for white-right." ) - body = blocks.RichTextBlock(required=True) + #body = blocks.RichTextBlock(required=True) + body = blocks.RawHTMLBlock(required=True) link = BasicContentLink() external_links = blocks.ListBlock(ExternalLinksBlock) compact = blocks.BooleanBlock( diff --git a/pinaxcon/templates/cms_pages/home_page_blocks/basic_content.html b/pinaxcon/templates/cms_pages/home_page_blocks/basic_content.html index 304035b2..502d3113 100644 --- a/pinaxcon/templates/cms_pages/home_page_blocks/basic_content.html +++ b/pinaxcon/templates/cms_pages/home_page_blocks/basic_content.html @@ -9,8 +9,15 @@ {% define "" as compact %} {% endif %} +{% if value.panel_type == "simple" %} -{% if value.panel_type == "blue_left" %} + {% comment %} + {% include "cms_pages/home_page_blocks/basic_content_text_and_links.html" %} + {% endcomment %} + + {{ value.body }} + +{% elif value.panel_type == "blue_left" %}
{{ value.body }}
+ +{% block header_paragraph %}{% endblock %}
-{% block header_paragraph %}{% endblock %}