{% extends "pretixcontrol/event/base.html" %}
{% load i18n %}
{% load bootstrap3 %}
{% block title %}
    {% trans "Refund order" %}
{% endblock %}
{% block content %}
    <h1>
        {% trans "Refund order" %}
        <a class="btn btn-link btn-lg"
                href="{% url "control:event.order" event=request.event.slug organizer=request.event.organizer.slug code=order.code %}">
            {% blocktrans trimmed with order=order.code %}
                Back to order {{ order }}
            {% endblocktrans %}
        </a>
    </h1>
    <form method="post" href="">
        {% bootstrap_form_errors form %}
        <fieldset class="form-inline form-order-change">
            <legend>{% trans "How much do you want to refund?" %}</legend>
            <div class="radio">
                <label>
                    <input name="{{ form.prefix }}-mode" type="radio" value="full"
                            {% if not form.mode.value or form.mode.value == "full" %}checked="checked"{% endif %}>
                    {% trans "Refund full paid amount" %}
                </label>
            </div>
            <div class="radio">
                <label>
                    <input name="{{ form.prefix }}-mode" type="radio" value="partial"
                            {% if form.mode.value == "partial" %}checked="checked"{% endif %}>
                    {% trans "Refund only" %}
                    {% bootstrap_field form.partial_amount addon_after=request.event.currency layout='inline' %}
                </label>
            </div>
        </fieldset>
        <p>&nbsp;</p>
        {% if form.action %}
            <fieldset class="form-inline form-order-change">
                <legend>{% trans "What should happen to the order?" %}</legend>
                {% bootstrap_field form.action layout='horizontal' horizontal_label_class='sr-only' horizontal_field_class='' %}
            </fieldset>
        {% endif %}
        <p>&nbsp;</p>

        {% csrf_token %}
        <div class="row checkout-button-row">
            <div class="col-md-4">
                <a class="btn btn-block btn-default btn-lg"
                        href="{% url "control:event.order" event=request.event.slug organizer=request.event.organizer.slug code=order.code %}">
                    {% trans "Cancel" %}
                </a>
            </div>
            <div class="col-md-4 col-md-offset-4">
                <button class="btn btn-block btn-primary btn-lg" type="submit">
                    {% trans "Continue" %}
                </button>
            </div>
            <div class="clearfix"></div>
        </div>
    </form>
{% endblock %}
