forked from CGM_Public/pretix_original
Form UX: Add more helpful placeholders
This commit is contained in:
@@ -176,6 +176,7 @@ class BasePaymentProvider:
|
|||||||
help_text=_('Will be printed just below the payment figures and above the closing text on invoices.'),
|
help_text=_('Will be printed just below the payment figures and above the closing text on invoices.'),
|
||||||
required=False,
|
required=False,
|
||||||
widget=I18nTextarea,
|
widget=I18nTextarea,
|
||||||
|
widget_kwargs={'attrs': {'rows': '2'}}
|
||||||
)),
|
)),
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|||||||
@@ -107,6 +107,9 @@ class EventWizardBasicsForm(I18nModelForm):
|
|||||||
self.initial['timezone'] = get_current_timezone_name()
|
self.initial['timezone'] = get_current_timezone_name()
|
||||||
self.fields['locale'].choices = [(a, b) for a, b in settings.LANGUAGES if a in self.locales]
|
self.fields['locale'].choices = [(a, b) for a, b in settings.LANGUAGES if a in self.locales]
|
||||||
self.fields['location'].widget.attrs['rows'] = '3'
|
self.fields['location'].widget.attrs['rows'] = '3'
|
||||||
|
self.fields['location'].widget.attrs['placeholder'] = _(
|
||||||
|
'Sample Conference Center\nHeidelberg, Germany'
|
||||||
|
)
|
||||||
self.fields['slug'].widget.prefix = build_absolute_uri(self.organizer, 'presale:organizer.index')
|
self.fields['slug'].widget.prefix = build_absolute_uri(self.organizer, 'presale:organizer.index')
|
||||||
if self.has_subevents:
|
if self.has_subevents:
|
||||||
del self.fields['presale_start']
|
del self.fields['presale_start']
|
||||||
@@ -196,6 +199,9 @@ class EventUpdateForm(I18nModelForm):
|
|||||||
super().__init__(*args, **kwargs)
|
super().__init__(*args, **kwargs)
|
||||||
self.fields['slug'].widget.attrs['readonly'] = 'readonly'
|
self.fields['slug'].widget.attrs['readonly'] = 'readonly'
|
||||||
self.fields['location'].widget.attrs['rows'] = '3'
|
self.fields['location'].widget.attrs['rows'] = '3'
|
||||||
|
self.fields['location'].widget.attrs['placeholder'] = _(
|
||||||
|
'Sample Conference Center\nHeidelberg, Germany'
|
||||||
|
)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Event
|
model = Event
|
||||||
@@ -352,13 +358,13 @@ class EventSettingsForm(SettingsForm):
|
|||||||
label=_("Imprint URL"),
|
label=_("Imprint URL"),
|
||||||
required=False,
|
required=False,
|
||||||
)
|
)
|
||||||
confirm_text = forms.CharField(
|
confirm_text = I18nFormField(
|
||||||
label=_('Confirmation text'),
|
label=_('Confirmation text'),
|
||||||
help_text=_('This text needs to be confirmed by the user before a purchase is possible. You could for example '
|
help_text=_('This text needs to be confirmed by the user before a purchase is possible. You could for example '
|
||||||
'link your terms of service here. If you use the Pages feature to publish your terms of service, '
|
'link your terms of service here. If you use the Pages feature to publish your terms of service, '
|
||||||
'you don\'t need this setting since you can configure it there.'),
|
'you don\'t need this setting since you can configure it there.'),
|
||||||
required=False,
|
required=False,
|
||||||
widget=forms.Textarea(attrs={"rows": 3})
|
widget=I18nTextarea
|
||||||
)
|
)
|
||||||
contact_mail = forms.EmailField(
|
contact_mail = forms.EmailField(
|
||||||
label=_("Contact address"),
|
label=_("Contact address"),
|
||||||
@@ -387,6 +393,14 @@ class EventSettingsForm(SettingsForm):
|
|||||||
})
|
})
|
||||||
return data
|
return data
|
||||||
|
|
||||||
|
def __init__(self, *args, **kwargs):
|
||||||
|
super().__init__(*args, **kwargs)
|
||||||
|
self.fields['confirm_text'].widget.attrs['rows'] = '3'
|
||||||
|
self.fields['confirm_text'].widget.attrs['placeholder'] = _(
|
||||||
|
'e.g. I hereby confirm that I have read and agree with the event organizer\'s terms of service '
|
||||||
|
'and agree with them.'
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class PaymentSettingsForm(SettingsForm):
|
class PaymentSettingsForm(SettingsForm):
|
||||||
payment_term_days = forms.IntegerField(
|
payment_term_days = forms.IntegerField(
|
||||||
@@ -538,25 +552,51 @@ class InvoiceSettingsForm(SettingsForm):
|
|||||||
choices=[]
|
choices=[]
|
||||||
)
|
)
|
||||||
invoice_address_from = forms.CharField(
|
invoice_address_from = forms.CharField(
|
||||||
widget=forms.Textarea(attrs={'rows': 5}), required=False,
|
widget=forms.Textarea(attrs={
|
||||||
|
'rows': 5,
|
||||||
|
'placeholder': _(
|
||||||
|
'Sample Event Company\n'
|
||||||
|
'Albert Einstein Road 52\n'
|
||||||
|
'12345 Samplecity'
|
||||||
|
)
|
||||||
|
}),
|
||||||
|
required=False,
|
||||||
label=_("Your address"),
|
label=_("Your address"),
|
||||||
help_text=_("Will be printed as the sender on invoices. Be sure to include relevant details required in "
|
help_text=_("Will be printed as the sender on invoices. Be sure to include relevant details required in "
|
||||||
"your jurisdiction (e.g. your VAT ID).")
|
"your jurisdiction.")
|
||||||
)
|
)
|
||||||
invoice_introductory_text = I18nFormField(
|
invoice_introductory_text = I18nFormField(
|
||||||
widget=I18nTextarea,
|
widget=I18nTextarea,
|
||||||
|
widget_kwargs={'attrs': {
|
||||||
|
'rows': 3,
|
||||||
|
'placeholder': _(
|
||||||
|
'e.g. With this document, we sent you the invoice for your ticket order.'
|
||||||
|
)
|
||||||
|
}},
|
||||||
required=False,
|
required=False,
|
||||||
label=_("Introductory text"),
|
label=_("Introductory text"),
|
||||||
help_text=_("Will be printed on every invoice above the invoice rows.")
|
help_text=_("Will be printed on every invoice above the invoice rows.")
|
||||||
)
|
)
|
||||||
invoice_additional_text = I18nFormField(
|
invoice_additional_text = I18nFormField(
|
||||||
widget=I18nTextarea,
|
widget=I18nTextarea,
|
||||||
|
widget_kwargs={'attrs': {
|
||||||
|
'rows': 3,
|
||||||
|
'placeholder': _(
|
||||||
|
'e.g. Thank you for your purchase! You can find more information on the event at ...'
|
||||||
|
)
|
||||||
|
}},
|
||||||
required=False,
|
required=False,
|
||||||
label=_("Additional text"),
|
label=_("Additional text"),
|
||||||
help_text=_("Will be printed on every invoice below the invoice total.")
|
help_text=_("Will be printed on every invoice below the invoice total.")
|
||||||
)
|
)
|
||||||
invoice_footer_text = I18nFormField(
|
invoice_footer_text = I18nFormField(
|
||||||
widget=I18nTextarea,
|
widget=I18nTextarea,
|
||||||
|
widget_kwargs={'attrs': {
|
||||||
|
'rows': 5,
|
||||||
|
'placeholder': _(
|
||||||
|
'e.g. your bank details, legal details like your VAT ID, registration numbers, etc.'
|
||||||
|
)
|
||||||
|
}},
|
||||||
required=False,
|
required=False,
|
||||||
label=_("Footer"),
|
label=_("Footer"),
|
||||||
help_text=_("Will be printed centered and in a smaller font at the end of every invoice page.")
|
help_text=_("Will be printed centered and in a smaller font at the end of every invoice page.")
|
||||||
@@ -599,7 +639,13 @@ class MailSettingsForm(SettingsForm):
|
|||||||
required=False,
|
required=False,
|
||||||
widget=I18nTextarea,
|
widget=I18nTextarea,
|
||||||
help_text=_("This will be attached to every email. Available placeholders: {event}"),
|
help_text=_("This will be attached to every email. Available placeholders: {event}"),
|
||||||
validators=[PlaceholderValidator(['{event}'])]
|
validators=[PlaceholderValidator(['{event}'])],
|
||||||
|
widget_kwargs={'attrs': {
|
||||||
|
'rows': '4',
|
||||||
|
'placeholder': _(
|
||||||
|
'e.g. your contact details'
|
||||||
|
)
|
||||||
|
}}
|
||||||
)
|
)
|
||||||
|
|
||||||
mail_text_order_placed = I18nFormField(
|
mail_text_order_placed = I18nFormField(
|
||||||
@@ -704,14 +750,17 @@ class MailSettingsForm(SettingsForm):
|
|||||||
)
|
)
|
||||||
smtp_host = forms.CharField(
|
smtp_host = forms.CharField(
|
||||||
label=_("Hostname"),
|
label=_("Hostname"),
|
||||||
required=False
|
required=False,
|
||||||
|
widget=forms.TextInput(attrs={'placeholder': 'mail.example.org'})
|
||||||
)
|
)
|
||||||
smtp_port = forms.IntegerField(
|
smtp_port = forms.IntegerField(
|
||||||
label=_("Port"),
|
label=_("Port"),
|
||||||
required=False
|
required=False,
|
||||||
|
widget=forms.TextInput(attrs={'placeholder': 'e.g. 587, 465, 25, ...'})
|
||||||
)
|
)
|
||||||
smtp_username = forms.CharField(
|
smtp_username = forms.CharField(
|
||||||
label=_("Username"),
|
label=_("Username"),
|
||||||
|
widget=forms.TextInput(attrs={'placeholder': 'myuser@example.org'}),
|
||||||
required=False
|
required=False
|
||||||
)
|
)
|
||||||
smtp_password = forms.CharField(
|
smtp_password = forms.CharField(
|
||||||
|
|||||||
@@ -268,6 +268,11 @@ class ItemUpdateForm(I18nModelForm):
|
|||||||
super().__init__(*args, **kwargs)
|
super().__init__(*args, **kwargs)
|
||||||
self.fields['category'].queryset = self.instance.event.categories.all()
|
self.fields['category'].queryset = self.instance.event.categories.all()
|
||||||
self.fields['tax_rule'].queryset = self.instance.event.tax_rules.all()
|
self.fields['tax_rule'].queryset = self.instance.event.tax_rules.all()
|
||||||
|
self.fields['description'].widget.attrs['placeholder'] = _(
|
||||||
|
'e.g. This reduced price is available for full-time students, jobless and people '
|
||||||
|
'over 65. This ticket includes access to all parts of the event, except the VIP '
|
||||||
|
'area.'
|
||||||
|
)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Item
|
model = Item
|
||||||
|
|||||||
@@ -19,6 +19,18 @@ class BankTransfer(BasePaymentProvider):
|
|||||||
form_field = I18nFormField(
|
form_field = I18nFormField(
|
||||||
label=_('Bank account details'),
|
label=_('Bank account details'),
|
||||||
widget=I18nTextarea,
|
widget=I18nTextarea,
|
||||||
|
help_text=_('Include everything that your customers need to send you a bank transfer payment. Within SEPA '
|
||||||
|
'countries, IBAN, BIC and account owner should suffice. If you have lots of international '
|
||||||
|
'customers, they might also need your full address and your bank\'s full address.'),
|
||||||
|
widget_kwargs={'attrs': {
|
||||||
|
'rows': '4',
|
||||||
|
'placeholder': _(
|
||||||
|
'e.g. IBAN: DE12 1234 5678 8765 4321\n'
|
||||||
|
'BIC: GENEXAMPLE1\n'
|
||||||
|
'Account owner: John Doe\n'
|
||||||
|
'Name of Bank: Professional Banking Institute Ltd., London'
|
||||||
|
)
|
||||||
|
}}
|
||||||
)
|
)
|
||||||
return OrderedDict(
|
return OrderedDict(
|
||||||
list(super().settings_form_fields.items()) + [('bank_details', form_field)]
|
list(super().settings_form_fields.items()) + [('bank_details', form_field)]
|
||||||
|
|||||||
Reference in New Issue
Block a user