{% load i18n leprikon_tags %}
<div class="box box-registration" name="{{ reg.slug }}">
    <div class="box-header">
        <strong>{% if reg.canceled %}<s>{% endif %}{{ reg.subject.name }}{% if reg.canceled %}</s>{% endif %}</strong>
        <small>({% trans 'registration number' %}: {{ reg.variable_symbol }})</small>
        <a class="btn btn-primary btn-xs" href="{{ reg.get_absolute_url }}">
            <span class="glyphicon glyphicon-download" aria-hidden="true"></span>
            {% trans 'download' %}
        </a>
        {% if not reg.canceled and not reg.cancel_request %}
        <a class="btn btn-primary btn-xs"
            href="{% url_with_back 'leprikon:registration_cancel' reg.id %}"
            title="{% trans 'cancel registration' %}">
            <span class="glyphicon glyphicon-remove" aria-hidden="true"></span>
            {% trans 'cancel' %}
        </a>
        {% endif %}
    </div>

    <div class="box-content">
        <div class="row">
            <label class="col-sm-4">{{ reg.subject.subject_type.name | first_upper }}:</label>
            <div class="col-sm-8">
                <a href="{{ reg.subject.get_absolute_url }}">{{ reg.subject.name }}</a>
            </div>
        </div>
        <div class="row">
            <label class="col-sm-4">{% trans 'Participant' %}:</label>
            <div class="col-sm-8">
                {{ reg.participant }}
            </div>
        </div>
        <div class="row">
            <label class="col-sm-4">{% trans 'Parents' %}:</label>
            <div class="col-sm-8">
                {{ reg.parents | comma_separated }}
            </div>
        </div>
        <div class="row">
            <label class="col-sm-4">{% trans 'Date and time of registration' %}:</label>
            <div class="col-sm-8">
                {{ reg.created }}
            </div>
        </div>
        <div class="row">
            <label class="col-sm-4">{% trans 'Status' %}:</label>
            <div class="col-sm-8">
                {% if reg.canceled %}
                    {% blocktrans with d=reg.canceled %}registration canceled on {{ d }}{% endblocktrans %}
                {% elif reg.cancel_request %}
                    {% trans 'cancellation requested' %}
                {% elif reg.approved %}
                    {% blocktrans with d=reg.approved %}registration approved on {{ d }}{% endblocktrans %}
                {% else %}
                    {% trans 'awaiting approval' %}
                {% endif %}
            </div>
        </div>
        {% include 'leprikon/registration_payments_presences.html' %}
    </div>
</div>
