diff --git a/cms_pages/__init__.py b/cms_pages/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/cms_pages/admin.py b/cms_pages/admin.py deleted file mode 100644 index 8c38f3f3..00000000 --- a/cms_pages/admin.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.contrib import admin - -# Register your models here. diff --git a/cms_pages/apps.py b/cms_pages/apps.py deleted file mode 100644 index b064fef4..00000000 --- a/cms_pages/apps.py +++ /dev/null @@ -1,7 +0,0 @@ -from __future__ import unicode_literals - -from django.apps import AppConfig - - -class CmsPagesConfig(AppConfig): - name = 'cms_pages' diff --git a/cms_pages/migrations/0001_initial.py b/cms_pages/migrations/0001_initial.py deleted file mode 100644 index f36b0889..00000000 --- a/cms_pages/migrations/0001_initial.py +++ /dev/null @@ -1,75 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-09-17 03:33 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion -import wagtail.wagtailcore.blocks -import wagtail.wagtailcore.fields -import wagtail.wagtailimages.blocks - - -class Migration(migrations.Migration): - - initial = True - - dependencies = [ - ('wagtailcore', '0028_merge'), - ('wagtailimages', '0013_make_rendition_upload_callable'), - ] - - operations = [ - migrations.CreateModel( - name='ContentPage', - fields=[ - ('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.Page')), - ('intro', models.CharField(max_length=250)), - ('body', wagtail.wagtailcore.fields.RichTextField(blank=True)), - ('inset_illustration', 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'), ('tuz.svg', 'Tuz'), ('wineglass.svg', 'Wineglass')], max_length=256)), - ('background_image', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.Image')), - ], - options={ - 'abstract': False, - }, - bases=('wagtailcore.page',), - ), - migrations.CreateModel( - name='HomePage', - fields=[ - ('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.Page')), - ('body', 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'), ('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.RichTextBlock(required=True)), (b'link', wagtail.wagtailcore.blocks.StructBlock([('page', wagtail.wagtailcore.blocks.PageChooserBlock()), ('title', wagtail.wagtailcore.blocks.CharBlock(required=True))])), (b'external_links', wagtail.wagtailcore.blocks.ListBlock(wagtail.wagtailcore.blocks.StructBlock([('alt', wagtail.wagtailcore.blocks.CharBlock(required=True)), ('icon', wagtail.wagtailcore.blocks.ChoiceBlock(choices=[('twitter', 'Twitter'), ('facebook', 'Facebook'), ('generic', 'Generic URL')])), ('url', wagtail.wagtailcore.blocks.URLBlock(required=True))])))]))])), - ], - options={ - 'abstract': False, - }, - bases=('wagtailcore.page',), - ), - migrations.CreateModel( - name='NewsIndexPage', - fields=[ - ('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.Page')), - ('intro', models.CharField(max_length=250)), - ('body', wagtail.wagtailcore.fields.RichTextField(blank=True)), - ('background_image', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.Image')), - ], - options={ - 'abstract': False, - }, - bases=('wagtailcore.page',), - ), - migrations.CreateModel( - name='NewsPage', - fields=[ - ('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.Page')), - ('intro', models.CharField(max_length=250)), - ('body', wagtail.wagtailcore.fields.RichTextField(blank=True)), - ('date', models.DateField(verbose_name='Post date')), - ('background_image', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.Image')), - ('portrait_image', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.Image')), - ], - options={ - 'abstract': False, - }, - bases=('wagtailcore.page',), - ), - ] diff --git a/cms_pages/migrations/0006_auto_20160916_0317.py b/cms_pages/migrations/0006_auto_20160916_0317.py deleted file mode 100644 index 77079394..00000000 --- a/cms_pages/migrations/0006_auto_20160916_0317.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-09-16 03:17 -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', '0001_initial'), - ] - - 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=[('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'), ('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.RichTextBlock(required=True)), (b'link', wagtail.wagtailcore.blocks.StructBlock([('page', wagtail.wagtailcore.blocks.PageChooserBlock()), ('title', wagtail.wagtailcore.blocks.CharBlock(required=True))])), (b'external_links', wagtail.wagtailcore.blocks.ListBlock(cms_pages.models.ExternalLinksBlock))])), ('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/0007_auto_20160916_0417.py b/cms_pages/migrations/0007_auto_20160916_0417.py deleted file mode 100644 index 28b0db66..00000000 --- a/cms_pages/migrations/0007_auto_20160916_0417.py +++ /dev/null @@ -1,32 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-09-16 04:17 -from __future__ import unicode_literals - -from django.db import migrations -import wagtail.wagtailcore.blocks -import wagtail.wagtailcore.fields - - -class Migration(migrations.Migration): - - dependencies = [ - ('cms_pages', '0006_auto_20160916_0317'), - ] - - operations = [ - migrations.AlterField( - model_name='contentpage', - name='body', - field=wagtail.wagtailcore.fields.StreamField([('rich_text', wagtail.wagtailcore.blocks.RichTextBlock(required=False))]), - ), - migrations.AlterField( - model_name='newsindexpage', - name='body', - field=wagtail.wagtailcore.fields.StreamField([('rich_text', wagtail.wagtailcore.blocks.RichTextBlock(required=False))]), - ), - migrations.AlterField( - model_name='newspage', - name='body', - field=wagtail.wagtailcore.fields.StreamField([('rich_text', wagtail.wagtailcore.blocks.RichTextBlock(required=False))]), - ), - ] diff --git a/cms_pages/migrations/0008_auto_20160916_0417.py b/cms_pages/migrations/0008_auto_20160916_0417.py deleted file mode 100644 index 62847be7..00000000 --- a/cms_pages/migrations/0008_auto_20160916_0417.py +++ /dev/null @@ -1,52 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models, migrations -from wagtail.wagtailcore.rich_text import RichText - - -models = ["ContentPage", "NewsIndexPage", "NewsPage", ] - - -def convert_to_streamfield(apps, schema_editor): - for model_name in models: - _convert_to_streamfield(apps, model_name) - - -def _convert_to_streamfield(apps, model_name): - Model = apps.get_model("cms_pages", model_name) - for page in Model.objects.all(): - if page.body.raw_text and not page.body: - page.body = [('rich_text', RichText(page.body.raw_text))] - page.save() - - -def convert_to_richtext(apps, schema_editor): - for model_name in models: - _convert_to_richtext(apps, model_name) - - -def _convert_to_richtext(apps, model_name): - Model = apps.get_model("cms_pages", model_name) - for page in Model.objects.all(): - if page.body.raw_text is None: - raw_text = ''.join([ - child.value.source for child in page.body - if child.block_type == 'rich_text' - ]) - page.body = raw_text - page.save() - - -class Migration(migrations.Migration): - - dependencies = [ - ('cms_pages', '0007_auto_20160916_0417'), - ] - - operations = [ - migrations.RunPython( - convert_to_streamfield, - convert_to_richtext, - ), - ] diff --git a/cms_pages/migrations/0009_auto_20160916_0503.py b/cms_pages/migrations/0009_auto_20160916_0503.py deleted file mode 100644 index 5911ddc3..00000000 --- a/cms_pages/migrations/0009_auto_20160916_0503.py +++ /dev/null @@ -1,32 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-09-16 05:03 -from __future__ import unicode_literals - -from django.db import migrations -import wagtail.wagtailcore.blocks -import wagtail.wagtailcore.fields - - -class Migration(migrations.Migration): - - dependencies = [ - ('cms_pages', '0008_auto_20160916_0417'), - ] - - operations = [ - migrations.AlterField( - model_name='contentpage', - name='body', - field=wagtail.wagtailcore.fields.StreamField([('rich_text', wagtail.wagtailcore.blocks.RichTextBlock(required=False)), ('raw_html', wagtail.wagtailcore.blocks.RawHTMLBlock(required=False))]), - ), - migrations.AlterField( - model_name='newsindexpage', - name='body', - field=wagtail.wagtailcore.fields.StreamField([('rich_text', wagtail.wagtailcore.blocks.RichTextBlock(required=False)), ('raw_html', wagtail.wagtailcore.blocks.RawHTMLBlock(required=False))]), - ), - migrations.AlterField( - model_name='newspage', - name='body', - field=wagtail.wagtailcore.fields.StreamField([('rich_text', wagtail.wagtailcore.blocks.RichTextBlock(required=False)), ('raw_html', wagtail.wagtailcore.blocks.RawHTMLBlock(required=False))]), - ), - ] diff --git a/cms_pages/migrations/0010_auto_20160916_0729.py b/cms_pages/migrations/0010_auto_20160916_0729.py deleted file mode 100644 index 111ea7a9..00000000 --- a/cms_pages/migrations/0010_auto_20160916_0729.py +++ /dev/null @@ -1,33 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-09-16 07:29 -from __future__ import unicode_literals - -import cms_pages.models -from django.db import migrations -import wagtail.wagtailcore.blocks -import wagtail.wagtailcore.fields - - -class Migration(migrations.Migration): - - dependencies = [ - ('cms_pages', '0009_auto_20160916_0503'), - ] - - operations = [ - migrations.AlterField( - model_name='contentpage', - name='body', - field=wagtail.wagtailcore.fields.StreamField([('rich_text', wagtail.wagtailcore.blocks.RichTextBlock(required=False)), ('raw_html', wagtail.wagtailcore.blocks.RawHTMLBlock(required=False)), ('floating_image', cms_pages.models.FloatingImageBlock()), ('anchor', cms_pages.models.AnchorBlock(help_text='Add a named anchor to this point in the page'))]), - ), - migrations.AlterField( - model_name='newsindexpage', - name='body', - field=wagtail.wagtailcore.fields.StreamField([('rich_text', wagtail.wagtailcore.blocks.RichTextBlock(required=False)), ('raw_html', wagtail.wagtailcore.blocks.RawHTMLBlock(required=False)), ('floating_image', cms_pages.models.FloatingImageBlock()), ('anchor', cms_pages.models.AnchorBlock(help_text='Add a named anchor to this point in the page'))]), - ), - migrations.AlterField( - model_name='newspage', - name='body', - field=wagtail.wagtailcore.fields.StreamField([('rich_text', wagtail.wagtailcore.blocks.RichTextBlock(required=False)), ('raw_html', wagtail.wagtailcore.blocks.RawHTMLBlock(required=False)), ('floating_image', cms_pages.models.FloatingImageBlock()), ('anchor', cms_pages.models.AnchorBlock(help_text='Add a named anchor to this point in the page'))]), - ), - ] diff --git a/cms_pages/migrations/0011_scheduleheaderparagraph_squashed_0012_auto_20160918_0141.py b/cms_pages/migrations/0011_scheduleheaderparagraph_squashed_0012_auto_20160918_0141.py deleted file mode 100644 index 6b7cd669..00000000 --- a/cms_pages/migrations/0011_scheduleheaderparagraph_squashed_0012_auto_20160918_0141.py +++ /dev/null @@ -1,27 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-09-18 01:56 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - replaces = [(b'cms_pages', '0011_scheduleheaderparagraph'), (b'cms_pages', '0012_auto_20160918_0141')] - - dependencies = [ - ('cms_pages', '0010_auto_20160916_0729'), - ('symposion_schedule', '0002_presentation_unpublish'), - ] - - operations = [ - migrations.CreateModel( - name='ScheduleHeaderParagraph', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('text', models.TextField()), - ('schedule', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='header_paragraph', to='symposion_schedule.Schedule')), - ], - ), - ] diff --git a/cms_pages/migrations/0012_namedheaderparagraph.py b/cms_pages/migrations/0012_namedheaderparagraph.py deleted file mode 100644 index 868a20f7..00000000 --- a/cms_pages/migrations/0012_namedheaderparagraph.py +++ /dev/null @@ -1,23 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-09-18 02:09 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('cms_pages', '0011_scheduleheaderparagraph_squashed_0012_auto_20160918_0141'), - ] - - operations = [ - migrations.CreateModel( - name='NamedHeaderParagraph', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('name', models.CharField(help_text='Pass this name to header_paragraph tag.', max_length=64)), - ('text', models.TextField()), - ], - ), - ] diff --git a/cms_pages/migrations/0013_auto_20160918_0358.py b/cms_pages/migrations/0013_auto_20160918_0358.py deleted file mode 100644 index 45389ea0..00000000 --- a/cms_pages/migrations/0013_auto_20160918_0358.py +++ /dev/null @@ -1,108 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-09-18 03:58 -from __future__ import unicode_literals - -from django.conf import settings -from django.db import migrations, models -import django.db.models.deletion -import taggit.managers -import wagtail.wagtailcore.models -import wagtail.wagtailimages.models -import wagtail.wagtailsearch.index - - -class Migration(migrations.Migration): - - dependencies = [ - ('wagtailcore', '0029_unicode_slugfield_dj19'), - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('wagtailimages', '0013_make_rendition_upload_callable'), - ('taggit', '0002_auto_20150616_2121'), - ('cms_pages', '0012_namedheaderparagraph'), - ] - - operations = [ - migrations.CreateModel( - name='CustomImage', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('title', models.CharField(max_length=255, verbose_name='title')), - ('file', models.ImageField(height_field='height', upload_to=wagtail.wagtailimages.models.get_upload_to, verbose_name='file', width_field='width')), - ('width', models.IntegerField(editable=False, verbose_name='width')), - ('height', models.IntegerField(editable=False, verbose_name='height')), - ('created_at', models.DateTimeField(auto_now_add=True, db_index=True, verbose_name='created at')), - ('focal_point_x', models.PositiveIntegerField(blank=True, null=True)), - ('focal_point_y', models.PositiveIntegerField(blank=True, null=True)), - ('focal_point_width', models.PositiveIntegerField(blank=True, null=True)), - ('focal_point_height', models.PositiveIntegerField(blank=True, null=True)), - ('file_size', models.PositiveIntegerField(editable=False, null=True)), - ('collection', models.ForeignKey(default=wagtail.wagtailcore.models.get_root_collection_id, on_delete=django.db.models.deletion.CASCADE, related_name='+', to='wagtailcore.Collection', verbose_name='collection')), - ('tags', taggit.managers.TaggableManager(blank=True, help_text=None, through='taggit.TaggedItem', to='taggit.Tag', verbose_name='tags')), - ('uploaded_by_user', models.ForeignKey(blank=True, editable=False, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL, verbose_name='uploaded by user')), - ], - options={ - 'abstract': False, - }, - bases=(wagtail.wagtailsearch.index.Indexed, models.Model), - ), - migrations.AddField( - model_name='customimage', - name='author', - field=models.CharField(default='', help_text='The name of the author of the work', max_length=255), - preserve_default=False, - ), - migrations.AddField( - model_name='customimage', - name='copyright_year', - field=models.CharField(default='', help_text='The year the image was taken', max_length=64), - preserve_default=False, - ), - migrations.AddField( - model_name='customimage', - name='licence', - field=models.CharField(default='', help_text='The short-form code for the licence (e.g. CC-BY)', max_length=64), - preserve_default=False, - ), - migrations.AddField( - model_name='customimage', - name='source_url', - field=models.URLField(default='', help_text='The URL where you can find the original of this image'), - preserve_default=False, - ), - migrations.CreateModel( - name='CustomRendition', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('file', models.ImageField(height_field='height', upload_to=wagtail.wagtailimages.models.get_rendition_upload_to, width_field='width')), - ('width', models.IntegerField(editable=False)), - ('height', models.IntegerField(editable=False)), - ('focal_point_key', models.CharField(blank=True, default='', editable=False, max_length=255)), - ('filter', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='+', to='wagtailimages.Filter')), - ('image', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='renditions', to='cms_pages.CustomImage')), - ], - ), - migrations.AddField( - model_name='contentpage', - name='background_image_CUSTOM', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='cms_pages.CustomImage'), - ), - migrations.AddField( - model_name='newsindexpage', - name='background_image_CUSTOM', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='cms_pages.CustomImage'), - ), - migrations.AddField( - model_name='newspage', - name='background_image_CUSTOM', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='cms_pages.CustomImage'), - ), - migrations.AddField( - model_name='newspage', - name='portrait_image_CUSTOM', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='cms_pages.CustomImage'), - ), - migrations.AlterUniqueTogether( - name='customrendition', - unique_together=set([('image', 'filter', 'focal_point_key')]), - ), - ] diff --git a/cms_pages/migrations/0014_auto_20160918_0358.py b/cms_pages/migrations/0014_auto_20160918_0358.py deleted file mode 100644 index b8a79102..00000000 --- a/cms_pages/migrations/0014_auto_20160918_0358.py +++ /dev/null @@ -1,76 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-09-18 03:58 -from __future__ import unicode_literals - -from django.db import migrations - - -def image_to_custom_image(apps, schema_editor): - Image = apps.get_model("wagtailimages","Image") - CustomImage = apps.get_model("cms_pages", "CustomImage") - HomePage = apps.get_model("cms_pages", "HomePage") - #tags = TaggableManager(help_text=None, blank=True, verbose_name=_('tags')) - - keys = ( - "title", "file", "width", "height", "created_at", "uploaded_by_user", - "focal_point_y", "focal_point_x", "focal_point_width", - "focal_point_height", "file_size", - ) - - customs = {} - - for image in Image.objects.all(): - kwargs = dict((key, getattr(image, key)) for key in keys) - custom_image = CustomImage(**kwargs) - - # Does this actually work?! - custom_image.tags = image.tags - - custom_image.save() - - customs[image.id] = custom_image - - def swap(customs, block, key): - im = (block.value[key]) - if im is not None: - block.value[key] = customs[im.id] - - # Go through the links. - for page in HomePage.objects.all(): - for block in page.body: - if block.block_type == "basic_content": - swap(customs, block, "background_image") - elif block.block_type == "keynotes": - for keynote in block.value: - swap(customs, keynote, "profile_image") - page.save() - - abstract_content_page_models = ["ContentPage", "NewsIndexPage", "NewsPage"] - - for model in abstract_content_page_models: - Model = apps.get_model("cms_pages", model) - - for page in Model.objects.all(): - for block in page.body: - if block.block_type == "floating_image" and block.value: - block.value = customs[block.value.id] - - if page.background_image: - page.background_image_CUSTOM = customs[page.background_image.id] - - if model == "NewsPage" and page.portrait_image: - page.portrait_image_CUSTOM = customs[page.portrait_image.id] - - page.save() - - Image.objects.all().delete() - -class Migration(migrations.Migration): - - dependencies = [ - ('cms_pages', '0013_auto_20160918_0358'), - ] - - operations = [ - migrations.RunPython(image_to_custom_image), - ] diff --git a/cms_pages/migrations/0015_auto_20160918_0402_squashed_0016_auto_20160918_0403.py b/cms_pages/migrations/0015_auto_20160918_0402_squashed_0016_auto_20160918_0403.py deleted file mode 100644 index 70e429e7..00000000 --- a/cms_pages/migrations/0015_auto_20160918_0402_squashed_0016_auto_20160918_0403.py +++ /dev/null @@ -1,53 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-09-18 04:05 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - replaces = [(b'cms_pages', '0015_auto_20160918_0402'), (b'cms_pages', '0016_auto_20160918_0403')] - - dependencies = [ - ('cms_pages', '0014_auto_20160918_0358'), - ] - - operations = [ - migrations.RemoveField( - model_name='contentpage', - name='background_image', - ), - migrations.RemoveField( - model_name='newsindexpage', - name='background_image', - ), - migrations.RemoveField( - model_name='newspage', - name='background_image', - ), - migrations.RemoveField( - model_name='newspage', - name='portrait_image', - ), - migrations.RenameField( - model_name='contentpage', - old_name='background_image_CUSTOM', - new_name='background_image', - ), - migrations.RenameField( - model_name='newsindexpage', - old_name='background_image_CUSTOM', - new_name='background_image', - ), - migrations.RenameField( - model_name='newspage', - old_name='background_image_CUSTOM', - new_name='background_image', - ), - migrations.RenameField( - model_name='newspage', - old_name='portrait_image_CUSTOM', - new_name='portrait_image', - ), - ] diff --git a/cms_pages/migrations/0016_auto_20160918_0517.py b/cms_pages/migrations/0016_auto_20160918_0517.py deleted file mode 100644 index 66c1742f..00000000 --- a/cms_pages/migrations/0016_auto_20160918_0517.py +++ /dev/null @@ -1,33 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-09-18 05:17 -from __future__ import unicode_literals - -import cms_pages.models -from django.db import migrations -import wagtail.wagtailcore.blocks -import wagtail.wagtailcore.fields - - -class Migration(migrations.Migration): - - dependencies = [ - ('cms_pages', '0015_auto_20160918_0402_squashed_0016_auto_20160918_0403'), - ] - - operations = [ - migrations.AlterField( - model_name='contentpage', - name='body', - field=wagtail.wagtailcore.fields.StreamField([('rich_text', wagtail.wagtailcore.blocks.RichTextBlock(required=False)), ('raw_html', wagtail.wagtailcore.blocks.RawHTMLBlock(required=False)), ('floating_image', cms_pages.models.FloatingImageBlock()), ('anchor', cms_pages.models.AnchorBlock(help_text='Add a named anchor to this point in the page')), ('colophon_image_list', wagtail.wagtailcore.blocks.StructBlock([(b'do_nothing', wagtail.wagtailcore.blocks.BooleanBlock())]))]), - ), - migrations.AlterField( - model_name='newsindexpage', - name='body', - field=wagtail.wagtailcore.fields.StreamField([('rich_text', wagtail.wagtailcore.blocks.RichTextBlock(required=False)), ('raw_html', wagtail.wagtailcore.blocks.RawHTMLBlock(required=False)), ('floating_image', cms_pages.models.FloatingImageBlock()), ('anchor', cms_pages.models.AnchorBlock(help_text='Add a named anchor to this point in the page')), ('colophon_image_list', wagtail.wagtailcore.blocks.StructBlock([(b'do_nothing', wagtail.wagtailcore.blocks.BooleanBlock())]))]), - ), - migrations.AlterField( - model_name='newspage', - name='body', - field=wagtail.wagtailcore.fields.StreamField([('rich_text', wagtail.wagtailcore.blocks.RichTextBlock(required=False)), ('raw_html', wagtail.wagtailcore.blocks.RawHTMLBlock(required=False)), ('floating_image', cms_pages.models.FloatingImageBlock()), ('anchor', cms_pages.models.AnchorBlock(help_text='Add a named anchor to this point in the page')), ('colophon_image_list', wagtail.wagtailcore.blocks.StructBlock([(b'do_nothing', wagtail.wagtailcore.blocks.BooleanBlock())]))]), - ), - ] diff --git a/cms_pages/migrations/0017_auto_20160918_0945_squashed_0018_auto_20160919_0125_squashed_0018_auto_20160919_0134.py b/cms_pages/migrations/0017_auto_20160918_0945_squashed_0018_auto_20160919_0125_squashed_0018_auto_20160919_0134.py deleted file mode 100644 index 4aa40fc9..00000000 --- a/cms_pages/migrations/0017_auto_20160918_0945_squashed_0018_auto_20160919_0125_squashed_0018_auto_20160919_0134.py +++ /dev/null @@ -1,44 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-09-19 01:48 -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', '0016_auto_20160918_0517'), - ] - - operations = [ - migrations.AlterField( - model_name='contentpage', - name='body', - field=wagtail.wagtailcore.fields.StreamField([('rich_text', wagtail.wagtailcore.blocks.RichTextBlock(required=False)), ('raw_html', wagtail.wagtailcore.blocks.RawHTMLBlock(required=False)), ('floating_image', cms_pages.models.FloatingImageBlock()), ('anchor', cms_pages.models.AnchorBlock(help_text='Add a named anchor to this point in the page')), ('colophon_image_list', wagtail.wagtailcore.blocks.StructBlock([(b'do_nothing', wagtail.wagtailcore.blocks.BooleanBlock(required=False))]))]), - ), - migrations.AlterField( - model_name='newsindexpage', - name='body', - field=wagtail.wagtailcore.fields.StreamField([('rich_text', wagtail.wagtailcore.blocks.RichTextBlock(required=False)), ('raw_html', wagtail.wagtailcore.blocks.RawHTMLBlock(required=False)), ('floating_image', cms_pages.models.FloatingImageBlock()), ('anchor', cms_pages.models.AnchorBlock(help_text='Add a named anchor to this point in the page')), ('colophon_image_list', wagtail.wagtailcore.blocks.StructBlock([(b'do_nothing', wagtail.wagtailcore.blocks.BooleanBlock(required=False))]))]), - ), - migrations.AlterField( - model_name='newspage', - name='body', - field=wagtail.wagtailcore.fields.StreamField([('rich_text', wagtail.wagtailcore.blocks.RichTextBlock(required=False)), ('raw_html', wagtail.wagtailcore.blocks.RawHTMLBlock(required=False)), ('floating_image', cms_pages.models.FloatingImageBlock()), ('anchor', cms_pages.models.AnchorBlock(help_text='Add a named anchor to this point in the page')), ('colophon_image_list', wagtail.wagtailcore.blocks.StructBlock([(b'do_nothing', wagtail.wagtailcore.blocks.BooleanBlock(required=False))]))]), - ), - 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'), ('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.RichTextBlock(required=True)), (b'link', wagtail.wagtailcore.blocks.StructBlock([('page', wagtail.wagtailcore.blocks.PageChooserBlock()), ('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"))])), ('keynotes', wagtail.wagtailcore.blocks.StructBlock([(b'heading', wagtail.wagtailcore.blocks.CharBlock(required=True)), (b'speakers', wagtail.wagtailcore.blocks.ListBlock(cms_pages.models.KeynoteSpeakerBlock))]))]), - ), - 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'), ('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.RichTextBlock(required=True)), (b'link', wagtail.wagtailcore.blocks.StructBlock([('page', wagtail.wagtailcore.blocks.PageChooserBlock()), ('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/0018_auto_20170116_1050.py b/cms_pages/migrations/0018_auto_20170116_1050.py deleted file mode 100644 index 025bb864..00000000 --- a/cms_pages/migrations/0018_auto_20170116_1050.py +++ /dev/null @@ -1,29 +0,0 @@ -# -*- 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 deleted file mode 100644 index 590622f8..00000000 --- a/cms_pages/migrations/0019_auto_20170116_1334.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- 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/migrations/0020_auto_20170217_1220.py b/cms_pages/migrations/0020_auto_20170217_1220.py deleted file mode 100644 index f79598cf..00000000 --- a/cms_pages/migrations/0020_auto_20170217_1220.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2017-02-17 01:20 -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', '0019_auto_20170116_1334'), - ] - - 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')], required=False)), (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/0021_auto_20170217_1857.py b/cms_pages/migrations/0021_auto_20170217_1857.py deleted file mode 100644 index ae8a0fcc..00000000 --- a/cms_pages/migrations/0021_auto_20170217_1857.py +++ /dev/null @@ -1,30 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2017-02-17 07:57 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('cms_pages', '0020_auto_20170217_1220'), - ] - - operations = [ - migrations.AlterField( - model_name='contentpage', - name='intro', - field=models.CharField(blank=True, max_length=250), - ), - migrations.AlterField( - model_name='newsindexpage', - name='intro', - field=models.CharField(blank=True, max_length=250), - ), - migrations.AlterField( - model_name='newspage', - name='intro', - field=models.CharField(blank=True, max_length=250), - ), - ] diff --git a/cms_pages/migrations/__init__.py b/cms_pages/migrations/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/cms_pages/models.py b/cms_pages/models.py deleted file mode 100644 index 0bded2b6..00000000 --- a/cms_pages/models.py +++ /dev/null @@ -1,413 +0,0 @@ -from __future__ import unicode_literals - -from django import forms -from django.core.exceptions import ValidationError -from django.db import models -from django.db.models.signals import pre_delete -from django.dispatch import receiver -from django.forms.utils import ErrorList -from django.http import Http404 -from django.shortcuts import render -from django.utils.encoding import python_2_unicode_compatible - -from modelcluster.fields import ParentalKey - -from wagtail.wagtailadmin.edit_handlers import InlinePanel -from wagtail.wagtailadmin.edit_handlers import FieldPanel -from wagtail.wagtailadmin.edit_handlers import PageChooserPanel -from wagtail.wagtailadmin.edit_handlers import StreamFieldPanel - -from wagtail.wagtailcore import blocks -from wagtail.wagtailcore.models import Page -from wagtail.wagtailcore.models import Orderable -from wagtail.wagtailcore.fields import RichTextField -from wagtail.wagtailcore.fields import StreamField -from wagtail.wagtailcore.url_routing import RouteResult - -from wagtail.wagtailimages import blocks as imageblocks -from wagtail.wagtailimages.edit_handlers import ImageChooserPanel -from wagtail.wagtailimages.models import AbstractImage -from wagtail.wagtailimages.models import AbstractRendition -from wagtail.wagtailimages.models import Image - -from wagtail.wagtailsearch import index -from wagtail.wagtailsnippets.models import register_snippet - - -from symposion import schedule - -ILLUSTRATION_ANTARCTICA = "antarctica.svg" -ILLUSTRATION_BRIDGE = "bridge.svg" -ILLUSTRATION_CASINO = "casino.svg" -ILLUSTRATION_CRADLE = "cradle.svg" -ILLUSTRATION_DEVIL = "devil.svg" -ILLUSTRATION_FALLS = "falls.svg" -ILLUSTRATION_HOBART = "hobart.svg" -ILLUSTRATION_LAVENDER = "lavender.svg" -ILLUSTRATION_PYCONAU = "logo-mel.png" -ILLUSTRATION_PYTHON = "Python-logo-notext.svg" -ILLUSTRATION_TUZ = "tuz.svg" -ILLUSTRATION_WINEGLASS = "wineglass.svg" - -ILLUSTRATION_TYPES = ( - (ILLUSTRATION_ANTARCTICA, "Antarctica"), - (ILLUSTRATION_BRIDGE, "Bridge"), - (ILLUSTRATION_CASINO, "Casino"), - (ILLUSTRATION_CRADLE, "Cradle Mountain"), - (ILLUSTRATION_DEVIL, "Tasmanian Devil"), - (ILLUSTRATION_FALLS, "Waterfall"), - (ILLUSTRATION_HOBART, "Hobart"), - (ILLUSTRATION_LAVENDER, "Lavender"), - (ILLUSTRATION_PYCONAU, "Pycon AU"), - (ILLUSTRATION_PYTHON, "Python"), - (ILLUSTRATION_TUZ, "Tuz"), - (ILLUSTRATION_WINEGLASS, "Wineglass"), -) - - -class ExternalLinksBlock(blocks.StructBlock): - - class Meta: - template = "cms_pages/home_page_blocks/external_link.html" - - EXTERNAL_LINK_TWITTER = "twitter" - EXTERNAL_LINK_FACEBOOK = "facebook" - EXTERNAL_LINK_GENERIC = "generic" - - EXTERNAL_LINK_TYPES = ( - (EXTERNAL_LINK_TWITTER, "Twitter"), - (EXTERNAL_LINK_FACEBOOK, "Facebook"), - (EXTERNAL_LINK_GENERIC, "Generic URL"), - ) - - alt = blocks.CharBlock(required=True) - icon = blocks.ChoiceBlock( - choices=EXTERNAL_LINK_TYPES, - required=True, - ) - url = blocks.URLBlock(required=True) - - -class BasicContentLink(blocks.StructBlock): - - page = blocks.PageChooserBlock( - required=False, - help_text="You must specify either this, or the URL.", - ) - url = blocks.CharBlock( - required=False, - help_text="You must specify either this, or the URL.", - ) - title = blocks.CharBlock(required=True) - - -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"), - ) - - panel_type = blocks.ChoiceBlock( - choices=PANEL_TYPES, - required=True, - ) - heading = blocks.CharBlock(required=True) - inset_illustration = blocks.ChoiceBlock( - choices=ILLUSTRATION_TYPES, - required=False, - ) - background_image = imageblocks.ImageChooserBlock( - required=False, - 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.RawHTMLBlock(required=True) - link = BasicContentLink() - external_links = blocks.ListBlock(ExternalLinksBlock) - compact = blocks.BooleanBlock( - required=False, - help_text="True if this block is to be displayed in 'compact' mode", - ) - - -class PresentationChooserBlock(blocks.ChooserBlock): - target_model = schedule.models.Presentation - widget = forms.Select - - # Return the key value for the select field - def value_for_form(self, value): - if isinstance(value, self.target_model): - return value.pk - else: - return value - - -class KeynoteSpeakerBlock(blocks.StructBlock): - - class Meta: - template = "cms_pages/home_page_blocks/keynote_speaker.html" - - name = blocks.CharBlock(required=True) - body = blocks.RichTextBlock(required=True) - links = blocks.ListBlock(ExternalLinksBlock) - profile_image = imageblocks.ImageChooserBlock( - required=False, - help_text="Profile image for the speaker", - ) - presentation = PresentationChooserBlock( - help_text="This speaker's presentation", - ) - - -class KeynotesBlock(blocks.StructBlock): - - class Meta: - template = "cms_pages/home_page_blocks/keynotes.html" - - heading = blocks.CharBlock(required=True) - speakers = blocks.ListBlock(KeynoteSpeakerBlock) - - -class HomePage(Page): - - body = StreamField([ - ("basic_content", BasicContentBlock()), - ("keynotes", KeynotesBlock()), - # TODO: other bits - ]) - - content_panels = Page.content_panels + [ - StreamFieldPanel('body') - ] - - -# Content pages - -class FloatingImageBlock(imageblocks.ImageChooserBlock): - - class Meta: - template = "cms_pages/content_page_blocks/floating_image.html" - - -class AnchorBlock(blocks.CharBlock): - - class Meta: - template = "cms_pages/content_page_blocks/anchor.html" - - -class ColophonImageListBlock(blocks.StructBlock): - - class Meta: - template = "cms_pages/content_page_blocks/colophon.html" - - do_nothing = blocks.BooleanBlock(required=False) - - -class AbstractContentPage(Page): - - class Meta: - abstract = True - - intro = models.CharField(max_length=250, blank=True) - - body = StreamField([ - ("rich_text", blocks.RichTextBlock(required=False)), - ("raw_html", blocks.RawHTMLBlock(required=False)), - ("floating_image", FloatingImageBlock()), - ("anchor", AnchorBlock( - help_text="Add a named anchor to this point in the page" - )), - ("colophon_image_list", ColophonImageListBlock()), - ]) - - background_image = models.ForeignKey( - 'CustomImage', - null=True, - blank=True, - on_delete=models.SET_NULL, - related_name='+' - ) - - search_fields = Page.search_fields + [ - index.SearchField('intro'), - index.SearchField('body'), - ] - - content_panels = Page.content_panels + [ - ImageChooserPanel('background_image'), - FieldPanel('intro'), - StreamFieldPanel('body') - ] - - -class ContentPage(AbstractContentPage): - - inset_illustration = models.CharField( - choices=ILLUSTRATION_TYPES, - max_length=256, - ) - - content_panels = AbstractContentPage.content_panels + [ - FieldPanel('inset_illustration') - ] - - -# News pages - -class NewsIndexPage(AbstractContentPage): - - def route(self, request, path_components): - - # Try the default to allow children to resolve - try: - return super(NewsIndexPage, self).route(request, path_components) - except Http404: - pass - - if path_components: - # tell Wagtail to call self.serve() with an additional 'path_components' kwarg - return RouteResult(self, kwargs={'path_components': path_components}) - else: - raise Http404 - - def serve(self, request, path_components=[]): - ''' Optionally return the RSS version of the page ''' - - template = self.template - - if path_components and path_components[0] == "rss": - template = template.replace(".html", ".rss") - - r = super(NewsIndexPage, self).serve(request) - r.template_name = template - return r - - def child_pages(self): - return NewsPage.objects.live().child_of(self).specific().order_by("-date") - - subpage_types = [ - "NewsPage", - ] - - content_panels = AbstractContentPage.content_panels - - -class NewsPage(AbstractContentPage): - - date = models.DateField("Post date") - - portrait_image = models.ForeignKey( - 'CustomImage', - null=True, - blank=True, - on_delete=models.SET_NULL, - related_name='+' - ) - - parent_page_types = [ - NewsIndexPage, - ] - - content_panels = AbstractContentPage.content_panels + [ - FieldPanel('date'), - ImageChooserPanel('portrait_image'), - ] - - -@register_snippet -@python_2_unicode_compatible -class ScheduleHeaderParagraph(models.Model): - ''' Used to show the paragraph in the header for a schedule page. ''' - schedule = models.OneToOneField( - schedule.models.Schedule, - related_name="header_paragraph", - ) - text = models.TextField() - - panels = [ - FieldPanel('schedule'), - FieldPanel('text'), - ] - - def __str__(self): - return str(self.schedule) - - -@register_snippet -@python_2_unicode_compatible -class NamedHeaderParagraph(models.Model): - ''' Used to show the paragraph in the header for a schedule page. ''' - name = models.CharField( - max_length=64, - help_text="Pass this name to header_paragraph tag.", - ) - text = models.TextField() - - panels = [ - FieldPanel('name'), - FieldPanel('text'), - ] - - def __str__(self): - return str(self.name) - - -# Image models -- copied from wagtail docs - - -class CustomImage(AbstractImage): - # Add any extra fields to image here - - # eg. To add a caption field: - copyright_year = models.CharField( - max_length=64, - help_text="The year the image was taken", - ) - licence = models.CharField( - max_length=64, - help_text="The short-form code for the licence (e.g. CC-BY)", - ) - author = models.CharField( - max_length=255, - help_text="The name of the author of the work", - ) - source_url = models.URLField( - help_text="The URL where you can find the original of this image", - ) - - admin_form_fields = Image.admin_form_fields + ( - "copyright_year", - "licence", - "author", - "source_url", - ) - - -class CustomRendition(AbstractRendition): - image = models.ForeignKey(CustomImage, related_name='renditions') - - class Meta: - unique_together = ( - ('image', 'filter', 'focal_point_key'), - ) - - -# Delete the source image file when an image is deleted -@receiver(pre_delete, sender=CustomImage) -def image_delete(sender, instance, **kwargs): - instance.file.delete(False) - - -# Delete the rendition image file when a rendition is deleted -@receiver(pre_delete, sender=CustomRendition) -def rendition_delete(sender, instance, **kwargs): - instance.file.delete(False) diff --git a/cms_pages/tests.py b/cms_pages/tests.py deleted file mode 100644 index 7ce503c2..00000000 --- a/cms_pages/tests.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.test import TestCase - -# Create your tests here. diff --git a/cms_pages/views.py b/cms_pages/views.py deleted file mode 100644 index 91ea44a2..00000000 --- a/cms_pages/views.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.shortcuts import render - -# Create your views here. diff --git a/pinaxcon/settings.py b/pinaxcon/settings.py index 5276d46f..31620854 100644 --- a/pinaxcon/settings.py +++ b/pinaxcon/settings.py @@ -85,8 +85,6 @@ MIDDLEWARE_CLASSES = [ "debug_toolbar.middleware.DebugToolbarMiddleware", "reversion.middleware.RevisionMiddleware", "django.middleware.clickjacking.XFrameOptionsMiddleware", - 'wagtail.wagtailcore.middleware.SiteMiddleware', - 'wagtail.wagtailredirects.middleware.RedirectMiddleware', 'pinaxcon.monkey_patch.MonkeyPatchMiddleware', ] @@ -118,22 +116,6 @@ INSTALLED_APPS = [ "sitetree", "pinax.eventlog", - # wagtail - 'wagtail.wagtailforms', - 'wagtail.wagtailredirects', - 'wagtail.wagtailembeds', - 'wagtail.wagtailsites', - 'wagtail.wagtailusers', - 'wagtail.wagtailsnippets', - 'wagtail.wagtaildocs', - 'wagtail.wagtailimages', - 'wagtail.wagtailsearch', - 'wagtail.wagtailadmin', - 'wagtail.wagtailcore', - - 'modelcluster', - - # symposion "symposion", "symposion.conference", @@ -156,7 +138,6 @@ INSTALLED_APPS = [ "nested_admin", # project - "cms_pages", "pinaxcon", "pinaxcon.proposals", "pinaxcon.registrasion", @@ -274,11 +255,6 @@ PINAX_STRIPE_PUBLIC_KEY = os.environ.get("STRIPE_PUBLIC_KEY", "your test public PINAX_STRIPE_SECRET_KEY = os.environ.get("STRIPE_SECRET_KEY", "your test secret key") PINAX_STRIPE_SEND_EMAIL_RECEIPTS = False -# Wagtail config -WAGTAIL_SITE_NAME = 'linux.conf.au 2018' -WAGTAIL_APPEND_SLASH = True -WAGTAILIMAGES_IMAGE_MODEL = 'cms_pages.CustomImage' - ATTENDEE_PROFILE_FORM = "pinaxcon.registrasion.forms.ProfileForm" # CSRF custom error screen diff --git a/pinaxcon/templates/403_csrf.html b/pinaxcon/templates/403_csrf.html index 787122cd..78213797 100644 --- a/pinaxcon/templates/403_csrf.html +++ b/pinaxcon/templates/403_csrf.html @@ -1,6 +1,5 @@ {% extends "site_base_wagtail.html" %} {% load staticfiles %} -{% load wagtailcore_tags %} {% load i18n %} diff --git a/pinaxcon/templates/404.html b/pinaxcon/templates/404.html index 96abfcfa..ce65149c 100644 --- a/pinaxcon/templates/404.html +++ b/pinaxcon/templates/404.html @@ -1,6 +1,5 @@ {% extends "site_base_wagtail.html" %} {% load staticfiles %} -{% load wagtailcore_tags %} {% load i18n %} diff --git a/pinaxcon/templates/cms_pages/abstract_content_page.html b/pinaxcon/templates/cms_pages/abstract_content_page.html deleted file mode 100644 index 4e8f616e..00000000 --- a/pinaxcon/templates/cms_pages/abstract_content_page.html +++ /dev/null @@ -1,30 +0,0 @@ -{% extends "pyconau2017/content_page.html" %} -{% load staticfiles %} -{% load wagtailcore_tags %} -{% load wagtailimages_tags %} -{% load pyconau2017_tags %} - -{% load sitetree %} -{% load i18n %} - -{% block body_class %}template-content-page{% endblock %} - -{% block head_title %}{{ page.title }}{% endblock %} - -{% if page.background_image %} - {% block header_background_image %}{% image page.background_image width-2000 as background_image %}{{ background_image.url }}{% endblock %} -{% endif %} -{% block header_title %}{{ page.title }}{% endblock %} -{% block header_paragraph %}{{ page.intro }}{% endblock %} -{% block header_inset_image %}{% endblock %} - -{% block content %} -
-

