{% extends 'base.html' %} {% block header %}

{% block title %}All purchases{% endblock %}

{% endblock %} {% block content %} {% if posts %}
{% for item in posts %}
Name: {{item['purchase_name']}}
Price: {{item['price']}}
Original price: {{item['orig_price']}}
Discount from: {{item['discount_from']}}
Discount to: {{item['discount_to']}}
Whether it is allowed to purchase with exchange certificate: {{item['discount_reason']}}
{% if item['items'] %}
{% for x in item['items'] %} Item id: {{x['item_id']}}
Item type: {{x['type']}}
Amount: {{x['amount']}}
{% if not loop.last %}
{% endif %} {% endfor %} {% endif %}
{% if not loop.last %}


{% endif %} {% endfor %} {% endif %} {% endblock %}