# Generated by Django 4.1.7 on 2023-05-11 11:51

from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import model_porter.support_mixin
import tour_guide.blocks
import tour_guide.model_fields
import tour_guide.validators
import wagtail_block_model_field.fields
import wagtail_dynamic_choice.model_fields
import wagtail_switch_block.blocks


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('wagtailcore', '0078_referenceindex'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='AnchorCategorySetting',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=128, unique=True)),
                ('identifier', models.CharField(max_length=128, unique=True, validators=[tour_guide.validators.validate_identifier])),
                ('label', models.CharField(blank=True, default='Figure', max_length=128)),
                ('label_plural', models.CharField(blank=True, default='Figures', max_length=128)),
                ('label_short', models.CharField(blank=True, default='Fig', max_length=128)),
                ('link_css_class', models.CharField(blank=True, default='', max_length=128)),
                ('label_css_class', models.CharField(blank=True, default='', max_length=128)),
                ('number_format', wagtail_dynamic_choice.model_fields.DynamicChoiceField(choices_function_name='tour_guide.anchors.number_format_choices', default='numbers', max_length=128)),
                ('identifier_format', wagtail_dynamic_choice.model_fields.DynamicChoiceField(choices_function_name='tour_guide.anchors.identifier_format_choices', default='generic', max_length=128)),
            ],
            options={
                'verbose_name': 'Anchor Category',
                'verbose_name_plural': 'Anchor Categories',
            },
        ),
        migrations.CreateModel(
            name='NavigationStyle',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('identifier', models.CharField(max_length=128, validators=[django.core.validators.RegexValidator('^[A-Za-z_][A-Za-z_0-9]*$', code='invalid_identifier', message='A valid identifier starts with an alphanumeric letter or underscore and contains only alphanumeric letters, underscores or digits.')])),
                ('name', models.CharField(max_length=128)),
                ('builder', wagtail_block_model_field.fields.BlockModelField(tour_guide.blocks.NavigationBuilderBlock(), wagtail_switch_block.blocks.SwitchValue)),
                ('presenter', wagtail_block_model_field.fields.BlockModelField(tour_guide.blocks.NavigationPresenterBlock(), wagtail_switch_block.blocks.SwitchValue)),
                ('created_at', models.DateTimeField(default=None, editable=False, verbose_name='created at')),
                ('created_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='created by user')),
            ],
            options={
                'verbose_name': 'Navigation Style',
                'verbose_name_plural': 'Navigation Styles',
            },
        ),
        migrations.CreateModel(
            name='NavigationTarget',
            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')),
                ('rich_link', wagtail_block_model_field.fields.BlockModelField(tour_guide.blocks.RichLinkBlock(label='Rich Link'), tour_guide.blocks.RichLinkBlockValue)),
                ('navigation_categories', tour_guide.model_fields.NavigationCategoriesField(blank=True, choices_function_name='tour_guide.categories.navigation_category_choices', max_length=128, verbose_name='Navigation Categories')),
            ],
            options={
                'verbose_name': 'Navigation Target',
                'verbose_name_plural': 'Navigation Targets',
            },
            bases=(model_porter.support_mixin.ModelPorterSupportMixin, 'wagtailcore.page'),
        ),
        migrations.CreateModel(
            name='NavigationStyleAlias',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('identifier', models.CharField(default='', max_length=128, validators=[django.core.validators.RegexValidator('^[A-Za-z_][A-Za-z_0-9]*$', code='invalid_identifier', message='A valid identifier starts with an alphanumeric letter or underscore and contains only alphanumeric letters, underscores or digits.')])),
                ('style', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='aliases', to='tour_guide.navigationstyle')),
            ],
            options={
                'verbose_name': 'Navigation Alias',
                'verbose_name_plural': 'Navigation Aliases',
            },
        ),
        migrations.AddConstraint(
            model_name='anchorcategorysetting',
            constraint=models.UniqueConstraint(fields=('identifier',), name='unique_tour_guide_anchorcategorysetting.identifier'),
        ),
        migrations.AddConstraint(
            model_name='anchorcategorysetting',
            constraint=models.UniqueConstraint(fields=('name',), name='unique_tour_guide_anchorcategorysetting.name'),
        ),
        migrations.AddConstraint(
            model_name='navigationstylealias',
            constraint=models.UniqueConstraint(fields=('identifier',), name='unique_tour_guide_navigationstylealias.identifier'),
        ),
        migrations.AddConstraint(
            model_name='navigationstyle',
            constraint=models.UniqueConstraint(fields=('identifier',), name='unique_tour_guide_navigationstyle.identifier'),
        ),
    ]
