{% extends "pretixcontrol/event/settings_base.html" %}
{% load i18n %}
{% load bootstrap3 %}
{% block inside %}
    <h1>{% trans "Cancellation settings" %}</h1>
    <form action="" method="post" class="form-horizontal" enctype="multipart/form-data">
        {% csrf_token %}
        {% bootstrap_form_errors form %}
        <div class="tabbed-form">
            <fieldset>
                <legend>{% trans "Unpaid or free orders" %}</legend>
                {% bootstrap_field form.cancel_allow_user layout="control" %}
                {% bootstrap_field form.cancel_allow_user_until layout="control" %}
                {% 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" %}
            </fieldset>
            <fieldset>
                <legend>{% trans "Paid orders" %}</legend>
                {% bootstrap_field form.cancel_allow_user_paid layout="control" %}
                {% bootstrap_field form.cancel_allow_user_paid_require_approval layout="control" %}
                <div data-display-dependency="#id_cancel_allow_user_paid_require_approval">
                    {% bootstrap_field form.cancel_allow_user_paid_require_approval_fee_unknown layout="control" %}
                </div>
                {% bootstrap_field form.cancel_allow_user_paid_keep layout="control" %}
                {% bootstrap_field form.cancel_allow_user_paid_keep_percentage layout="control" %}
                {% bootstrap_field form.cancel_allow_user_paid_keep_fees layout="control" %}
                {% bootstrap_field form.cancel_allow_user_paid_until layout="control" %}
                {% bootstrap_field form.cancel_allow_user_paid_adjust_fees layout="control" %}
                <div data-display-dependency="#id_cancel_allow_user_paid_adjust_fees">
                    {% bootstrap_field form.cancel_allow_user_paid_adjust_fees_explanation layout="control" %}
                    {% bootstrap_field form.cancel_allow_user_paid_adjust_fees_step layout="control" %}
                </div>
                {% bootstrap_field form.cancel_allow_user_paid_refund_as_giftcard layout="control" %}
                {% bootstrap_field form.cancel_terms_paid layout="control" %}
                {% if not gets_notification %}
                    <div class="alert alert-warning">
                        {% blocktrans trimmed %}
                            If a user requests cancels a paid order and the money can not be refunded automatically, e.g.
                            due to the selected payment method, you will need to take manual action. However, you have
                            currently turned off notifications for this event.
                        {% endblocktrans %}
                        <a href="{% url "control:user.settings.notifications" %}" class="btn btn-default">
                            {% trans "Change notification settings" %}
                        </a>
                    </div>
                {% endif %}
            </fieldset>
            <fieldset>
                <legend>{% trans "Order changes" %}</legend>
                <div class="alert alert-info">
                    <p>
                        {% blocktrans trimmed %}
                            Allowing customers to change their own orders is a complex process due to the many different options pretix provides. Therefore, this feature currently has the following
                            limitations:
                        {% endblocktrans %}
                    </p>
                    <ul>
                        <li>{% trans "It is possible to switch to a different variation of the same product, but not to an entirely different product (except for add-on products)." %}</li>
                        <li>{% trans "Changing the seat or the event date in an event series will become available in the future, but is not possible now." %}</li>
                        <li>{% trans "If a change leads to a price change, there will not be a change to fees such as payment, service, or shipping fees, even though an additional payment might be required." %}</li>
                        <li>{% trans "If an add-on product is newly added, the system currently does not validate if there are required questions or fields that need to be filled out." %}</li>
                        <li>{% trans "Customers currently cannot switch to a product variation or add an add-on product that requires them to use a voucher or membership." %}</li>
                        <li>{% trans "Additional constraints and validation steps added by plugins are not enforced." %}</li>
                    </ul>
                </div>
                {% bootstrap_field form.change_allow_user_variation layout="control" %}
                {% bootstrap_field form.change_allow_user_addons layout="control" %}
                {% bootstrap_field form.change_allow_user_until layout="control" %}
                {% bootstrap_field form.change_allow_user_price layout="control" %}
                {% bootstrap_field form.change_allow_user_if_checked_in layout="control" %}
                {% bootstrap_field form.change_allow_attendee layout="control" %}
                <div class="alert alert-info">
                    <p>
                        {% blocktrans trimmed %}
                            If the change leads to a price reduction and automatic refunds are enabled for self-service cancellations,
                            the system will try to refund the money automatically.
                        {% endblocktrans %}
                        {% blocktrans trimmed %}
                            Refunds can be issued as a gift card if the respective option is set, but there is no customer choice between
                            gift card and direct refund.
                        {% endblocktrans %}
                    </p>
                </div>
            </fieldset>
        </div>
        <div class="form-group submit-group">
            <button type="submit" class="btn btn-primary btn-save">
                {% trans "Save" %}
            </button>
        </div>
    </form>
{% endblock %}
