# Generated by Django 3.2.7 on 2022-10-25 16:59

from django.db import migrations, models

def add_default_navbar(app, _):
    NavbarItem = app.get_model('palanaeum', 'NavbarItem')
    NavbarItem(position = 0, single_link = True, label = 'Events', url = '/events/', icon_class = 'calendar').save()
    NavbarItem(position = 1, single_link = True, label = 'Recent', url = '/recent/', icon_class = 'clock-o').save()
    NavbarItem(position = 2, single_link = True, label = 'Tags', url = '/tags/', icon_class = 'tags').save()
    NavbarItem(position = 3, single_link = True, label = 'Wiki', url = 'https://coppermind.net/', icon_class = 'book').save()
    NavbarItem(position = 4, single_link = True, label = 'Chat', url = 'https://discord.gg/DUMHAVV', icon_class = 'tablet').save()
    
def noop(app, _):
    # don't actually need to do anything, but need to pass something to reverse_code
    pass

class Migration(migrations.Migration):

    dependencies = [
        ('palanaeum', '0018_aboutpage_to_helppage'),
    ]

    operations = [
        migrations.CreateModel(
            name='Link',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('label', models.CharField(max_length=32)),
                ('url', models.URLField()),
                ('icon_class', models.CharField(max_length=32)),
            ],
        ),
        migrations.CreateModel(
            name='NavbarItem',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('position', models.PositiveIntegerField(db_index=True)),
                ('label', models.CharField(max_length=32)),
                ('url', models.URLField(blank=True)),
                ('links', models.ManyToManyField(to='palanaeum.Link')),
                ('icon_class', models.CharField(max_length=32)),
                ('single_link', models.BooleanField(default=False)),
            ],
            options={
                'ordering': ('position',),
            },
        ),
        migrations.RunPython(add_default_navbar, reverse_code=noop),
    ]
