You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
65 lines
2.9 KiB
65 lines
2.9 KiB
{% extends 'base.html' %}
|
|
{% block content %}
|
|
<div class="col-12 ">
|
|
<div class="cabinet__history">
|
|
<div class="history__btn_bx">
|
|
<a href="{% url 'cabinet:index' %}" class="cabinet__link_fill">Вернуться</a>
|
|
</div>
|
|
<div class="cabinet__title text-center">
|
|
<h3>История покупок</h3>
|
|
</div>
|
|
<table class="table">
|
|
<tr>
|
|
<th>Дата</th>
|
|
<th>№ счета</th>
|
|
<th>Наименование</th>
|
|
<th>Кол-во</th>
|
|
<th>Сумма</th>
|
|
</tr>
|
|
{% for bought_item in bought_item_list %}
|
|
<tr>
|
|
<td>{{ bought_item.bought_at }}</td>
|
|
<td>{{ bought_item.id }}</td>
|
|
<td>{{ bought_item.product.name }}</td>
|
|
<td>{{ bought_item.amount }}</td>
|
|
<td>{{ bought_item.total_price }}7570₽</td>
|
|
</tr>
|
|
{% empty %}
|
|
{% endfor %}
|
|
</table>
|
|
{% if paginator.num_pages > 1 %}
|
|
{% spaceless %}
|
|
<div class="row pagination">
|
|
<div class="col-md-4 text-center">
|
|
{% if page_obj.has_previous %}
|
|
<a href="{% url 'cart:history' %}?page={{ page_obj.previous_page_number }}">
|
|
«
|
|
</a>
|
|
{% endif %}
|
|
</div>
|
|
<div class="col-md-4 text-center">
|
|
{% if paginator.has_previous %}
|
|
<a href="{% url 'cart:history' %}?page={{ page_obj.number|add:"-1" }}">
|
|
{{ page_obj.number|add:"-1" }}
|
|
</a>
|
|
{% endif %}
|
|
<span>{{ page_obj.number }}</span>
|
|
{% if page_obj.has_next %}
|
|
<a href="{% url 'cart:history' %}?page={{ page_obj.number|add:"+1" }}">
|
|
{{ page_obj.number|add:"+1" }}
|
|
</a>
|
|
{% endif %}
|
|
</div>
|
|
<div class="col-md-4 text-center">
|
|
{% if page_obj.has_next %}
|
|
<a href="{% url 'cart:history' %}?page={{ page_obj.next_page_number }}">
|
|
»
|
|
</a>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
{% endspaceless %}
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
{% endblock content %}
|
|
|