{% extends "pretixpresale/event/base.html" %}
{% load i18n %}
{% load bootstrap3 %}
{% block title %}
    {% for step in checkout_flow %}
        {% if request.resolver_match.kwargs.step == step.identifier %}
            {% blocktrans trimmed with label=step.label current=forloop.counter total=checkout_flow|length %}
            Step {{ current }} of {{ total }}: {{ label }}
            {% endblocktrans %} –
        {% endif %}
    {% endfor %}
    {% trans "Checkout" %}
{% endblock %}
{% block content %}
<aside aria-label="{% trans "Your cart" %}">
    <details class="panel panel-default cart{% if "open_cart" not in request.GET %} sneak-peek{% endif %}" {% if "open_cart" in request.GET %}open{% endif %}>
        <summary class="panel-heading">
            <h2 class="panel-title">
                <span>
                    <i class="fa fa-shopping-cart" aria-hidden="true"></i>
                    <strong>{% trans "Your cart" %}</strong>
                </span>
                <span aria-hidden="true">
                    <strong id="cart-deadline-short" data-expires="{{ cart.first_expiry|date:"Y-m-d H:i:sO" }}">
                        {% if cart.minutes_left > 0 or cart.seconds_left > 0 %}
                            {{ cart.minutes_left|stringformat:"02d" }}:{{ cart.seconds_left|stringformat:"02d" }}
                        {% else %}
                            {% trans "Cart expired" %}
                        {% endif %}
                    </strong>
                </span>
            </h2>
        </summary>
        {% if "open_cart" not in request.GET %}
        <p class="sneak-peek-trigger">
            <button type="button" class="btn btn-default">{% trans "Show full cart" %}</button>
        </p>
        {% endif %}
        <div>
            <div class="panel-body">
                {% include "pretixpresale/event/fragment_cart.html" with cart=cart event=request.event %}
            </div>
        </div>
    </details>
    {% if not has_prev and request.event.has_subevents and request.session.iframe_session %}
        <a class="btn btn-primary btn-block btn-lg" href="{{ prev_url }}">
            <span class="fa fa-reply" aria-hidden="true"></span>
            {% trans "Add tickets for a different date" %}
        </a>
    {% endif %}
</aside>
<main aria-label="{% trans "Checkout" %}">
    <h2>{% trans "Checkout" %}</h2>
    {% include "pretixpresale/event/fragment_checkoutflow.html" %}
    {% block inner %}
    {% endblock %}
</main>
{% endblock %}
