Allowing more options to style pretix shops (#1585)

* Fix caching issues in SASS compilation

* Allow to set a custom page background color

* Allow to disable round corners

* Support larger header pictures

* Allow to show title despite header

* Move language picker

* FIx widget styles
This commit is contained in:
Raphael Michel
2020-02-27 10:54:00 +01:00
committed by GitHub
parent b622854be6
commit 3fd650081b
22 changed files with 650 additions and 72 deletions

View File

@@ -1,9 +1,11 @@
import hashlib
from django.conf import settings
from django.core.cache import cache
from django.core.files.base import ContentFile, File
from django.core.files.storage import default_storage
from django.core.management.base import BaseCommand
from django.utils.timezone import now
from django_scopes import scopes_disabled
from pretix.base.models import Event_SettingsStore, Organizer_SettingsStore
@@ -16,12 +18,27 @@ from ...style import regenerate_css, regenerate_organizer_css
class Command(BaseCommand):
help = "Re-generate all custom stylesheets and scripts"
def add_arguments(self, parser):
parser.add_argument('--organizer', action='store', type=str)
parser.add_argument('--event', action='store', type=str)
@scopes_disabled()
def handle(self, *args, **options):
for es in Organizer_SettingsStore.objects.filter(key="presale_css_file"):
# Reset compile cache
cache.set('sass_compile_prefix', now().isoformat())
ostore = Organizer_SettingsStore.objects.filter(key="presale_css_file")
if options.get('organizer'):
ostore = ostore.filter(object__slug=options['organizer'])
for es in ostore:
regenerate_organizer_css.apply_async(args=(es.object_id,))
for es in Event_SettingsStore.objects.filter(key="presale_css_file").order_by('-object__date_from'):
estore = Event_SettingsStore.objects.filter(key="presale_css_file").order_by('-object__date_from')
if options.get('event'):
estore = estore.filter(object__slug=options['event'])
if options.get('organizer'):
estore = estore.filter(object__organizer__slug=options['event'])
for es in estore:
regenerate_css.apply_async(args=(es.object_id,))
gs = GlobalSettingsObject()