# -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-04-14 09:28
from __future__ import unicode_literals

import django.db.models.deletion
from django.db import migrations, models

import modelcluster.fields
import wagtail.core.blocks
import wagtail.core.fields
import wagtail.documents.blocks
import wagtail.embeds.blocks
import wagtail.images.blocks
import wagtail.snippets.blocks


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ("images", "0001_initial"),
        ("wagtailcore", "0032_add_bulk_delete_page_permission"),
        ("wagtaildocs", "0007_merge"),
    ]

    operations = [
        migrations.CreateModel(
            name="NewsType",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("title", models.CharField(max_length=128)),
            ],
        ),
        migrations.CreateModel(
            name="NewsIndex",
            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",
                    ),
                ),
                ("social_text", models.CharField(blank=True, max_length=255)),
                (
                    "social_image",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to="images.CustomImage",
                    ),
                ),
                (
                    "listing_image",
                    models.ForeignKey(
                        blank=True,
                        help_text="Choose the image you wish to be displayed when this page appears in listings",
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to="images.CustomImage",
                    ),
                ),
                (
                    "listing_summary",
                    models.CharField(
                        blank=True,
                        help_text="The text summary used when this page appears in listings. It's also used as the description for search engines if the 'Search description' field above is not defined.",
                        max_length=255,
                    ),
                ),
                (
                    "listing_title",
                    models.CharField(
                        blank=True,
                        help_text="Override the page title used when this page appears in listings",
                        max_length=255,
                    ),
                ),
            ],
            options={"abstract": False},
            bases=("wagtailcore.page", models.Model),
        ),
        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",
                    ),
                ),
                ("social_text", models.CharField(blank=True, max_length=255)),
                (
                    "listing_title",
                    models.CharField(
                        blank=True,
                        help_text="Override the page title used when this page appears in listings",
                        max_length=255,
                    ),
                ),
                (
                    "listing_summary",
                    models.CharField(
                        blank=True,
                        help_text="The text summary used when this page appears in listings. It's also used as the description for search engines if the 'Search description' field above is not defined.",
                        max_length=255,
                    ),
                ),
                (
                    "publication_date",
                    models.DateTimeField(
                        blank=True,
                        help_text="Use this field to override the date that the news item appears to have been published.",
                        null=True,
                    ),
                ),
                ("introduction", models.TextField(blank=True)),
                (
                    "body",
                    wagtail.core.fields.StreamField(
                        (
                            (
                                "heading",
                                wagtail.core.blocks.CharBlock(
                                    classname="full title",
                                    icon="title",
                                    template="patterns/molecules/streamfield/blocks/heading_block.html",
                                ),
                            ),
                            ("paragraph", wagtail.core.blocks.RichTextBlock()),
                            (
                                "image",
                                wagtail.core.blocks.StructBlock(
                                    (
                                        (
                                            "image",
                                            wagtail.images.blocks.ImageChooserBlock(),
                                        ),
                                        (
                                            "caption",
                                            wagtail.core.blocks.CharBlock(
                                                required=False
                                            ),
                                        ),
                                    )
                                ),
                            ),
                            (
                                "quote",
                                wagtail.core.blocks.StructBlock(
                                    (
                                        (
                                            "quote",
                                            wagtail.core.blocks.CharBlock(
                                                classname="title"
                                            ),
                                        ),
                                        (
                                            "attribution",
                                            wagtail.core.blocks.CharBlock(
                                                required=False
                                            ),
                                        ),
                                    )
                                ),
                            ),
                            ("embed", wagtail.embeds.blocks.EmbedBlock()),
                            (
                                "call_to_action",
                                wagtail.snippets.blocks.SnippetChooserBlock(
                                    "utils.CallToActionSnippet",
                                    template="patterns/molecules/streamfield/blocks/call_to_action_block.html",
                                ),
                            ),
                            (
                                "document",
                                wagtail.core.blocks.StructBlock(
                                    (
                                        (
                                            "document",
                                            wagtail.documents.blocks.DocumentChooserBlock(),
                                        ),
                                        (
                                            "title",
                                            wagtail.core.blocks.CharBlock(
                                                required=False
                                            ),
                                        ),
                                    )
                                ),
                            ),
                        )
                    ),
                ),
                (
                    "listing_image",
                    models.ForeignKey(
                        blank=True,
                        help_text="Choose the image you wish to be displayed when this page appears in listings",
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to="images.CustomImage",
                    ),
                ),
                (
                    "social_image",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to="images.CustomImage",
                    ),
                ),
            ],
            options={"abstract": False},
            bases=("wagtailcore.page", models.Model),
        ),
        migrations.CreateModel(
            name="NewsPageNewsType",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "news_type",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="+",
                        to="NewsType",
                    ),
                ),
                (
                    "page",
                    modelcluster.fields.ParentalKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="news_types",
                        to="news.NewsPage",
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name="NewsPageRelatedPage",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "sort_order",
                    models.IntegerField(blank=True, editable=False, null=True),
                ),
                (
                    "page",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="+",
                        to="wagtailcore.Page",
                    ),
                ),
                (
                    "source_page",
                    modelcluster.fields.ParentalKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="related_pages",
                        to="news.NewsPage",
                    ),
                ),
            ],
            options={"ordering": ["sort_order"], "abstract": False},
        ),
    ]
