Add a custom text field for every attendee in the question step

This commit is contained in:
Raphael Michel
2020-12-10 18:19:25 +01:00
parent e7d2d0ddab
commit a665836a60
5 changed files with 19 additions and 0 deletions

View File

@@ -597,6 +597,7 @@ class EventSettingsSerializer(serializers.Serializer):
'attendee_addresses_required', 'attendee_addresses_required',
'attendee_company_asked', 'attendee_company_asked',
'attendee_company_required', 'attendee_company_required',
'attendee_data_explanation_text',
'confirm_texts', 'confirm_texts',
'order_email_asked_twice', 'order_email_asked_twice',
'payment_term_mode', 'payment_term_mode',

View File

@@ -1832,6 +1832,19 @@ Your {event} team"""))
"how to obtain a voucher code.") "how to obtain a voucher code.")
) )
}, },
'attendee_data_explanation_text': {
'default': '',
'type': LazyI18nString,
'serializer_class': I18nField,
'form_class': I18nFormField,
'form_kwargs': dict(
label=_("Attendee data explanation"),
widget=I18nTextarea,
widget_kwargs={'attrs': {'rows': '2'}},
help_text=_("This text will be shown above the questions asked for every admission product. You can use it e.g. to explain "
"why you need information from them.")
)
},
'checkout_email_helptext': { 'checkout_email_helptext': {
'default': LazyI18nString.from_gettext(gettext_noop( 'default': LazyI18nString.from_gettext(gettext_noop(
'Make sure to enter a valid email address. We will send you an order ' 'Make sure to enter a valid email address. We will send you an order '

View File

@@ -479,6 +479,7 @@ class EventSettingsForm(SettingsForm):
'attendee_company_required', 'attendee_company_required',
'attendee_addresses_asked', 'attendee_addresses_asked',
'attendee_addresses_required', 'attendee_addresses_required',
'attendee_data_explanation_text',
'banner_text', 'banner_text',
'banner_text_bottom', 'banner_text_bottom',
'order_email_asked_twice', 'order_email_asked_twice',

View File

@@ -98,6 +98,7 @@
{% bootstrap_field sform.attendee_addresses_asked layout="control" %} {% bootstrap_field sform.attendee_addresses_asked layout="control" %}
{% bootstrap_field sform.attendee_addresses_required layout="control" %} {% bootstrap_field sform.attendee_addresses_required layout="control" %}
{% bootstrap_field sform.checkout_show_copy_answers_button layout="control" %} {% bootstrap_field sform.checkout_show_copy_answers_button layout="control" %}
{% bootstrap_field sform.attendee_data_explanation_text layout="control" %}
</fieldset> </fieldset>
<fieldset> <fieldset>
<legend>{% trans "Texts" %}</legend> <legend>{% trans "Texts" %}</legend>

View File

@@ -75,6 +75,9 @@
</summary> </summary>
<div> <div>
<div class="panel-body questions-form"> <div class="panel-body questions-form">
{% if event.settings.attendee_data_explanation_text and pos.item.admission %}
{{ event.settings.attendee_data_explanation_text|rich_text }}
{% endif %}
{% if pos.seat %} {% if pos.seat %}
<div class="form-group"> <div class="form-group">
<label class="col-md-3 control-label"> <label class="col-md-3 control-label">