39 lines
2.9 KiB
Python
39 lines
2.9 KiB
Python
# Generated by Django 5.2.19 on 2026-11-22 14:25
|
|
|
|
import catalog.backgrounds
|
|
import catalog.models
|
|
import django.core.validators
|
|
from django.db import migrations, models
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
|
('catalog', '0021_countdown_progress'),
|
|
]
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name='FloatingArtwork',
|
|
fields=[
|
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('name', models.CharField(help_text='A name to help you identify this image in Studio.', max_length=100, verbose_name='Studio label')),
|
|
('path', models.CharField(default='/', help_text='Choose a page or enter its exact path, such as /chapters/9/.', max_length=200, validators=[catalog.backgrounds.validate_background_path], verbose_name='Page path')),
|
|
('art', catalog.models.StudioImageField(help_text='Upload JPG, PNG, or WebP. A transparent PNG works well for character cutouts.', upload_to=catalog.models.image_path, validators=[catalog.models.validate_image], verbose_name='Image')),
|
|
('alt', models.CharField(blank=True, help_text='Describe the image if it adds meaning. Leave blank if it is decorative.', max_length=180, verbose_name='Image description')),
|
|
('placement', models.CharField(choices=[('top', 'Near the top'), ('bottom', 'Below the page content')], default='top', help_text='On the homepage, top artwork appears immediately below the released chapters.', max_length=6)),
|
|
('alignment', models.CharField(choices=[('left', 'Left'), ('center', 'Center'), ('right', 'Right')], default='center', max_length=6)),
|
|
('width', models.PositiveSmallIntegerField(default=280, validators=[django.core.validators.MinValueValidator(48), django.core.validators.MaxValueValidator(480)], verbose_name='Maximum width (px)')),
|
|
('cycle_seconds', models.PositiveSmallIntegerField(default=12, help_text='Time to drift up and back down. Higher is slower.', validators=[django.core.validators.MinValueValidator(6), django.core.validators.MaxValueValidator(40)], verbose_name='Float cycle (seconds)')),
|
|
('lift', models.PositiveSmallIntegerField(default=16, help_text='How far the artwork floats up. Set to zero for a stationary image.', validators=[django.core.validators.MaxValueValidator(40)], verbose_name='Lift height (px)')),
|
|
('order', models.PositiveSmallIntegerField(default=0, help_text='Lower numbers appear first in the same column.', verbose_name='Display order')),
|
|
('enabled', models.BooleanField(default=True)),
|
|
],
|
|
options={
|
|
'verbose_name_plural': 'floating artwork',
|
|
'ordering': ['order', 'pk'],
|
|
'indexes': [models.Index(fields=['path', 'enabled'], name='slx_float_path_enabled')],
|
|
},
|
|
),
|
|
]
|