# Generated by Django 3.2.15 on 2022-11-07 09:42

import django.core.validators
import django.db.models.deletion
import wagtailmetadata.models
from django.db import migrations, models

import wagtail.blocks
import wagtail.fields
import wagtail.images.blocks

from ocyan.plugin.wagtail.block_plugin import get_extra_ocyan_settings_blocks


class Migration(migrations.Migration):
    initial = True

    replaces = [
        ("ocyan_plugin_wagtail", "0001_initial"),
        ("ocyan_plugin_wagtail", "0002_ocyansettings"),
        ("ocyan_plugin_wagtail", "0003_auto_20180823_2018"),
        ("ocyan_plugin_wagtail", "0004_auto_20180823_2028"),
        ("ocyan_plugin_wagtail", "0005_auto_20180824_1210"),
        ("ocyan_plugin_wagtail", "0006_auto_20180824_1227"),
        ("ocyan_plugin_wagtail", "0007_auto_20180824_1436"),
        ("ocyan_plugin_wagtail", "0008_auto_20180907_0932"),
        ("ocyan_plugin_wagtail", "0009_ocyansettings_header_content"),
        ("ocyan_plugin_wagtail", "0010_auto_20190523_1339"),
        ("ocyan_plugin_wagtail", "0011_auto_20190829_1319"),
        ("ocyan_plugin_wagtail", "0012_auto_20190829_1320"),
        ("ocyan_plugin_wagtail", "0013_auto_20190920_1327"),
        ("ocyan_plugin_wagtail", "0014_auto_20200319_1434"),
        ("ocyan_plugin_wagtail", "0015_auto_20200429_1535"),
        ("ocyan_plugin_wagtail", "0016_ocyansettings_pinterest_url"),
        ("ocyan_plugin_wagtail", "0017_invoice_footer"),
        ("ocyan_plugin_wagtail", "0018_auto_20201221_1535"),
        ("ocyan_plugin_wagtail", "0019_auto_20210428_1258"),
        ("ocyan_plugin_wagtail", "0020_auto_20210809_1537"),
        ("ocyan_plugin_wagtail", "0021_alter_abstractbasepage_search_image"),
        ("ocyan_plugin_wagtail", "0022_ocyansettings_logo_alt"),
        ("ocyan_plugin_wagtail", "0023_move_old_meta_description_field_to_new_field"),
        ("ocyan_plugin_wagtail", "0024_remove_abstractbasepage_meta_description"),
    ]

    dependencies = [
        ("wagtailcore", "0066_collection_management_permissions"),
        ("wagtailimages", "0023_add_choose_permissions"),
    ]

    operations = [
        migrations.CreateModel(
            name="OcyanSettings",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "facebook_url",
                    models.URLField(blank=True, help_text="Your Facebook page URL"),
                ),
                (
                    "twitter_url",
                    models.URLField(blank=True, help_text="Your Twitter url"),
                ),
                (
                    "instagram_url",
                    models.URLField(blank=True, help_text="Your Instagram url"),
                ),
                (
                    "linkedin_url",
                    models.URLField(blank=True, help_text="Your LinkedIn url"),
                ),
                (
                    "youtube_url",
                    models.URLField(
                        blank=True, help_text="Your YouTube channel or user account URL"
                    ),
                ),
                (
                    "pinterest_url",
                    models.URLField(blank=True, help_text="Your pinterest url"),
                ),
                ("phone_number", models.CharField(blank=True, max_length=255)),
                ("email_address", models.EmailField(blank=True, max_length=255)),
                (
                    "delivery_time_text",
                    wagtail.fields.RichTextField(
                        blank=True, null=True, verbose_name="Delivery time explanation"
                    ),
                ),
                (
                    "delivery_time_days",
                    models.PositiveIntegerField(
                        blank=True,
                        null=True,
                        verbose_name="Upper limit of standard delivery time in days",
                    ),
                ),
                ("logo_alt", models.CharField(blank=True, max_length=255)),
                (
                    "footer",
                    wagtail.fields.StreamField(
                        [
                            (
                                "about_us",
                                wagtail.blocks.StructBlock(
                                    [
                                        (
                                            "heading",
                                            wagtail.blocks.CharBlock(
                                                help_text="Heading of the content block.",
                                                label="Heading",
                                                required=False,
                                            ),
                                        ),
                                        ("content", wagtail.blocks.RichTextBlock()),
                                    ]
                                ),
                            ),
                            (
                                "text",
                                wagtail.blocks.StructBlock(
                                    [
                                        (
                                            "heading",
                                            wagtail.blocks.CharBlock(
                                                help_text="Heading of the content block.",
                                                label="Heading",
                                                required=False,
                                            ),
                                        ),
                                        ("content", wagtail.blocks.RichTextBlock()),
                                    ]
                                ),
                            ),
                            (
                                "page_list",
                                wagtail.blocks.StructBlock(
                                    [
                                        (
                                            "heading",
                                            wagtail.blocks.CharBlock(
                                                help_text="Heading of the content block.",
                                                label="Heading",
                                                required=False,
                                            ),
                                        ),
                                        (
                                            "page",
                                            wagtail.blocks.PageChooserBlock(
                                                help_text="List pages below this page",
                                                label="Page",
                                            ),
                                        ),
                                    ]
                                ),
                            ),
                        ]
                        + get_extra_ocyan_settings_blocks(),
                        default=[],
                    ),
                ),
                (
                    "mini_footer",
                    wagtail.fields.StreamField(
                        [("text", wagtail.blocks.RichTextBlock())], default=[]
                    ),
                ),
                (
                    "header_content",
                    wagtail.fields.StreamField(
                        [
                            ("text", wagtail.blocks.RichTextBlock()),
                            ("image", wagtail.images.blocks.ImageChooserBlock()),
                            (
                                "image_link",
                                wagtail.blocks.StructBlock(
                                    [
                                        (
                                            "image",
                                            wagtail.images.blocks.ImageChooserBlock(),
                                        ),
                                        (
                                            "page",
                                            wagtail.blocks.PageChooserBlock(
                                                help_text="Optional, you can enter a external link too.",
                                                required=False,
                                            ),
                                        ),
                                        (
                                            "external_link",
                                            wagtail.blocks.CharBlock(
                                                help_text="Optional, you can choose a page too.",
                                                required=False,
                                            ),
                                        ),
                                    ]
                                ),
                            ),
                        ]
                        + get_extra_ocyan_settings_blocks(),
                        blank=True,
                    ),
                ),
                (
                    "promo_header",
                    wagtail.fields.StreamField(
                        [
                            ("text", wagtail.blocks.RichTextBlock()),
                            ("image", wagtail.images.blocks.ImageChooserBlock()),
                            (
                                "TextSlider",
                                wagtail.blocks.ListBlock(
                                    wagtail.blocks.StructBlock(
                                        [("text", wagtail.blocks.CharBlock())]
                                    )
                                ),
                            ),
                        ],
                        blank=True,
                        help_text="Mobile only",
                    ),
                ),
                (
                    "social_links",
                    wagtail.fields.StreamField(
                        [
                            (
                                "link",
                                wagtail.blocks.StructBlock(
                                    [
                                        (
                                            "link",
                                            wagtail.blocks.PageChooserBlock(
                                                label="Pagina", required=False
                                            ),
                                        ),
                                        (
                                            "external_link",
                                            wagtail.blocks.CharBlock(
                                                label="Externe link", required=False
                                            ),
                                        ),
                                        (
                                            "label",
                                            wagtail.blocks.CharBlock(
                                                label="Link label", required=False
                                            ),
                                        ),
                                    ]
                                ),
                            )
                        ],
                        blank=True,
                        verbose_name="Socialbar links",
                    ),
                ),
                (
                    "whatsapp_url",
                    models.URLField(blank=True, help_text="Your Whatsapp url"),
                ),
                (
                    "invoice_footer_text",
                    wagtail.fields.RichTextField(
                        blank=True,
                        help_text="This text will be displayed at the bottom of your invoice",
                        null=True,
                        verbose_name="Invoice footer text",
                    ),
                ),
                (
                    "seo_title",
                    models.CharField(blank=True, max_length=255, verbose_name="Title"),
                ),
                (
                    "seo_description",
                    models.CharField(
                        blank=True, max_length=255, verbose_name="Description"
                    ),
                ),
                (
                    "logo",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="+",
                        to="wagtailimages.image",
                    ),
                ),
                (
                    "site",
                    models.OneToOneField(
                        editable=False,
                        on_delete=django.db.models.deletion.CASCADE,
                        to="wagtailcore.site",
                    ),
                ),
                (
                    "terms",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        to="wagtailcore.page",
                        verbose_name="Terms and conditions page",
                    ),
                ),
            ],
            options={
                "verbose_name": "Site Settings",
            },
        ),
        migrations.CreateModel(
            name="AbstractBasePage",
            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",
                    ),
                ),
                (
                    "meta_keywords",
                    models.TextField(
                        blank=True, null=True, verbose_name="Meta Keywords"
                    ),
                ),
                (
                    "search_image",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to="wagtailimages.image",
                        verbose_name="Search image",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
            bases=(
                wagtailmetadata.models.WagtailImageMetadataMixin,
                "wagtailcore.page",
                models.Model,
            ),
        ),
    ]
