Initial commit
This commit is contained in:
30
templates/cart.html
Normal file
30
templates/cart.html
Normal file
@@ -0,0 +1,30 @@
|
||||
{% extends 'base.html' %}
|
||||
{% block title %} Корзина {% endblock %}
|
||||
|
||||
{% block styles %}
|
||||
{% load static %}
|
||||
<link rel="stylesheet" type="text/css" href="{% static 'css/catalog-style.css' %}">
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h1> Ваша корзина </h1>
|
||||
{% if user %}
|
||||
{% if cart_objects %}
|
||||
{% for ojb in cart_objects %}
|
||||
{# 'item_count', 'prod', 'prod__prod_name', 'prod__prod_price', 'prod__prod_available', 'prod__prod_photo', 'prod__category__cat_name' #}
|
||||
<a class="product" href="/catalog/{{ obj.1 }}/" style="text-decoration: none">
|
||||
<img src="/static/images/{% if obj.5 %}no-photo.webp{% else %}products/{{ obj.5 }}{% endif %}" alt="photo">
|
||||
<div>
|
||||
<div> {{ ojb.0 }}шт </div>
|
||||
<div><strong> {{ ojb.2 }} </strong>₽</div>
|
||||
<div> {{ ojb.3 }} доступно </div>
|
||||
</div>
|
||||
</a>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<h3 style="text-align: center">Корзина пуста!</h3>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
нужно войти...
|
||||
{% endif %}
|
||||
{% endblock %}
|
Reference in New Issue
Block a user