{% extends "pretixpresale/event/base.html" %}
{% load i18n %}
{% load bootstrap3 %}
{% block title %}{% trans "Modify order" %}{% endblock %}
{% block content %}
    <h2>
        {% blocktrans trimmed with code=order.code %}
            Modify order: {{ code }}
        {% endblocktrans %}
    </h2>
    <form class="form-horizontal" method="post">
        {% csrf_token %}
        <div class="panel-group" id="questions_accordion">
            {% for form in forms %}
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h4 class="panel-title">
                            <a data-toggle="collapse" href="#cp{{ form.pos.identity }}"
                                    data-parent="#questions_accordion">
                                <strong>{{ form.pos.item }}</strong>
                                {% if form.pos.variation %}
                                    – {{ form.pos.variation }}
                                {% endif %}
                            </a>
                        </h4>
                    </div>
                    <div id="cp{{ form.pos.identity }}"
                            class="panel-collapse collapsed {% if forloop.counter0 == 0 %}in{% endif %}">
                        <div class="panel-body">
                            {% bootstrap_form form layout="horizontal" %}
                        </div>
                    </div>
                </div>
            {% endfor %}
        </div>
        <div class="row checkout-button-row">
            <div class="col-md-4">
                <a class="btn btn-block btn-default btn-lg"
                        href="{{ view.get_index_url }}">
                    {% trans "Revert changes" %}
                </a>
            </div>
            <div class="col-md-4 col-md-offset-4">
                <button class="btn btn-block btn-primary btn-lg" type="submit">
                    {% trans "Save changes" %}
                </button>
            </div>
            <div class="clearfix"></div>
        </div>
    </form>
{% endblock %}
