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

{% if item.current_unavailability_reason == 'require_voucher' %}
    <div class="col-md-2 col-sm-3 col-xs-6 availability-box unavailable">
        <p><small><a href="#voucher">{% trans "Enter a voucher code below to buy this product." %}</a></small></p>
    </div>
{% elif item.current_unavailability_reason == 'available_from' or var.current_unavailability_reason == 'available_from' %}
    <div class="col-md-2 col-sm-3 col-xs-6 availability-box unavailable">
        <p><small>{% trans "Not available yet." %}</small></p>
    </div>
{% elif item.current_unavailability_reason == 'available_until' or var.current_unavailability_reason == 'available_until' %}
    <div class="col-md-2 col-sm-3 col-xs-6 availability-box unavailable">
        <p><small>{% trans "Not available any more." %}</small></p>
    </div>
{% elif avail <= 10 %}
    <div class="col-md-2 col-sm-3 col-xs-6 availability-box gone">
        {% if price != None and not price %}
            <strong>{% trans "FULLY BOOKED" %}</strong>
        {% else %}
            <strong>{% trans "SOLD OUT" %}</strong>
        {% endif %}
        {% if allow_waitinglist and item.allow_waitinglist %}
            <br/>
            <a href="{% eventurl event "presale:event.waitinglist" cart_namespace=cart_namespace|default_if_none:"" %}?item={{ item.pk }}{% if var %}&var={{ var.pk }}{% endif %}{% if subevent %}&subevent={{ subevent.pk }}{% endif %}">
                <span class="fa fa-plus-circle" aria-hidden="true"></span>
                {% trans "Waiting list" %}
            </a>
        {% endif %}
    </div>
{% elif avail < 100 %}
    <div class="col-md-2 col-sm-3 col-xs-6 availability-box unavailable">
        <strong>{% trans "Reserved" %}</strong>
        <br/>
        {% trans "All remaining products are reserved but might become available again." %}
        {% if allow_waitinglist and item.allow_waitinglist %}
            <br/>
            <a href="{% eventurl event "presale:event.waitinglist" cart_namespace=cart_namespace|default_if_none:"" %}?item={{ item.pk }}{% if var %}&var={{ var.pk }}{% endif %}{% if subevent %}&subevent={{ subevent.pk }}{% endif %}">
                <span class="fa fa-plus-circle" aria-hidden="true"></span>
                {% trans "Waiting list" %}
            </a>
        {% endif %}
    </div>
{% endif %}
