{% extends "pretixpresale/event/base.html" %}
{% load i18n %}
{% load bootstrap3 %}
{% load eventsignal %}
{% load money %}
{% load eventurl %}
{% block title %}{% trans "Registration details" %}{% endblock %}
{% block content %}
    <h2 class="h1">
        {% blocktrans trimmed %}
            Your registration
        {% endblocktrans %}
        {% if order.testmode %}
            <span class="label label-warning">{% trans "TEST MODE" %}</span>
        {% endif %}
        {% if backend_user %}
            <a href="{% url "control:event.order" event=request.event.slug organizer=request.organizer.slug code=order.code %}" class="btn btn-default">
                {% trans "View in backend" %}
            </a>
        {% endif %}
    </h2>
    <dl class="lead order-details">
        <dt class="sr-only">Status</dt>
        <dd class="text-muted">{% include "pretixpresale/event/fragment_order_status.html" with order=order event=request.event %}</dd>
    </dl>
    {% eventsignal event "pretix.presale.signals.position_info_top" order=order position=position request=request %}
    {% include "pretixpresale/event/fragment_downloads.html" with position_page=True %}
    <div class="panel panel-primary cart">
        <div class="panel-heading">
            <h3 class="panel-title">
                {% trans "Your items" %}
            </h3>
        </div>
        <div class="panel-body">
            {% include "pretixpresale/event/fragment_cart.html" with cart=cart event=request.event download=can_download position_page=True editable=False hide_prices=request.event.settings.hide_prices_from_attendees %}
        </div>
    </div>
    <div class="panel panel-primary">
        <div class="panel-heading">
            <h3 class="panel-title">
                {% trans "Additional information" %}
            </h3>
        </div>
        <div class="panel-body">
            <p>
                {% blocktrans trimmed with email="<strong>"|add:order.email|add:"</strong>"|safe %}
                    This order is managed for you by {{ email }}. Please contact them for any questions regarding
                    payment, cancellation or changes to this order.
                {% endblocktrans %}
            </p>
        </div>
    </div>
    {% eventsignal event "pretix.presale.signals.position_info" order=order position=position request=request %}
    {% if attendee_change_allowed %}
        <div class="panel panel-default panel-cancellation">
            <div class="panel-heading">
                <h3 class="panel-title">
                    {% trans "Change your ticket" context "action" %}
                </h3>
            </div>
            <div class="panel-body">
                <p>
                    {% blocktrans trimmed %}
                        If you want to make changes to the components of your ticket, you can click on the following button.
                    {% endblocktrans %}
                </p>
                <p class="help-block">
                    {% blocktrans trimmed with email=order.email %}
                        You can only make some changes to this ticket yourself. For additional changes, please
                        get in touch with the person who bought the ticket ({{ email }}).
                    {% endblocktrans %}
                </p>
                <p>
                    <a href="{% eventurl event 'presale:event.order.position.change' secret=position.web_secret position=position.positionid order=order.code %}"
                       class="btn btn-default">
                        <span class="fa fa-edit" aria-hidden="true"></span>
                        {% trans "Change ticket" %}
                    </a>
                </p>
            </div>
        </div>
    {% endif %}
{% endblock %}
