diff --git a/src/pretix/api/serializers/event.py b/src/pretix/api/serializers/event.py index 5ac98d62b..d087de736 100644 --- a/src/pretix/api/serializers/event.py +++ b/src/pretix/api/serializers/event.py @@ -796,6 +796,8 @@ class EventSettingsSerializer(SettingsSerializer): 'cancel_allow_user_paid_refund_as_giftcard', 'cancel_allow_user_paid_require_approval', 'cancel_allow_user_paid_require_approval_fee_unknown', + 'cancel_terms_paid', + 'cancel_terms_unpaid', 'change_allow_user_variation', 'change_allow_user_addons', 'change_allow_user_until', diff --git a/src/pretix/base/settings.py b/src/pretix/base/settings.py index 069db06af..3c5cd9fdd 100644 --- a/src/pretix/base/settings.py +++ b/src/pretix/base/settings.py @@ -1936,6 +1936,32 @@ DEFAULTS = { label=_("Do not allow cancellations after"), ) }, + 'cancel_terms_paid': { + 'default': None, + 'type': LazyI18nString, + 'serializer_class': I18nField, + 'form_class': I18nFormField, + 'form_kwargs': dict( + label=_("Terms of cancellation"), + widget=I18nTextarea, + widget_kwargs={'attrs': {'rows': '2'}}, + help_text=_("This text will be shown when cancellation is allowed for a paid order. Leave empty if you " + "want pretix to automatically generate the terms of cancellation based on your settings.") + ) + }, + 'cancel_terms_unpaid': { + 'default': None, + 'type': LazyI18nString, + 'serializer_class': I18nField, + 'form_class': I18nFormField, + 'form_kwargs': dict( + label=_("Terms of cancellation"), + widget=I18nTextarea, + widget_kwargs={'attrs': {'rows': '2'}}, + help_text=_("This text will be shown when cancellation is allowed for an unpaid or free order. Leave empty " + "if you want pretix to automatically generate the terms of cancellation based on your settings.") + ) + }, 'contact_mail': { 'default': None, 'type': str, diff --git a/src/pretix/control/forms/event.py b/src/pretix/control/forms/event.py index c84aa1fec..c03e6bd67 100644 --- a/src/pretix/control/forms/event.py +++ b/src/pretix/control/forms/event.py @@ -730,6 +730,8 @@ class CancelSettingsForm(SettingsForm): 'cancel_allow_user_paid_refund_as_giftcard', 'cancel_allow_user_paid_require_approval', 'cancel_allow_user_paid_require_approval_fee_unknown', + 'cancel_terms_paid', + 'cancel_terms_unpaid', 'change_allow_user_variation', 'change_allow_user_price', 'change_allow_user_until', diff --git a/src/pretix/control/templates/pretixcontrol/event/cancel.html b/src/pretix/control/templates/pretixcontrol/event/cancel.html index e06e0f966..7a206c706 100644 --- a/src/pretix/control/templates/pretixcontrol/event/cancel.html +++ b/src/pretix/control/templates/pretixcontrol/event/cancel.html @@ -14,6 +14,7 @@ {% bootstrap_field form.cancel_allow_user_unpaid_keep layout="control" %} {% bootstrap_field form.cancel_allow_user_unpaid_keep_percentage layout="control" %} {% bootstrap_field form.cancel_allow_user_unpaid_keep_fees layout="control" %} + {% bootstrap_field form.cancel_terms_unpaid layout="control" %}
{% trans "Paid orders" %} @@ -32,6 +33,7 @@ {% bootstrap_field form.cancel_allow_user_paid_adjust_fees_step layout="control" %} {% bootstrap_field form.cancel_allow_user_paid_refund_as_giftcard layout="control" %} + {% bootstrap_field form.cancel_terms_paid layout="control" %} {% if not gets_notification %}
{% blocktrans trimmed %} diff --git a/src/pretix/presale/templates/pretixpresale/event/order.html b/src/pretix/presale/templates/pretixpresale/event/order.html index 6f0a74435..137d5b74b 100644 --- a/src/pretix/presale/templates/pretixpresale/event/order.html +++ b/src/pretix/presale/templates/pretixpresale/event/order.html @@ -368,7 +368,9 @@ {% if user_cancel_allowed %}
  • {% if order.status == "p" and order.total != 0 %} - {% if request.event.settings.cancel_allow_user_paid_require_approval and request.event.settings.cancel_allow_user_paid_require_approval_fee_unknown %} + {% if request.event.settings.cancel_terms_paid %} + {{ request.event.settings.cancel_terms_paid|rich_text }} + {% elif request.event.settings.cancel_allow_user_paid_require_approval and request.event.settings.cancel_allow_user_paid_require_approval_fee_unknown %}

    {% blocktrans trimmed %} You can request to cancel this order. @@ -445,35 +447,31 @@ {% trans "This will invalidate all tickets in this order." %}

    {% endif %} + {% else %}

    + {% if request.event.settings.cancel_terms_unpaid %} + {{ request.event.settings.cancel_terms_unpaid|rich_text }} + {% elif order.total != 0 and order.user_cancel_fee %} + {% blocktrans trimmed with fee=order.user_cancel_fee|money:request.event.currency %} + You can cancel this order. As per our cancellation policy, you will still be required + to pay a cancellation fee of {{ fee }}. + {% endblocktrans %} + {% trans "This will invalidate all tickets in this order." %} + {% else %} + {% blocktrans trimmed %} + You can cancel this order using the following button. + {% endblocktrans %} + {% trans "This will invalidate all tickets in this order." %} + {% endif %} +

    + {% endif %} +

    {% trans "Cancel order" %} -

    - {% else %} -

    - {% if order.total != 0 and order.user_cancel_fee %} - {% blocktrans trimmed with fee=order.user_cancel_fee|money:request.event.currency %} - You can cancel this order. As per our cancellation policy, you will still be required - to pay a cancellation fee of {{ fee }}. - {% endblocktrans %} - {% else %} - {% blocktrans trimmed %} - You can cancel this order using the following button. - {% endblocktrans %} - {% endif %} - {% trans "This will invalidate all tickets in this order." %} -

    -

    - - - {% trans "Cancel order" %} - -

    - {% endif %} +

  • {% endif %}