{% extends "shop/base.html" %}
{% load mezzanine_tags shop_tags i18n %}

{% block meta_title %}{% trans "Your Wishlist" %}{% endblock %}
{% block title %}{% trans "Your Wishlist" %}{% endblock %}

{% block breadcrumb_menu %}
{{ block.super }}
<li>{% trans "Your Wishlist" %}</li>
{% endblock %}

{% block main %}
{% if error %}{{ error }}{% endif %}
{% if request.wishlist %}
<table class="table table-striped wishlist">
    {% for item in wishlist_items %}
    <tr>
    <td width="30">
        {% if item.image %}
        <a href="{{ item.get_absolute_url }}"><img alt="{{ item }}" src="{{ MEDIA_URL }}{% thumbnail item.image.file 30 30 %}"></a>
        {% else %}
        &nbsp;
        {% endif %}
    </td>
    <td>
        <a href="{{ item.get_absolute_url }}">{{ item }}</a>
    </td>
    <td class="wishlist-actions">
        <form method="post">
            {{ item.unit_price|currency }}
            {% csrf_token %}
            <input type="hidden" name="sku" value="{{ item.sku }}">
            <input type="hidden" name="quantity" value="1">
            <input type="submit" class="btn btn-sm btn-primary" name="add_cart" value="{% trans "Buy" %}">
            <input type="submit" class="btn btn-sm btn-default" name="remove_wishlist" value="{% trans "Remove" %}">
        </form>
    </td>
    </tr>
    {% endfor %}
</table>
{% else %}
<p>{% trans "Your wishlist is empty." %}</p>
<br>
<p><a class="btn btn-large btn-primary" href="{% url "page" "shop" %}">{% trans "Continue Shopping" %}</a></p>
{% endif %}
{% endblock %}
