{% load currency_filters %}
{% load reviews_tags %}
{% load thumbnail %}
{% load i18n %}

<article class="product_pod">
    {% block product_image %}
    <div class="image_container">
		{% with image=product.primary_image %}
            {% thumbnail image.original "400x400" upscale=False as thumb %}
                <a href="{{ product.get_absolute_url }}"><img src="{{ thumb.url }}" alt="{{ product.get_title }}" class="thumbnail"></a>
            {% endthumbnail %}
		{% endwith %}
    </div>
    {% endblock %}

    {% block product_review %}
        <p class="star {{ product.rating|as_stars }}"></p>
    {% endblock %}

    {% block product_title %}
    <h3><a href="{{ product.get_absolute_url }}">{{ product.get_title|truncatewords:4 }}</a></h3>
    {% endblock %}

    {% block product_price %}
    <div class="product_price">
        {% include "catalogue/partials/stock_record.html" %}

        {% if product.is_group %}
            <a class="btn btn-full" href="{% url catalogue:detail product.slug product.id %}">{% trans "View" %}</a>
        {% else %}
            {% include "catalogue/partials/add_to_basket_form_compact.html" %}
        {% endif %}
   </div>
    {% endblock %}
</article>