{{ page.title }}

-

{{ page.intro }}

- {{ page.body }} -
- {% block content_base %} - {% endblock %} -{% endblock %} - diff --git a/pinaxcon/templates/cms_pages/content_page.html b/pinaxcon/templates/cms_pages/content_page.html deleted file mode 100644 index 0ba1736c..00000000 --- a/pinaxcon/templates/cms_pages/content_page.html +++ /dev/null @@ -1,9 +0,0 @@ -{% extends "cms_pages/abstract_content_page.html" %} -{% load pyconau2017_tags %} - -{% load sitetree %} -{% load i18n %} - -{% block body_class %}template-content-page{% endblock %} - -{% block header_inset_image %}{% illustration page.inset_illustration %}{% endblock %} diff --git a/pinaxcon/templates/cms_pages/content_page_blocks/anchor.html b/pinaxcon/templates/cms_pages/content_page_blocks/anchor.html deleted file mode 100644 index 5466c85f..00000000 --- a/pinaxcon/templates/cms_pages/content_page_blocks/anchor.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/pinaxcon/templates/cms_pages/content_page_blocks/colophon.html b/pinaxcon/templates/cms_pages/content_page_blocks/colophon.html deleted file mode 100644 index 1fd37e81..00000000 --- a/pinaxcon/templates/cms_pages/content_page_blocks/colophon.html +++ /dev/null @@ -1,10 +0,0 @@ -{% load pyconau2017_tags %} - - diff --git a/pinaxcon/templates/cms_pages/content_page_blocks/floating_image.html b/pinaxcon/templates/cms_pages/content_page_blocks/floating_image.html deleted file mode 100644 index f72026f7..00000000 --- a/pinaxcon/templates/cms_pages/content_page_blocks/floating_image.html +++ /dev/null @@ -1,4 +0,0 @@ -{% load wagtailimages_tags %} - -{% image value width-800 as img %} -{% include "lca2017/_right_floating_image.html" with image_url=img.url %} diff --git a/pinaxcon/templates/cms_pages/home_page.html b/pinaxcon/templates/cms_pages/home_page.html deleted file mode 100644 index a7e2ca47..00000000 --- a/pinaxcon/templates/cms_pages/home_page.html +++ /dev/null @@ -1,13 +0,0 @@ -{% extends "site_base_wagtail.html" %} - -{% load i18n %} - -{% load wagtailcore_tags %} - -{% block head_title %}{{ page.title }}{% endblock %} - -{% block body %} - -{{ page.body }} - -{% endblock %} diff --git a/pinaxcon/templates/cms_pages/home_page_blocks/basic_content.html b/pinaxcon/templates/cms_pages/home_page_blocks/basic_content.html deleted file mode 100644 index 502d3113..00000000 --- a/pinaxcon/templates/cms_pages/home_page_blocks/basic_content.html +++ /dev/null @@ -1,40 +0,0 @@ -{% load pyconau2017_tags %} -{% load staticfiles %} -{% load wagtailcore_tags %} -{% load wagtailimages_tags %} - -{% if value.compact %} - {% define "panel__compact" as compact %} -{% else %} - {% define "" as compact %} -{% endif %} - -{% if value.panel_type == "simple" %} - - {% comment %} - {% include "cms_pages/home_page_blocks/basic_content_text_and_links.html" %} - {% endcomment %} - - {{ value.body }} - -{% elif value.panel_type == "blue_left" %} - -
- {% image value.background_image width-2000 as background_image %} -
-
- {% include "cms_pages/home_page_blocks/basic_content_illustration.html" %} - {% include "cms_pages/home_page_blocks/basic_content_text_and_links.html" %} -
-
- -{% elif value.panel_type == "white_right" %} - -
-
- {% include "cms_pages/home_page_blocks/basic_content_text_and_links.html" %} - {% include "cms_pages/home_page_blocks/basic_content_illustration.html" %} -
-
- -{% endif %} diff --git a/pinaxcon/templates/cms_pages/home_page_blocks/basic_content_illustration.html b/pinaxcon/templates/cms_pages/home_page_blocks/basic_content_illustration.html deleted file mode 100644 index 7c53c594..00000000 --- a/pinaxcon/templates/cms_pages/home_page_blocks/basic_content_illustration.html +++ /dev/null @@ -1,8 +0,0 @@ -{% load staticfiles %} -
-
- -
-
diff --git a/pinaxcon/templates/cms_pages/home_page_blocks/basic_content_text_and_links.html b/pinaxcon/templates/cms_pages/home_page_blocks/basic_content_text_and_links.html deleted file mode 100644 index e6848003..00000000 --- a/pinaxcon/templates/cms_pages/home_page_blocks/basic_content_text_and_links.html +++ /dev/null @@ -1,22 +0,0 @@ -{% load pyconau2017_tags %} - -{% if value.link.page %} - {% define value.link.page.url as url %} -{% else %} - {% define value.link.url as url %} -{% endif %} - -
- -

