Badges: Create templates for common paper sizes (#3660)

* Badges: Create templates for common paper sizes

* Add more sizes

* format lazy
This commit is contained in:
Raphael Michel
2023-11-03 12:37:20 +01:00
committed by GitHub
parent ec2085f125
commit 0400b577bb
4 changed files with 273 additions and 14 deletions

View File

@@ -25,9 +25,18 @@ from django.forms.models import ModelChoiceIterator
from django.utils.translation import gettext_lazy as _
from pretix.plugins.badges.models import BadgeItem, BadgeLayout
from pretix.plugins.badges.templates import TEMPLATES
class BadgeLayoutForm(forms.ModelForm):
template = forms.ChoiceField(
label=_('Template'),
help_text=_('You can modify the layout or change to a different page size in the next step.'),
choices=((k, v['label']) for k, v in TEMPLATES.items()),
widget=forms.RadioSelect,
initial='a6l',
)
class Meta:
model = BadgeLayout
fields = ('name',)