{% extends "shop/base.html" %}
{% load i18n %}
{% load thumbnail %}
{% load satchmo_util %}

{% block navbar %}
<li class="first"><a href="{{ shop_base }}/">{% trans "Home" %}</a></li>
<li>{% trans "Recently Added" %}</li>
{% endblock %}

{% block content %}
<h2>{% trans "Recently Added" %}</h2>
{% if page %}
	{% for product in page.object_list %}
		<div class="recentlyadded">
	    <div class = "productImage">    
	   		{% if product.main_image %}
	      	<center>
                {% thumbnail product.main_image.picture 85x85 as image %}
                <a href="{{ product.get_absolute_url }}"><img src="{{ image }}" width="{{ image.width }}" height="{{ image.height }}" /></a>
	      	</center>
	   		{% endif %}     
	    	<p><a href="{{ product.get_absolute_url }}">{{ product.translated_name }}</a></p>
		</div>
		</div>
	{% endfor %}
	{% if page.has_other_pages %}
	<div id = "pagination">
	<ul>
	    {% if page.has_previous %}
	        <li> <a href="{{ request.path }}?page={{page.previous_page_number}}">{% trans "Previous" %}</a> </li>
	    {% else %}
	        <li> {% trans "Previous" %} </li>
	    {% endif %}
	    {% if page.has_next %}
	        <li> <a href="{{ request.path }}?page={{page.next_page_number}}">{% trans "Next" %}</a></li>
	    {% else %}
	        <li> {% trans "Next" %} </li>
	    {% endif %}
	</ul>
	</div>
	{% endif %}
{% else %}
	<div class="recentlyadded">
		<p>{% trans "Bad Page" %}</p>
	</div>
{% endif %}
{% endblock %}