-
- {% if value.panel_type == "blue_left" %} - {{ value.link.title }} - {% elif value.panel_type == "white_right" %} - {{ value.link.title }} - {% endif %} - {% for link in value.external_links %} - {{ link }} - {% endfor %} -
-
diff --git a/pinaxcon/templates/cms_pages/home_page_blocks/btn_facebook.html b/pinaxcon/templates/cms_pages/home_page_blocks/btn_facebook.html deleted file mode 100644 index 99cc30b6..00000000 --- a/pinaxcon/templates/cms_pages/home_page_blocks/btn_facebook.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - diff --git a/pinaxcon/templates/cms_pages/home_page_blocks/btn_generic_link.html b/pinaxcon/templates/cms_pages/home_page_blocks/btn_generic_link.html deleted file mode 100644 index b4d33112..00000000 --- a/pinaxcon/templates/cms_pages/home_page_blocks/btn_generic_link.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - website - - - - diff --git a/pinaxcon/templates/cms_pages/home_page_blocks/btn_svg.html b/pinaxcon/templates/cms_pages/home_page_blocks/btn_svg.html deleted file mode 100644 index b9be8aa9..00000000 --- a/pinaxcon/templates/cms_pages/home_page_blocks/btn_svg.html +++ /dev/null @@ -1,7 +0,0 @@ -{% if link.icon == "twitter" %} - {% include "cms_pages/home_page_blocks/btn_twitter.html" %} -{% elif link.icon == "facebook" %} - {% include "cms_pages/home_page_blocks/btn_facebook.html" %} -{% elif link.icon == "generic" %} - {% include "cms_pages/home_page_blocks/btn_generic_link.html" %} -{% endif %} diff --git a/pinaxcon/templates/cms_pages/home_page_blocks/btn_twitter.html b/pinaxcon/templates/cms_pages/home_page_blocks/btn_twitter.html deleted file mode 100644 index 55b632a0..00000000 --- a/pinaxcon/templates/cms_pages/home_page_blocks/btn_twitter.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - twitter - - - - diff --git a/pinaxcon/templates/cms_pages/home_page_blocks/external_link.html b/pinaxcon/templates/cms_pages/home_page_blocks/external_link.html deleted file mode 100644 index 7e57ec70..00000000 --- a/pinaxcon/templates/cms_pages/home_page_blocks/external_link.html +++ /dev/null @@ -1,3 +0,0 @@ - - {% include "cms_pages/home_page_blocks/btn_svg.html" with link=value %} - diff --git a/pinaxcon/templates/cms_pages/home_page_blocks/keynote_speaker.html b/pinaxcon/templates/cms_pages/home_page_blocks/keynote_speaker.html deleted file mode 100644 index 34dcca1f..00000000 --- a/pinaxcon/templates/cms_pages/home_page_blocks/keynote_speaker.html +++ /dev/null @@ -1,25 +0,0 @@ -{% load wagtailcore_tags %} -{% load wagtailimages_tags %} - -{% image value.profile_image width-800 as profile_image %} -
-
-
-
-
-
-
-
-

