diff --git a/cmstabs/migrations/0010_auto_20230715_2221.py b/cmstabs/migrations/0010_auto_20230715_2221.py new file mode 100644 index 0000000000000000000000000000000000000000..05db45f0e6e7c5d425a42996dcc2ae3eb84532cb --- /dev/null +++ b/cmstabs/migrations/0010_auto_20230715_2221.py @@ -0,0 +1,20 @@ +# Generated by Django 2.2 on 2023-07-15 22:21 + +import django.core.validators +from django.db import migrations +import inkscape.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ('cmstabs', '0009_auto_20230621_1059'), + ] + + operations = [ + migrations.AlterField( + model_name='tab', + name='download', + field=inkscape.fields.FileImageFieldThumbailed(storage=inkscape.fields.CustomStorage(), upload_to='shields/backgrounds', validators=[django.core.validators.FileExtensionValidator(allowed_extensions=['svg', 'png', 'jpg', 'gif', 'webp'])], verbose_name='Background'), + ), + ] diff --git a/cmstabs/models.py b/cmstabs/models.py index da7bf47803c80b75cf8307480208048a4b486abd..00043be5dcb1a5ec60d2e6625f67922c4a4bfa82 100644 --- a/cmstabs/models.py +++ b/cmstabs/models.py @@ -35,6 +35,8 @@ from django.contrib.auth.models import Group from cms.models import CMSPlugin +from inkscape.fields import FileImageFieldThumbailed + from inkscape.fields import FileImageField from resources.models import License @@ -66,7 +68,7 @@ class Tab(Model): link = URLField(_('External Link'), **null) name = CharField(max_length=64) user = ForeignKey(settings.AUTH_USER_MODEL, on_delete=SET_NULL, related_name='front_tabs', **null) - download = FileField(_('Background'), upload_to='shields/backgrounds') + download = FileImageFieldThumbailed(_('Background'), upload_to='shields/backgrounds',thumb_width=800) license = ForeignKey(License, on_delete=SET_NULL, null=True) order = IntegerField(editable=True, **null) diff --git a/cmstabs/templates/cms/plugins/shield.html b/cmstabs/templates/cms/plugins/shield.html index 80d159bde5520e213b5c058aff55d2d3a4270433..b4f08d95efc0637c6de162ec5fb6aedd25727ca8 100644 --- a/cmstabs/templates/cms/plugins/shield.html +++ b/cmstabs/templates/cms/plugins/shield.html @@ -5,7 +5,7 @@