Remove wagtail

This should eradicate wagtail from the project.

While wagtail may be nice, our goals are to keep all things public, and
having things locked behidn a DB is congruent to that plan.

All in all, the django project only leveraged a single wagtail feature,
"richtext" which has been hacikly removed and will result in bad display
of however it comes up.  But this is on homepage.html, which will be
removed and covered up with a static website, which means we should be
able remove homepage entirely from this project.

This reduction hopefully makes the monolith easier to understand,
maintain, and wield.
This commit is contained in:
Sachi King 2017-03-26 18:33:09 +11:00
parent f9c406e5f7
commit c37ed61036
54 changed files with 1 additions and 1585 deletions

View file

View file

@ -1,3 +0,0 @@
from django.contrib import admin
# Register your models here.

View file

@ -1,7 +0,0 @@
from __future__ import unicode_literals
from django.apps import AppConfig
class CmsPagesConfig(AppConfig):
name = 'cms_pages'

View file

@ -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',),
),
]

View file

@ -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))]))]),
),
]

View file

@ -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))]),
),
]

View file

@ -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,
),
]

View file

@ -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))]),
),
]

View file

@ -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'))]),
),
]

View file

@ -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')),
],
),
]

View file

@ -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()),
],
),
]

View file

@ -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')]),
),
]

View file

@ -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),
]

View file

@ -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',
),
]

View file

@ -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())]))]),
),
]

View file

@ -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))]))]),
),
]

View file

@ -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))]))]),
),
]

View file

@ -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))]))]),
),
]

View file

@ -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))]))]),
),
]

View file

@ -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),
),
]

View file

@ -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)

View file

@ -1,3 +0,0 @@
from django.test import TestCase
# Create your tests here.

View file

@ -1,3 +0,0 @@
from django.shortcuts import render
# Create your views here.

View file

@ -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

View file

@ -1,6 +1,5 @@
{% extends "site_base_wagtail.html" %}
{% load staticfiles %}
{% load wagtailcore_tags %}
{% load i18n %}

View file

@ -1,6 +1,5 @@
{% extends "site_base_wagtail.html" %}
{% load staticfiles %}
{% load wagtailcore_tags %}
{% load i18n %}

View file

@ -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 %}
<div id="announcements" class="jumbotron-white">
<h1>{{ page.title }}</h1>
<p>{{ page.intro }}</p>
<span>{{ page.body }}</span>
</div>
{% block content_base %}
{% endblock %}
{% endblock %}

View file

@ -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 %}

View file

@ -1 +0,0 @@
<a name="{{ value }}"></a>

View file

@ -1,10 +0,0 @@
{% load pyconau2017_tags %}
<ul>
{% all_images as images %}
{% for image in images %}
<li>
<a href="{{ image.source_url }}">{{ image.title }}</a> &ndash; &copy;{{ image.copyright_year }} {{ image.licence }} by {{ image.author }}
</li>
{% endfor %}
</ul>

View file

@ -1,4 +0,0 @@
{% load wagtailimages_tags %}
{% image value width-800 as img %}
{% include "lca2017/_right_floating_image.html" with image_url=img.url %}

View file

@ -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 %}

View file

@ -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" %}
<div class="panel panel__bg {{ compact }}">
{% image value.background_image width-2000 as background_image %}
<div style="background-image: url('{{ background_image.url }}');" class="panel--bg"></div>
<div class="panel--content">
{% include "cms_pages/home_page_blocks/basic_content_illustration.html" %}
{% include "cms_pages/home_page_blocks/basic_content_text_and_links.html" %}
</div>
</div>
{% elif value.panel_type == "white_right" %}
<div class="panel {{ compact }}">
<div class="panel--content">
{% include "cms_pages/home_page_blocks/basic_content_text_and_links.html" %}
{% include "cms_pages/home_page_blocks/basic_content_illustration.html" %}
</div>
</div>
{% endif %}

View file

@ -1,8 +0,0 @@
{% load staticfiles %}
<div class="panel--1-3">
<div class="illustration">
<img
src="{% static 'pyconau2017/images/svgs/illustrations/' %}{{ value.inset_illustration }}"
/>
</div>
</div>

View file

@ -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 %}
<div class="panel--2-3">
<!--h2>{{ value.heading }}</h2-->
<p class="lede"></p>
<div class="btn-group">
{% if value.panel_type == "blue_left" %}
<a href="{{ url }}" class="btn btn__white">{{ value.link.title }}</a>
{% elif value.panel_type == "white_right" %}
<a href="{{ url }}" class="btn">{{ value.link.title }}</a>
{% endif %}
{% for link in value.external_links %}
{{ link }}
{% endfor %}
</div>
</div>

