Merge remote-tracking branch 'origin/main' into main

This commit is contained in:
Jonas 12t 2022-01-11 11:25:56 +04:00
commit 065b71babd
3 changed files with 44 additions and 7 deletions

View File

@ -0,0 +1,30 @@
# Generated by Django 2.2 on 2021-12-21 13:23
from django.db import migrations, models
import stdimage.models
import stdimage.validators
class Migration(migrations.Migration):
dependencies = [
('BaseBillet', '0021_auto_20211206_1810'),
]
operations = [
migrations.AlterField(
model_name='configuration',
name='template_billetterie',
field=models.CharField(blank=True, choices=[('html5up-massively', 'html5up-massively'), ('arnaud_mvc', 'arnaud_mvc'), ('original_arnaud', 'original_arnaud')], max_length=250, null=True, verbose_name='Template Billetterie'),
),
migrations.AlterField(
model_name='configuration',
name='template_meta',
field=models.CharField(blank=True, choices=[('html5up-story', 'html5up-story'), ('blk-mit', 'blk-mit')], max_length=250, null=True, verbose_name='Template Meta'),
),
migrations.AlterField(
model_name='product',
name='img',
field=stdimage.models.StdImageField(blank=True, null=True, upload_to='images/', validators=[stdimage.validators.MaxSizeValidator(1920, 1920)], verbose_name='Image du produit'),
),
]

View File

@ -158,8 +158,18 @@ class Configuration(SingletonModel):
verbose_name=_("Clé d'API du serveur cashless") verbose_name=_("Clé d'API du serveur cashless")
) )
ARNAUD, MASSIVELY, BLK_MVC, BLK_VUE = 'arnaud_mvc', 'html5up-masseively', 'blk_mvc', 'blk_vue'
CHOICE_TEMPLATE = [
(ARNAUD, _('arnaud_mvc')),
(MASSIVELY, _("html5up-masseively")),
(BLK_MVC, _("blk_mvc")),
(BLK_VUE, _("blk_vue")),
]
# choices=[(folder, folder) for folder in os.listdir(f"{settings.BASE_DIR}/BaseBillet/templates")],
template_billetterie = models.CharField( template_billetterie = models.CharField(
choices=[(folder, folder) for folder in os.listdir(f"{settings.BASE_DIR}/BaseBillet/templates")], choices=CHOICE_TEMPLATE,
default=ARNAUD,
max_length=250, max_length=250,
blank=True, blank=True,
null=True, null=True,
@ -167,7 +177,8 @@ class Configuration(SingletonModel):
) )
template_meta = models.CharField( template_meta = models.CharField(
choices=[(folder, folder) for folder in os.listdir(f"{settings.BASE_DIR}/MetaBillet/templates")], choices=CHOICE_TEMPLATE,
default=MASSIVELY,
max_length=250, max_length=250,
blank=True, blank=True,
null=True, null=True,

View File

@ -24,14 +24,10 @@ class index(APIView):
if not configuration.activer_billetterie: if not configuration.activer_billetterie:
return HttpResponseRedirect('https://www.tibillet.re') return HttpResponseRedirect('https://www.tibillet.re')
first_event = None
events = Event.objects.filter(datetime__gt=datetime.now())
if len(events) > 0:
first_event = events[0]
context = { context = {
'configuration': configuration, 'configuration': configuration,
'events': events, 'events': Event.objects.filter(datetime__gt=datetime.now()),
'categorie_billet': Product.BILLET, 'categorie_billet': Product.BILLET,
} }