{{ value.name }}

- - {{ value.body }} - -
- Read more - {% for link in value.links %} - {{ link }} - {% endfor %} -
-
-
-
diff --git a/pinaxcon/templates/cms_pages/home_page_blocks/keynotes.html b/pinaxcon/templates/cms_pages/home_page_blocks/keynotes.html deleted file mode 100644 index bc7cbdaa..00000000 --- a/pinaxcon/templates/cms_pages/home_page_blocks/keynotes.html +++ /dev/null @@ -1,12 +0,0 @@ -
-
-
-
-

{{ value.heading }}

-
-
-
- -{% for speaker in value.speakers %} - {% include "cms_pages/home_page_blocks/keynote_speaker.html" with value=speaker %} -{% endfor %} diff --git a/pinaxcon/templates/cms_pages/news_index_page.html b/pinaxcon/templates/cms_pages/news_index_page.html deleted file mode 100644 index b3742809..00000000 --- a/pinaxcon/templates/cms_pages/news_index_page.html +++ /dev/null @@ -1,47 +0,0 @@ -{% extends "cms_pages/abstract_content_page.html" %} - -{% load staticfiles %} -{% load wagtailcore_tags %} -{% load wagtailimages_tags %} -{% load pyconau2017_tags %} - -{% load sitetree %} -{% load i18n %} - -{% block head_title %}{{ page.title }}{% endblock %} -{% block body_class %}template-news-index{% endblock %} - -{% block inset_image_base %}{% endblock %} - -{% comment %}We use panels here, so don't need to wrap in a text block{% endcomment %} -{% block content_base %} - {% if page.child_pages %} - {% for item in page.child_pages %} -
-
- {% comment %} -
-
- {% image item.portrait_image width-640 as portrait_image %} -
-
-
- {% endcomment %} -
-