View file

@ -1,25 +0,0 @@
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 57 57">
<defs>
<style>
.fcbk-cls-1 {
fill: none;
}
.fcbk-cls-2 {
clip-path: url(#clip-path);
}
.fcbk-cls-3 {
fill: currentColor;
}
</style>
<clipPath id="clip-path" transform="translate(0 0)">
<rect class="fcbk-cls-1" width="57" height="57"></rect>
</clipPath>
</defs>
<g class="fcbk-cls-2">
<path class="fcbk-cls-3" d="M28.5,0C12.8,0,0,12.8,0,28.5C0,44.2,12.8,57,28.5,57C44.2,57,57,44.2,57,28.5C57,12.8,44.2,0,28.5,0z
M34.6,28.5h-4c0,6.4,0,14.2,0,14.2h-5.9c0,0,0-7.8,0-14.2h-2.8v-5h2.8v-3.3c0-2.3,1.1-6,6-6l4.4,0v4.9c0,0-2.7,0-3.2,0
c-0.5,0-1.3,0.3-1.3,1.4v3h4.5L34.6,28.5z"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 855 B

View file

@ -1,24 +0,0 @@
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 57 57">
<defs>
<style>
.web-cls-1 {
fill: none;
}
.web-cls-2 {
clip-path: url(#clip-path);
}
.web-cls-3 {
fill: currentColor;
}
</style>
<clipPath id="clip-path">
<rect class="web-cls-1" width="57" height="57"></rect>
</clipPath>
</defs>
<title>website</title>
<g class="web-cls-2">
<path class="web-cls-3" d="M33.78,43.33A9.74,9.74,0,0,1,27,40.49l-2.84-2.84a1.1,1.1,0,0,1,0-1.59l1.59-1.59a1.09,1.09,0,0,1,1.59,0l2.84,2.84a5,5,0,1,0,7-7l-2.84-2.84a1.1,1.1,0,0,1,0-1.59l1.59-1.59a1.1,1.1,0,0,1,1.59,0l2.84,2.84a9.56,9.56,0,0,1,2.84,6.82,9.41,9.41,0,0,1-9.44,9.44M23.21,24.81l1.59-1.59a1.09,1.09,0,0,1,1.59,0l7.5,7.5a1.09,1.09,0,0,1,0,1.59L32.3,33.9a1.09,1.09,0,0,1-1.59,0l-7.5-7.5a1.09,1.09,0,0,1,0-1.59m-0.57,6.48-1.59,1.59a1.1,1.1,0,0,1-1.59,0L16.62,30a9.56,9.56,0,0,1,6.71-16.37,9.72,9.72,0,0,1,6.82,2.84L33,19.35a1.09,1.09,0,0,1,0,1.59L31.4,22.53a1.1,1.1,0,0,1-1.6,0L27,19.69a5,5,0,0,0-3.52-1.48,5,5,0,0,0-5,5,5,5,0,0,0,1.48,3.52l2.84,2.84a1.81,1.81,0,0,1-.11,1.7M28.5,0A28.5,28.5,0,1,0,57,28.5,28.5,28.5,0,0,0,28.5,0"></path>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.3 KiB

View file

@ -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 %}

View file

@ -1,24 +0,0 @@
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 57 57">
<defs>
<style>
.twtr-cls-1 {
fill: none;
}
.twtr-cls-2 {
clip-path: url(#clip-path);
}
.twtr-cls-3 {
fill: currentColor;
}
</style>
<clipPath id="clip-path" transform="translate(0 0)">
<rect class="twtr-cls-1" width="57" height="57"></rect>
</clipPath>
</defs>
<title>twitter</title>
<g class="twtr-cls-2">
<path class="twtr-cls-3" d="M39.83,22.69c0,0.25,0,.5,0,0.75,0,7.73-5.88,16.64-16.64,16.64a16.55,16.55,0,0,1-9-2.63,12.38,12.38,0,0,0,1.4.08A11.72,11.72,0,0,0,22.91,35,5.86,5.86,0,0,1,17.45,31a6,6,0,0,0,1.1.1,5.89,5.89,0,0,0,1.54-.2,5.86,5.86,0,0,1-4.69-5.73V25.07A5.82,5.82,0,0,0,18,25.8,5.85,5.85,0,0,1,16.23,18,16.59,16.59,0,0,0,28.29,24.1a5.85,5.85,0,0,1,10-5.33A11.66,11.66,0,0,0,42,17.35a5.87,5.87,0,0,1-2.57,3.24,11.65,11.65,0,0,0,3.36-.92,11.84,11.84,0,0,1-2.92,3M28.5,0A28.5,28.5,0,1,0,57,28.5,28.5,28.5,0,0,0,28.5,0" transform="translate(0 0)"></path>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.2 KiB

View file

@ -1,3 +0,0 @@
<a href="{{ value.url }}" title="{{ value.alt }}" class="btn-svg">
{% include "cms_pages/home_page_blocks/btn_svg.html" with link=value %}
</a>

View file

@ -1,25 +0,0 @@
{% load wagtailcore_tags %}
{% load wagtailimages_tags %}
{% image value.profile_image width-800 as profile_image %}
<div class="panel panel__compact {% if forloop.first %}panel__first{% endif %} {% if forloop.last %}panel__last{% endif %}">
<div class="panel--content">
<div class="panel--1-3">
<div class="portrait">
<div style="background-image: url('{{ profile_image.url }}');" class="portrait--img"></div>
</div>
</div>
<div class="panel--2-3">
<h3>{{ value.name }}</h3>
{{ value.body }}
<div class="btn-group">
<a href="{% url "schedule_presentation_detail" value.presentation.id %}" class="btn">Read more</a>
{% for link in value.links %}
{{ link }}
{% endfor %}
</div>
</div>
</div>
</div>

View file

@ -1,12 +0,0 @@
<div class="panel panel__compact panel__first">
<div class="panel--content">
<div class="panel--1-3"></div>
<div class="panel--2-3">
<h2 class="panel--section-title">{{ value.heading }}</h2>
</div>
</div>
</div>
{% for speaker in value.speakers %}
{% include "cms_pages/home_page_blocks/keynote_speaker.html" with value=speaker %}
{% endfor %}

View file

@ -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 %}
<div class="panel panel__compact jumbotron-white">
<div class="panel--content">
{% comment %}
<div class="panel--1-3">
<div class="portrait">
{% image item.portrait_image width-640 as portrait_image %}
<div style="background-image: url('{{ portrait_image.url }}');" class="portrait--img"></div>
</div>
</div>
{% endcomment %}
<div class="panel--2-3">
<h2>{{ item.title }}</h2>
<p class="lede"><em>{{ item.date|date:"j F Y" }}</em> {{ item.intro }}</p>
<a href="{{ item.url }}" class="btn">Read more</a>
</div>
</div>
</div>
{% endfor %}
<div class="panel panel__compact"></div>
{% endif %}
<div class="panel panel__compact jumbotron">
<div class="panel--content">
<h3>Subscribe</h3>
<p><a class="btn" href="rss">View as RSS</a></p>
</div>
</div>
{% endblock %}

View file

@ -1,35 +0,0 @@
{% load wagtailcore_tags %}
{% load i18n %}
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>
{{ SITE_NAME }} | {{ page.title }}
</title>
<link>{{ request.scheme }}://{{ request.get_host }}</link>
<description>Recent content from {{ SITE_NAME }}</description>
<generator>{{ SITE_NAME }}</generator>
<atom:link href="{{ request.scheme }}://{{ request.get_host }}{{ page.url }}rss" rel="self" type="application/rss+xml" />
{% if page.child_pages %}
{% for item in page.child_pages %}
<item>
<title>{{ item.title }}</title>
<link>{{ request.scheme }}://{{ request.get_host }}{{ item.url }}</link>
<guid>{{ request.scheme }}://{{ request.get_host }}{{ item.url }}</guid>
<pubDate>{{ item.date|date:"D, d M Y 00:00:00 +1000" }}</pubDate>
<description>
&lt;p&gt;
{{ item.intro|richtext|force_escape }}
&lt;/p&gt;
&lt;p&gt;
{{ item.body|force_escape }}
&lt;/p&gt;
</description>
</item>
{% endfor %}
{% endif %}
</channel>
</rss>

View file

@ -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 %}
<div id="announcements" class="jumbotron-white">
<p><em>{{ page.date|date:"j F Y" }}</em></p>
{{ page.body }}
</div>
{% endblock %}

View file

@ -7,7 +7,6 @@
{% load registrasion_tags %}
{% load pyconau2017_tags %}
{% load staticfiles %}
{% load wagtailimages_tags %}
{% block head_title %}Dashboard{% endblock %}

View file

@ -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 %}

View file

@ -1,6 +1,5 @@
{% extends "site_base_wagtail.html" %}
{% load staticfiles %}
{% load wagtailcore_tags %}
{% load pyconau2017_tags %}

View file

@ -1,6 +1,5 @@
{% extends "site_base_wagtail.html" %}
{% load staticfiles %}
{% load wagtailcore_tags %}
{% load pyconau2017_tags %}

View file

@ -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

View file

@ -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

View file

@ -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:

View file

@ -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