{% load i18n static cms_tags sass_tags sekizai_tags %}
{% load render_plugin from cascade_tags %}

{% addtoblock "css" %}<link href="{% sass_src 'shop/css/list-items.scss' %}" rel="stylesheet" type="text/css" />{% endaddtoblock %}

{% addtoblock "js" %}<script src="{% static 'shop/js/utils.js' %}" type="text/javascript"></script>{% endaddtoblock %}
{% add_data "ng-requires" "django.shop.utils" %}

{% block shop-order-title %}
<h4>{% page_attribute "page_title" %}</h4>
{% endblock %}

{% block shop-order-head %}
	{% if data.count == 0 %}
<div class="row lead text-muted py-1">
	<div class="col">
		{% trans "You have never ordered anything from this site." %}
	</div>
</div>
	{% endif %}
{% endblock shop-order-head %}

{% block shop-order-body %}
	{% for order in data.results %}
<div class="shop-list-item row border-top py-2">
	<div class="col-12 col-lg-6">
		<div class="row flex-nowrap lead">
			<div class="col-8">
				<a class="mr-lg-5 mr-3" href="{{ order.url }}">{{ order.number }}</a>
				<small class="text-nowrap text-muted" shop-timestamp="{{ order.created_at }}" time-format="d. MMM yyyy"></small>
			</div>
			<div class="col-4 text-nowrap text-right">{{ order.total }}</div>
		</div>
	</div>
	<div class="col-12 col-lg-6">
		<div class="row flex-nowrap">
			<div class="col-8">{{ order.shipping_address_text }}</div>
			<div class="col-4 text-right">
				<div class="badge badge-primary">{{ order.status }}</div>
			</div>
		</div>
	</div>
</div>
	{% endfor %}
{% endblock shop-order-body %}

{% block shop-order-foot %}{% if paginator.display_page_controls %}
<div class="row border-top py-3">
	<div class="col text-center" aria-label="{% trans 'Page navigation' %}">
		<ul class="pagination justify-content-center">{{ paginator.to_html }}</ul>
	</div>
</div>
{% endif %}{% endblock shop-order-foot %}

{% if instance.left_extension %}<!-- {#!!! DON'T DELETE THIS LINE !!!#}{% render_plugin instance.left_extension %} -->{% endif %}
{% if instance.right_extension %}<!-- {#!!! DON'T DELETE THIS LINE !!!#}{% render_plugin instance.right_extension %} -->{% endif %}
