{% extends "pretixpresale/event/checkout_base.html" %}
{% load i18n %}
{% load bootstrap3 %}
{% load rich_text %}
{% load l10n %}
{% load money %}
{% load thumb %}
{% block inner %}
    <p>
        {% trans "For some of the products in your cart, you can choose additional options before you continue." %}
    </p>
    <form class="form-horizontal" method="post" data-asynctask
            data-asynctask-headline="{% trans "We're now trying to book these add-ons for you!" %}">
        {% csrf_token %}
        <div class="panel-group addons" id="questions_group">
            {% for form in forms %}
                <details class="panel panel-default" open>
                    <summary class="panel-heading">
                        <h3 class="panel-title">
                            <span class="sr-only">{% trans "Add-ons:" %}</span>
                            <strong>{{ form.item.name }}{% if form.variation %}
                                – {{ form.variation }}
                            {% endif %}</strong>
                            <i class="fa fa-angle-down collapse-indicator" aria-hidden="true"></i>
                        </h3>
                    </summary>
                    <div id="cp{{ form.pos.pk }}">
                        <div class="panel-body">
                            {% if form.pos.subevent %}
                                <p>
                                    <span class="fa fa-calendar" aria-hidden="true"></span>
                                    {{ form.pos.subevent.name }} &middot; {{ form.pos.subevent.get_date_range_display_as_html }}
                                    {% if form.pos.event.settings.show_times %}
                                        <span class="fa fa-clock-o" aria-hidden="true"></span>
                                        {{ form.pos.subevent.date_from|date:"TIME_FORMAT" }}
                                    {% endif %}
                                </p>
                            {% endif %}
                            {% include "pretixpresale/event/fragment_addon_choice.html" with form=form %}
                        </div>
                    </div>
                </details>
            {% endfor %}
        </div>
        <div class="row checkout-button-row">
            <div class="col-md-4 col-sm-6">
                <a class="btn btn-block btn-default btn-lg"
                        href="{{ prev_url }}">
                    {% trans "Go back" %}
                </a>
            </div>
            <div class="col-md-4 col-md-offset-4 col-sm-6">
                <button class="btn btn-block btn-primary btn-lg" type="submit">
                    {% trans "Continue" %}
                </button>
            </div>
            <div class="clearfix"></div>
        </div>
    </form>
{% endblock %}
