2020-11-19 09:40:03 +01:00
|
|
|
from django import forms
|
2023-12-15 22:09:23 +01:00
|
|
|
from django.utils.translation import gettext_lazy as _
|
2020-11-19 09:40:03 +01:00
|
|
|
from pretix.base.forms import SettingsForm
|
|
|
|
|
|
|
|
|
2023-12-15 22:09:23 +01:00
|
|
|
class PretixDigitalItemsSettingsForm(SettingsForm):
|
|
|
|
digitalitems_token_url_format = forms.CharField(
|
|
|
|
label=_("Token url format"),
|
|
|
|
help_text=_(
|
|
|
|
"This should return an url to link to. Available placeholder are {name} for the item name and {secret} for the token code."
|
|
|
|
),
|
|
|
|
widget=forms.TextInput(attrs={"placeholder": "http://localhost?secret={secret}"}),
|
|
|
|
required=False,
|
|
|
|
)
|
|
|
|
digitalitems_token_mail_format = forms.CharField(
|
|
|
|
label=_("Token mail format"),
|
|
|
|
help_text=_(
|
|
|
|
"This text will be included for every token in an email. Available placeholder are {name} for the item name and {secret} for the token code."
|
|
|
|
),
|
|
|
|
widget=forms.TextInput(attrs={"placeholder": "{name}: {secret}"}),
|
|
|
|
required=False,
|
|
|
|
)
|
|
|
|
digitalitems_token_export_format = forms.CharField(
|
|
|
|
label=_("Token export format"),
|
|
|
|
help_text=_(
|
|
|
|
"This text will be included for every token in a TXT export. Available placeholder are {name} for the item name and {secret} for the token code."
|
|
|
|
),
|
|
|
|
widget=forms.TextInput(attrs={"placeholder": "{name}: {secret}"}),
|
|
|
|
required=False,
|
|
|
|
)
|