{% load history_tags %}
{% load basket_tags %}
{% load currency_filters %}
{% load image_tags %}
{% load i18n %}

<ul class="basket-mini-item list-unstyled">
    {% if request.basket.num_lines %}
        {% for line in request.basket.all_lines %}
            <li>
                <div class="row">
                    <div class="col-sm-3">
                        <div class="image_container w-100">
                            {% with image=line.product.primary_image %}
                                {% oscar_thumbnail image.original "100x100" upscale=False as thumb %}
                                <a href="{{ line.product.get_absolute_url }}">
                                    <img src="{{ thumb.url }}" alt="{{ line.product.get_title }}" class="img-thumbnail w-auto mx-auto my-0">
                                </a>
                            {% endwith %}
                        </div>
                    </div>
                    <div class="col-sm-5">
                        <p><strong><a href="{{ line.product.get_absolute_url }}">{{ line.description }}</a></strong></p>
                    </div>
                    <div class="col-sm-1 text-center"><strong>{% trans "Qty" %}</strong> {{ line.quantity }}</div>
                    <div class="col-sm-3 price_color text-right">{{ line.unit_price_excl_tax|currency:request.basket.currency }}</div>
                </div>
            </li>
        {% endfor %}
        <li class="form-group form-actions">
            <p class="text-right">
                {% if request.basket.is_tax_known %}
                    <small>{% trans "Total:" %} {{ request.basket.total_incl_tax|currency:request.basket.currency }}</small>
                {% else %}
                    <small>{% trans "Total:" %} {{ request.basket.total_excl_tax|currency:request.basket.currency }}</small>
                {% endif %}
            </p>
            <a href="{% url 'basket:summary' %}" class="btn btn-info btn-sm">{% trans "View basket" %}</a>
            <a href="{% url 'checkout:index' %}" class="btn btn-primary btn-sm float-right"><i class="fas fa-shopping-cart"></i> {% trans "Checkout" %}</a>
        </li>
    {% else %}
        <li><p>{% trans "Your basket is empty." %}</p></li>
    {% endif %}
</ul>
