main
parent
1a9f3afec2
commit
71694f09c3
|
@ -4,70 +4,69 @@
|
||||||
{% block title %}Your shopping cart{% endblock %}
|
{% block title %}Your shopping cart{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<link rel="stylesheet" href="{% static "/deps/css/cart.css" %}">
|
<link rel="stylesheet" href="{% static 'deps/css/cart.css' %}">
|
||||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css">
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css">
|
||||||
|
|
||||||
<div class="cart-container position-relative">
|
<div class="cart-container position-relative">
|
||||||
<div class="text-center my-4">
|
<div class="text-center my-4">
|
||||||
<h1 class="display-4" style="color:black;">
|
<h1 class="display-4" style="color:black;">
|
||||||
<i class="fa fa-shopping-cart" aria-hidden="true"></i> Корзина
|
<i class="fa fa-shopping-cart" aria-hidden="true"></i> Корзина
|
||||||
</h1>
|
</h1>
|
||||||
<p class="lead" style="color: whitesmoke">Проверьте свои товары перед оформлением заказа.</p>
|
<p class="lead" style="color: whitesmoke;">Проверьте свои товары перед оформлением заказа.</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<table class="cart-table" style="position: relative; background-color: #1d02269e;">
|
<div class="table-responsive">
|
||||||
|
<table class="cart-table" style=" position: relative; background-color: #1d02269e;">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th scope="col">Изображение</th>
|
||||||
|
<th scope="col">Продукт</th>
|
||||||
|
<th scope="col">Количество</th>
|
||||||
|
<th scope="col">Удалить</th>
|
||||||
|
<th scope="col">Цена за единицу</th>
|
||||||
|
<th scope="col">Общая цена</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{% for item in cart %}
|
||||||
|
{% with product=item.product %}
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<a href="{{ product.get_absolute_url }}">
|
||||||
|
<img src="{% if product.image %}{{ product.image.url }}{% else %}{% static 'img/no_image.jpg' %}{% endif %}" alt="{{ product.name }}" class="img-fluid">
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>{{ product.name }}</td>
|
||||||
|
<td>
|
||||||
|
<form action="{% url 'cart:cart_add' product.id %}" method="post">
|
||||||
|
{% csrf_token %}
|
||||||
|
{{ item.update_quantity_form.quantity }}
|
||||||
|
{{ item.update_quantity_form.override }}
|
||||||
|
<button type="submit" class="btn btn-primary btn-sm">Обновить</button>
|
||||||
|
</form>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<form action="{% url 'cart:cart_remove' product.id %}" method="post">
|
||||||
|
{% csrf_token %}
|
||||||
|
<button type="submit" class="btn btn-danger btn-sm">Удалить</button>
|
||||||
|
</form>
|
||||||
|
</td>
|
||||||
|
<td class="num">₸{{ item.price }}</td>
|
||||||
|
<td class="num">₸{{ item.total_price }}</td>
|
||||||
|
</tr>
|
||||||
|
{% endwith %}
|
||||||
|
{% endfor %}
|
||||||
|
<tr class="total position-relative">
|
||||||
|
<td colspan="5" class="text-right">Итого</td>
|
||||||
|
<td class="num">₸{{ cart.get_total_price }}</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
<thead >
|
<div class="d-flex justify-content-between my-3">
|
||||||
<tr>
|
<a href="{% url 'main:product_list' %}" class="btn btn-outline-secondary">Продолжить покупки</a>
|
||||||
<th>Изображение</th>
|
<a href="{% url 'orders:order_create' %}" class="btn btn-outline-primary">Оформить заказ</a>
|
||||||
<th>Продукт</th>
|
|
||||||
<th>Количество</th>
|
|
||||||
<th>Удалить</th>
|
|
||||||
<th>Цена за единицу</th>
|
|
||||||
<th>Общая цена</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody >
|
|
||||||
{% for item in cart %}
|
|
||||||
{% with product=item.product %}
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<a href="{{ product.get_absolute_url }}">
|
|
||||||
<img src="{% if product.image %}{{ product.image.url }}{% else %}{% static 'img/no_image.jpg' %}{% endif %}" alt="{{ product.name }}">
|
|
||||||
</a>
|
|
||||||
</td>
|
|
||||||
<td>{{ product.name }}</td>
|
|
||||||
<td>
|
|
||||||
<form action="{% url 'cart:cart_add' product.id %}" method="post">
|
|
||||||
{% csrf_token %}
|
|
||||||
{{ item.update_quantity_form.quantity }}
|
|
||||||
{{ item.update_quantity_form.override }}
|
|
||||||
<input type="submit" value="Обновить" class="btn-update">
|
|
||||||
</form>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<form action="{% url 'cart:cart_remove' product.id %}" method="post">
|
|
||||||
{% csrf_token %}
|
|
||||||
<input type="submit" value="Удалить" class="btn-remove">
|
|
||||||
</form>
|
|
||||||
</td>
|
|
||||||
<td class="num">₸{{ item.price }}</td>
|
|
||||||
<td class="num">₸{{ item.total_price }}</td>
|
|
||||||
</tr>
|
|
||||||
{% endwith %}
|
|
||||||
{% endfor %}
|
|
||||||
<tr class="total position-relative">
|
|
||||||
<td>Итого</td>
|
|
||||||
<td colspan="4"></td>
|
|
||||||
<td class="num">₸{{ cart.get_total_price }}</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
<div class="d-flex justify-content-between my-3 position-relative">
|
|
||||||
<a href="{% url 'main:product_list' %}" class="btn btn-light">Продолжить покупки</a>
|
|
||||||
<!-- Обновите 'your_checkout_url' на реальный URL оформления заказа -->
|
|
||||||
<a href="{% url "orders:order_create"%}" class="btn btn-light">Оформить заказ</a>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
BIN
db.sqlite3
BIN
db.sqlite3
Binary file not shown.
42
django.log
42
django.log
|
@ -5682,3 +5682,45 @@ WARNING 2024-03-05 16:08:04,936 log Not Found: /favicon.ico
|
||||||
INFO 2024-03-05 16:42:51,322 autoreload Watching for file changes with StatReloader
|
INFO 2024-03-05 16:42:51,322 autoreload Watching for file changes with StatReloader
|
||||||
WARNING 2024-03-05 16:43:01,054 log Not Found: /about/
|
WARNING 2024-03-05 16:43:01,054 log Not Found: /about/
|
||||||
WARNING 2024-03-05 16:43:01,167 log Not Found: /favicon.ico
|
WARNING 2024-03-05 16:43:01,167 log Not Found: /favicon.ico
|
||||||
|
INFO 2024-03-06 12:17:00,290 autoreload Watching for file changes with StatReloader
|
||||||
|
WARNING 2024-03-06 12:17:36,367 log Not Found: /about/
|
||||||
|
WARNING 2024-03-06 12:17:36,468 log Not Found: /favicon.ico
|
||||||
|
INFO 2024-03-06 12:55:00,433 autoreload Watching for file changes with StatReloader
|
||||||
|
INFO 2024-03-06 12:59:41,022 autoreload Watching for file changes with StatReloader
|
||||||
|
INFO 2024-03-06 13:01:18,537 autoreload Watching for file changes with StatReloader
|
||||||
|
WARNING 2024-03-06 13:01:38,838 log Not Found: /about/
|
||||||
|
WARNING 2024-03-06 13:01:38,924 log Not Found: /favicon.ico
|
||||||
|
INFO 2024-03-06 13:07:46,609 autoreload Watching for file changes with StatReloader
|
||||||
|
INFO 2024-03-06 13:10:44,176 autoreload Watching for file changes with StatReloader
|
||||||
|
WARNING 2024-03-06 13:13:25,506 log Not Found: /about/
|
||||||
|
INFO 2024-03-06 13:15:40,689 autoreload Watching for file changes with StatReloader
|
||||||
|
WARNING 2024-03-06 13:17:40,657 log Not Found: /about/
|
||||||
|
WARNING 2024-03-06 13:18:58,440 log Not Found: /about/
|
||||||
|
INFO 2024-03-06 17:31:05,807 autoreload Watching for file changes with StatReloader
|
||||||
|
INFO 2024-03-06 17:34:37,089 autoreload Watching for file changes with StatReloader
|
||||||
|
INFO 2024-03-06 17:40:55,604 autoreload Watching for file changes with StatReloader
|
||||||
|
INFO 2024-03-07 12:07:41,112 autoreload Watching for file changes with StatReloader
|
||||||
|
INFO 2024-03-07 13:13:03,537 autoreload Watching for file changes with StatReloader
|
||||||
|
INFO 2024-03-07 13:13:23,431 autoreload Watching for file changes with StatReloader
|
||||||
|
INFO 2024-03-07 13:15:03,244 autoreload Watching for file changes with StatReloader
|
||||||
|
WARNING 2024-03-07 13:17:24,713 log Not Found: /about/
|
||||||
|
WARNING 2024-03-07 13:17:24,831 log Not Found: /favicon.ico
|
||||||
|
INFO 2024-03-07 13:37:50,854 autoreload Watching for file changes with StatReloader
|
||||||
|
ERROR 2024-03-07 13:43:03,600 log Internal Server Error: /orders/create/
|
||||||
|
Traceback (most recent call last):
|
||||||
|
File "C:\Users\fhjj3\djangoProject1\venv\Lib\site-packages\django\core\handlers\exception.py", line 55, in inner
|
||||||
|
response = get_response(request)
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
File "C:\Users\fhjj3\djangoProject1\venv\Lib\site-packages\django\core\handlers\base.py", line 197, in _get_response
|
||||||
|
response = wrapped_callback(request, *callback_args, **callback_kwargs)
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
File "C:\Users\fhjj3\djangoProject1\orders\views.py", line 22, in order_create
|
||||||
|
send_invoice_via_email(order.email, order) # Èñïðàâëåíî íà order.email
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
File "C:\Users\fhjj3\djangoProject1\orders\utils.py", line 40, in send_invoice_via_email
|
||||||
|
generate_invoice_image(html_content, image_path)
|
||||||
|
File "C:\Users\fhjj3\djangoProject1\orders\utils.py", line 27, in generate_invoice_image
|
||||||
|
os.remove(temp_html)
|
||||||
|
FileNotFoundError: [WinError 2] Íå óäàåòñÿ íàéòè óêàçàííûé ôàéë: 'temp_invoice.html'
|
||||||
|
WARNING 2024-03-07 13:43:03,802 log Not Found: /favicon.ico
|
||||||
|
WARNING 2024-03-07 14:16:25,678 log Not Found: /about/
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 2.3 MiB After Width: | Height: | Size: 1.7 MiB |
|
@ -42,10 +42,9 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.categories-sidebar {
|
.categories-sidebar {
|
||||||
width: 15%; /* Уменьшаем ширину боковой панели */
|
width: 75%; /* Уменьшаем ширину боковой панели */
|
||||||
margin-left: auto; /* Выравнивание по правому краю */
|
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
background: rgba(0, 0, 0, 0.5); /* Полупрозрачный фон для панели */
|
background: rgba(0, 0, 0, 0.07); /* Полупрозрачный фон для панели */
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,4 +78,10 @@ font-family: 'Playfair Display', fantasy;
|
||||||
box-shadow: 0 0 0 0 rgba(255, 215, 0, 0);
|
box-shadow: 0 0 0 0 rgba(255, 215, 0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@media (max-width: 767.98px) { /* Bootstrap breakpoint for small devices */
|
||||||
|
.button-container {
|
||||||
|
flex-direction: row !important; /* Switch to horizontal layout */
|
||||||
|
justify-content: center; /* Center buttons horizontally */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -70,42 +70,39 @@
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
</header>
|
</header>
|
||||||
<main class="d-flex">
|
<main class="d-flex flex-column flex-md-row align-items-center justify-content-around">
|
||||||
<img alt="backimg" src="{% static '/deps/images/bg-image2.png'%}" class="fixed-top z-0 vw-100 vh-100 object-fit-cover"/>
|
<img alt="backimg" src="{% static '/deps/images/bg-image2.png' %}" class="fixed-top z-0 vw-100 vh-100 object-fit-cover"/>
|
||||||
|
|
||||||
<div class="button-container vh-100 d-flex flex-column gap-5 justify-content-center">
|
<div class="button-container d-flex flex-column justify-content-around align-items-center ">
|
||||||
<a href="/" class="button" id="shop-button">
|
<a href="/" class="button m-2" id="shop-button">
|
||||||
<div class="icon-shop"></div>
|
<div class="icon-shop"></div>
|
||||||
|
</a>
|
||||||
|
<a href="{% url 'main:about' %}" class="button m-2" id="about-button">
|
||||||
|
<div class="icon-about"></div>
|
||||||
|
</a>
|
||||||
|
<a href="/cart" class="button m-2" id="cart-button">
|
||||||
|
<div class="icon-cart"></div>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
</a>
|
|
||||||
<a href="{% url 'main:about' %}" class="button" id="about-button">
|
|
||||||
<div class="icon-about"></div>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<a href="/cart" class="button" id="cart-button">
|
|
||||||
<div class="icon-cart"></div>
|
|
||||||
|
|
||||||
</a>
|
<div class="container">
|
||||||
|
{% block content %}
|
||||||
|
<div class="row mb-3">
|
||||||
|
<!-- Адаптация под мобильные устройства -->
|
||||||
|
<div class="col-12 col-sm-4 col-md-3 col-lg-2">
|
||||||
|
<div class="list-group">
|
||||||
|
<a href="#" class="list-group-item list-group-item-action active w-100% " aria-current="true">Категории</a>
|
||||||
|
{% for category in categories %}
|
||||||
|
<a href="{% url 'main:product_list_by_category' category.slug %}" class="list-group-item list-group-item-action">{{ category.name }}</a>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="container">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{% block content %}
|
|
||||||
<div class="row mb-3">
|
|
||||||
<div class="col-lg-2">
|
|
||||||
<div class="list-group">
|
|
||||||
<a href="#" class="list-group-item list-group-item-action active" aria-current="true">Категории</a>
|
|
||||||
{% for category in categories %}
|
|
||||||
<a href="{% url 'main:product_list_by_category' category.slug %}" class="list-group-item list-group-item-action">{{ category.name }}</a>
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
{% endblock %}
|
|
||||||
</div>
|
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<link rel="stylesheet" href="{% static 'deps/css/my_css.css' %}">
|
<link rel="stylesheet" href="{% static 'deps/css/my_css.css' %}">
|
||||||
<link rel="stylesheet" href="{% static 'deps/css/exo.css' %}">
|
<link rel="stylesheet" href="{% static 'deps/css/exo.css' %}">
|
||||||
|
|
||||||
<div class="main-content">
|
<div class="main-content d-flex flex-column-reverse flex-sm-row align-items-center">
|
||||||
<div id="main" class="product-list">
|
<div id="main" class="product-list">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
{% for product in products %}
|
{% for product in products %}
|
||||||
|
@ -44,7 +44,7 @@
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="sidebar" class="categories-sidebar">
|
<div id="sidebar" class="categories-sidebar "style="width: 75%">
|
||||||
<div class="btn-group flex-wrap overflow-hidden rounded-8" role="group" aria-label="Категории">
|
<div class="btn-group flex-wrap overflow-hidden rounded-8" role="group" aria-label="Категории">
|
||||||
<a href="{% url 'main:product_list' %}" class="btn btn-secondary rounded-0 {% if not category %}active{% endif %}">
|
<a href="{% url 'main:product_list' %}" class="btn btn-secondary rounded-0 {% if not category %}active{% endif %}">
|
||||||
Все
|
Все
|
||||||
|
|
Loading…
Reference in New Issue