Configure PayPal integration and cart checkout error display
This commit is contained in:
1 parent
62065828e1
commit
cf07fc5d9b
98 files changed
+1430
-281
No files matched your search
@@ -0,0 +1,37 @@
|
||||
# Generated by Django 5.2.19 on 2026-11-26 11:05
|
||||
|
||||
import django.core.validators
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('catalog', '0026_member_content'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='chapter',
|
||||
name='price_usd',
|
||||
field=models.DecimalField(blank=True, decimal_places=2, help_text='Set at least $0.50 for a Stripe chapter purchase. Leave blank if this chapter is only available to members.', max_digits=7, null=True, validators=[django.core.validators.MinValueValidator(0)], verbose_name='Chapter price (USD)'),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='ManagedPage',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('title', models.CharField(max_length=160)),
|
||||
('map_slot', models.CharField(blank=True, editable=False, max_length=50)),
|
||||
('slug', models.SlugField(unique=True)),
|
||||
('body', models.TextField(blank=True)),
|
||||
('link', models.CharField(blank=True, help_text='Optional local destination, such as /shop/. Leave blank to publish the page body.', max_length=240)),
|
||||
('menu_key', models.CharField(blank=True, help_text='Optional existing menu key to replace, such as read, blog, or shop.', max_length=32)),
|
||||
('published', models.BooleanField(default=False)),
|
||||
('show_in_menu', models.BooleanField(default=False)),
|
||||
('homepage', models.BooleanField(default=False)),
|
||||
],
|
||||
options={
|
||||
'constraints': [models.UniqueConstraint(condition=models.Q(('homepage', True)), fields=('homepage',), name='slx_single_managed_home')],
|
||||
},
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,33 @@
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
def seed(apps, schema_editor):
|
||||
Page = apps.get_model('catalog', 'ManagedPage')
|
||||
rows = [
|
||||
('solterra-map', 'Explore Sol’Terra', '/map/', ''),
|
||||
('about', 'Series introduction', '/about/', ''),
|
||||
('chapters', 'Read', '/chapters/', 'read'),
|
||||
('blog', 'Blog', '/blog/', 'blog'),
|
||||
('reviews', 'Reviews', '/reviews/', 'reviews'),
|
||||
('upcoming', 'Upcoming', '/upcoming/', 'upcoming'),
|
||||
('live', 'SLX Live', '/live/', 'live'),
|
||||
('cast', 'Cast', '/cast/', 'cast'),
|
||||
('world', 'World archive', '/world/', 'world'),
|
||||
('shop', 'Shop', '/shop/', 'shop'),
|
||||
('cart', 'Shopping cart', '/shop/cart/', ''),
|
||||
('newsletter', 'Newsletter', '/newsletter/', ''),
|
||||
('membership', 'Membership', '/membership/', 'membership'),
|
||||
('library', 'My library', '/fan/library/', 'library'),
|
||||
('countdown', 'Release countdown', '/coming-soon/', ''),
|
||||
('djinnii', 'Djinnii', '/djinnii/', ''),
|
||||
('community', 'Community', '/community/', 'community'),
|
||||
('search', 'Search', '/search/', 'search'),
|
||||
]
|
||||
for slug, title, path, key in rows:
|
||||
Page.objects.using(schema_editor.connection.alias).get_or_create(
|
||||
slug=slug, defaults={'title':title, 'link':path, 'published':True, 'menu_key':key, 'map_slot':slug})
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [('catalog','0027_alter_chapter_price_usd_managedpage')]
|
||||
operations = [migrations.RunPython(seed, migrations.RunPython.noop)]
|
||||
@@ -0,0 +1,33 @@
|
||||
# Generated by Django 5.2.19 on 2026-11-26 11:24
|
||||
|
||||
import django.core.validators
|
||||
import django.db.models.deletion
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('catalog', '0028_default_managed_pages'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='MapLocation',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('title', models.CharField(max_length=80)),
|
||||
('key', models.SlugField(unique=True)),
|
||||
('path', models.CharField(blank=True, help_text='Optional override, e.g. /chapters/9/. Leave blank to follow the selected page.', max_length=240)),
|
||||
('fallback_path', models.CharField(blank=True, editable=False, max_length=240)),
|
||||
('x', models.DecimalField(decimal_places=5, max_digits=8, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(100)])),
|
||||
('y', models.DecimalField(decimal_places=5, max_digits=8, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(100)])),
|
||||
('visible', models.BooleanField(default=True)),
|
||||
('position', models.PositiveIntegerField(default=0)),
|
||||
('page', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='catalog.managedpage')),
|
||||
],
|
||||
options={
|
||||
'ordering': ['position', 'pk'],
|
||||
},
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,21 @@
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
ROWS = [('about', 'start', '8.88672', '3.41880', 'Series introduction'), ('upcoming', 'upcoming', '55.46875', '6.58120', 'Next releases'), ('cast', 'cast', '66.65039', '17.09402', 'Meet the cast'), ('world', 'world', '88.47656', '26.66667', 'World archive'), ('blog', 'blog', '13.81836', '39.40171', 'Studio blog'), ('chapters', 'chapters', '35.44922', '43.33333', 'Read chapters'), ('reviews', 'reviews', '53.36914', '48.97436', 'Reader reviews'), ('live', 'live', '62.45117', '60.76923', 'SLX Live'), ('membership', 'membership', '41.55273', '67.43590', 'Membership'), ('shop', 'shop', '74.90234', '73.33333', 'Shop'), ('cart', 'cart', '96.53320', '73.58974', 'Shopping cart'), ('newsletter', 'newsletter', '11.37695', '81.11111', 'Newsletter'), ('library', 'library', '15.18555', '84.87179', 'My library'), ('countdown', 'release', '61.13281', '88.88889', 'Release countdown')]
|
||||
|
||||
|
||||
def seed(apps, schema_editor):
|
||||
Page = apps.get_model('catalog', 'ManagedPage')
|
||||
Location = apps.get_model('catalog', 'MapLocation')
|
||||
db = schema_editor.connection.alias
|
||||
for position, (slot, key, x, y, title) in enumerate(ROWS):
|
||||
page = Page.objects.using(db).filter(map_slot=slot).first()
|
||||
fallback = {'cart': '/shop/cart/', 'library': '/fan/library/', 'release': '/coming-soon/'}.get(key, '/' + slot + '/')
|
||||
Location.objects.using(db).get_or_create(key=key, defaults=dict(
|
||||
title=title, x=x, y=y, page_id=page.pk if page else None,
|
||||
fallback_path=fallback, position=position))
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [('catalog', '0029_map_location')]
|
||||
operations = [migrations.RunPython(seed, migrations.RunPython.noop)]
|
||||
@@ -0,0 +1,32 @@
|
||||
# Generated by Django 5.2.19 on 2026-11-26 12:55
|
||||
|
||||
import catalog.models
|
||||
import django.db.models.deletion
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('catalog', '0030_seed_map_locations'),
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='sitesettings',
|
||||
name='countdown_map_position',
|
||||
field=models.CharField(choices=[('above', 'Above countdown content'), ('below', 'Below countdown content')], default='below', max_length=6),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='CollectorProfile',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('display_name', models.CharField(blank=True, max_length=80)),
|
||||
('photo', catalog.models.StudioImageField(blank=True, upload_to=catalog.models.image_path, validators=[catalog.models.validate_image])),
|
||||
('public', models.BooleanField(default=False)),
|
||||
('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
|
||||
],
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,23 @@
|
||||
# Generated by Django 5.2.19 on 2026-11-26 13:54
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('catalog', '0031_sitesettings_countdown_map_position_collectorprofile'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='fanmembership',
|
||||
name='member_tier',
|
||||
field=models.PositiveSmallIntegerField(choices=[(1, 'Early Access'), (2, 'Studio Vault'), (3, 'Collector’s Circle')], default=1, verbose_name='Content tier'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='memberpost',
|
||||
name='required_tier',
|
||||
field=models.PositiveSmallIntegerField(choices=[(1, 'Early Access'), (2, 'Studio Vault'), (3, 'Collector’s Circle')], default=1),
|
||||
),
|
||||
]
|
||||
Reference in new issue
Block a user