{{ item.title }}

-

{{ item.date|date:"j F Y" }} – {{ item.intro }}

- Read more -
-
-
- {% endfor %} -
- {% endif %} - -
-
-

Subscribe

-

View as RSS

-
-
-{% endblock %} diff --git a/pinaxcon/templates/cms_pages/news_index_page.rss b/pinaxcon/templates/cms_pages/news_index_page.rss deleted file mode 100644 index dd4c5d2b..00000000 --- a/pinaxcon/templates/cms_pages/news_index_page.rss +++ /dev/null @@ -1,35 +0,0 @@ -{% load wagtailcore_tags %} -{% load i18n %} - - - - - {{ SITE_NAME }} | {{ page.title }} - - {{ request.scheme }}://{{ request.get_host }} - Recent content from {{ SITE_NAME }} - {{ SITE_NAME }} - - - - {% if page.child_pages %} - {% for item in page.child_pages %} - - {{ item.title }} - {{ request.scheme }}://{{ request.get_host }}{{ item.url }} - {{ request.scheme }}://{{ request.get_host }}{{ item.url }} - {{ item.date|date:"D, d M Y 00:00:00 +1000" }} - - <p> - {{ item.intro|richtext|force_escape }} - </p> - <p> - {{ item.body|force_escape }} - </p> - - - - {% endfor %} - {% endif %} - - diff --git a/pinaxcon/templates/cms_pages/news_page.html b/pinaxcon/templates/cms_pages/news_page.html deleted file mode 100644 index d65124fc..00000000 --- a/pinaxcon/templates/cms_pages/news_page.html +++ /dev/null @@ -1,23 +0,0 @@ -{% extends "cms_pages/abstract_content_page.html" %} - -{% load wagtailcore_tags %} -{% load wagtailimages_tags %} - -{% load sitetree %} -{% load i18n %} - -{% block body_class %}template-newspage{% endblock %} - -{% block head_title %}{{ page.title }}{% endblock %} - -{% if page.portrait_image %} - {% block header_inset_image %}{% image page.portrait_image width-640 as portrait_image %}{{ portrait_image.url }}{% endblock %} -{% endif %} - -{% block content %} -
- -

