forked from CGM_Public/pretix_original
Add a custom text to explain usage of vouchers
This commit is contained in:
@@ -523,6 +523,10 @@ Your {event} team"""))
|
||||
'default': '',
|
||||
'type': LazyI18nString
|
||||
},
|
||||
'voucher_explanation_text': {
|
||||
'default': '',
|
||||
'type': LazyI18nString
|
||||
},
|
||||
'organizer_info_text': {
|
||||
'default': '',
|
||||
'type': LazyI18nString
|
||||
|
||||
@@ -981,6 +981,14 @@ class DisplaySettingsForm(SettingsForm):
|
||||
required=False,
|
||||
widget=I18nTextarea
|
||||
)
|
||||
voucher_explanation_text = I18nFormField(
|
||||
label=_("Voucher explanation"),
|
||||
required=False,
|
||||
widget=I18nTextarea,
|
||||
widget_kwargs={'attrs': {'rows': '2'}},
|
||||
help_text=_("This text will be shown next to the input for a voucher code. You can use it e.g. to explain "
|
||||
"how to obtain a voucher code.")
|
||||
)
|
||||
show_variations_expanded = forms.BooleanField(
|
||||
label=_("Show variations of a product expanded by default"),
|
||||
required=False
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
<legend>{% trans "Event page" %}</legend>
|
||||
{% bootstrap_field form.logo_image layout="control" %}
|
||||
{% bootstrap_field form.frontpage_text layout="control" %}
|
||||
{% bootstrap_field form.voucher_explanation_text layout="control" %}
|
||||
{% bootstrap_field form.show_variations_expanded layout="control" %}
|
||||
{% bootstrap_field form.meta_noindex layout="control" %}
|
||||
{% if form.frontpage_subevent_ordering %}
|
||||
|
||||
@@ -458,6 +458,11 @@
|
||||
{% if show_vouchers %}
|
||||
<section class="front-page">
|
||||
<h3>{% trans "Redeem a voucher" %}</h3>
|
||||
{% if event.settings.voucher_explanation_text %}
|
||||
<div>
|
||||
{{ event.settings.voucher_explanation_text|rich_text }}
|
||||
</div>
|
||||
{% endif %}
|
||||
<form method="get" action="{% eventurl event "presale:event.redeem" cart_namespace=cart_namespace %}">
|
||||
<div class="row-voucher">
|
||||
<div class="col-md-8 col-sm-6 col-xs-12">
|
||||
|
||||
Reference in New Issue
Block a user