{% load i18n %}
{% load icon %}
{% load eventurl %}

<dl class="full-width-list alternating-rows">
{% for subev in subevent_list.subevent_list %}
    <div class="row">
        <dt class="col-md-4 col-xs-12">
            <a href="{% if request.GET.voucher %}{% eventurl event "presale:event.redeem" cart_namespace=cart_namespace %}?voucher={{ request.GET.voucher|urlencode }}&amp;subevent={{ subev.pk }}{% else %}{% eventurl event "presale:event.index" subevent=subev.id cart_namespace=cart_namespace %}{% endif %}">
                {{ subev.name }}
            </a>
        </dt>
        <dd class="col-md-3 col-xs-12">
            {{ subev.get_date_range_display_as_html }}
            {% if event.settings.show_times %}
                <br>
                <span data-time="{{ subev.date_from.isoformat }}" data-timezone="{{ event.timezone }}" data-time-short>
                    {% icon "clock-o" %}
                    <time datetime="{{ subev.date_from.isoformat }}">{{ subev.date_from|date:"TIME_FORMAT" }}</time>
                </span>
            {% endif %}
        </dd>
        <dd class="col-md-3 col-xs-6">
            <small>
                {% include "pretixpresale/fragment_event_list_status.html" with event=subev %}
            </small>
        </dd>
        <dd class="col-md-2 col-xs-6 text-right flip">
            <a class="btn btn-primary btn-block" href="{% if request.GET.voucher %}{% eventurl event "presale:event.redeem" cart_namespace=cart_namespace %}?voucher={{ request.GET.voucher|urlencode }}&amp;subevent={{ subev.pk }}{% else %}{% eventurl event "presale:event.index" subevent=subev.id cart_namespace=cart_namespace %}{% endif %}">
                {% if subev.presale_is_running and subev.best_availability_state == 100 %}
                    {% icon "ticket" %} {% trans "Tickets" %}
                {% else %}
                    {% icon "info" %} {% trans "More info" %}
                {% endif %}
            </a>
        </dd>
    </div>
{% endfor %}
</dl>