{{ page.date|date:"j F Y" }}

- {{ page.body }} -
-{% endblock %} diff --git a/pinaxcon/templates/dashboard.html b/pinaxcon/templates/dashboard.html index d8932892..f94111e7 100644 --- a/pinaxcon/templates/dashboard.html +++ b/pinaxcon/templates/dashboard.html @@ -7,7 +7,6 @@ {% load registrasion_tags %} {% load pyconau2017_tags %} {% load staticfiles %} -{% load wagtailimages_tags %} {% block head_title %}Dashboard{% endblock %} diff --git a/pinaxcon/templates/homepage.html b/pinaxcon/templates/homepage.html index c08f51f0..f7764a14 100644 --- a/pinaxcon/templates/homepage.html +++ b/pinaxcon/templates/homepage.html @@ -2,12 +2,10 @@ {% load i18n %} -{% load wagtailcore_tags %} - {% block head_title %}{% trans "Welcome" %}{% endblock %} {% block body_class %}home{% endblock %} {% block body %} - {{ page.body|richtext }} + {{ page.body }} {% endblock %} diff --git a/pinaxcon/templates/lca2017/content_page.html b/pinaxcon/templates/lca2017/content_page.html index 3b2542e8..40d87995 100644 --- a/pinaxcon/templates/lca2017/content_page.html +++ b/pinaxcon/templates/lca2017/content_page.html @@ -1,6 +1,5 @@ {% extends "site_base_wagtail.html" %} {% load staticfiles %} -{% load wagtailcore_tags %} {% load pyconau2017_tags %} diff --git a/pinaxcon/templates/pyconau2017/content_page.html b/pinaxcon/templates/pyconau2017/content_page.html index a7df8458..ef39c2e7 100644 --- a/pinaxcon/templates/pyconau2017/content_page.html +++ b/pinaxcon/templates/pyconau2017/content_page.html @@ -1,6 +1,5 @@ {% extends "site_base_wagtail.html" %} {% load staticfiles %} -{% load wagtailcore_tags %} {% load pyconau2017_tags %} diff --git a/pinaxcon/templatetags/lca2017_tags.py b/pinaxcon/templatetags/lca2017_tags.py index bb321a04..4e142983 100644 --- a/pinaxcon/templatetags/lca2017_tags.py +++ b/pinaxcon/templatetags/lca2017_tags.py @@ -1,4 +1,3 @@ -import cms_pages import hashlib from decimal import Decimal @@ -71,20 +70,6 @@ def presentation_bg_number(presentation, count): return sum(ord(i) for i in presentation.title) % count -@register.simple_tag() -def header_paragraph(name): - model = cms_pages.models.NamedHeaderParagraph - try: - return model.objects.get(name=name).text - except model.DoesNotExist: - return "" - - -@register.simple_tag() -def all_images(): - return cms_pages.models.CustomImage.objects.all().order_by("title") - - @register.filter() def gst(amount): two_places = Decimal(10) ** -2 diff --git a/pinaxcon/templatetags/pyconau2017_tags.py b/pinaxcon/templatetags/pyconau2017_tags.py index cc3bd229..1b78f3cf 100644 --- a/pinaxcon/templatetags/pyconau2017_tags.py +++ b/pinaxcon/templatetags/pyconau2017_tags.py @@ -1,4 +1,3 @@ -import cms_pages import hashlib import os @@ -73,20 +72,6 @@ def presentation_bg_number(presentation, count): return sum(ord(i) for i in presentation.title) % count -@register.simple_tag() -def header_paragraph(name): - model = cms_pages.models.NamedHeaderParagraph - try: - return model.objects.get(name=name).text - except model.DoesNotExist: - return "" - - -@register.simple_tag() -def all_images(): - return cms_pages.models.CustomImage.objects.all().order_by("title") - - @register.filter() def gst(amount): two_places = Decimal(10) ** -2 diff --git a/pinaxcon/urls.py b/pinaxcon/urls.py index 03b27c00..d94516de 100644 --- a/pinaxcon/urls.py +++ b/pinaxcon/urls.py @@ -3,9 +3,6 @@ from django.conf.urls import include, url from django.conf.urls.static import static from django.views.generic import TemplateView -from wagtail.wagtailadmin import urls as wagtailadmin_urls -from wagtail.wagtailcore import urls as wagtail_urls - from django.contrib import admin import symposion.views @@ -24,23 +21,14 @@ urlpatterns = [ url(r"^teams/", include("symposion.teams.urls")), - url(r'^cms/', include(wagtailadmin_urls)), - # Required by registrasion url(r'^tickets/payments/', include('registripe.urls')), url(r'^tickets/', include('registrasion.urls')), url(r'^nested_admin/', include('nested_admin.urls')), - - # Default catch-all for wagtail pages. - url(r'^', include(wagtail_urls)), - # Matches *NOTHING* -- remove once site_tree is fixed url(r"^$", TemplateView.as_view(template_name="homepage.html"), name="home"), - # Demo payment gateway and related features - # url(r"^register/pinaxcon/", include("pinaxcon.registrasion.urls")), - ] if settings.DEBUG: diff --git a/requirements.txt b/requirements.txt index 1af42c46..24e68e18 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,7 +6,6 @@ pinax-eventlog==1.1.1 django-formset-js==0.5.0 dj-static==0.0.6 dj-database-url==0.4.0 -wagtail==1.6.2 pylibmc==1.5.1 raven==5.27.0 django-debug-toolbar==1.6