Lowlights 2024-03-07 14:17:00 +06:00
parent 1a9f3afec2
commit 71694f09c3
8 changed files with 136 additions and 93 deletions

View File

@ -4,70 +4,69 @@
{% block title %}Your shopping cart{% endblock %}
{% 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">
<div class="cart-container position-relative">
<div class="text-center my-4">
<h1 class="display-4" style="color:black;">
<i class="fa fa-shopping-cart" aria-hidden="true"></i> Корзина
</h1>
<p class="lead" style="color: whitesmoke">Проверьте свои товары перед оформлением заказа.</p>
</div>
</div>
<h1 class="display-4" style="color:black;">
<i class="fa fa-shopping-cart" aria-hidden="true"></i> Корзина
</h1>
<p class="lead" style="color: whitesmoke;">Проверьте свои товары перед оформлением заказа.</p>
</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 >
<tr>
<th>Изображение</th>
<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 class="d-flex justify-content-between my-3">
<a href="{% url 'main:product_list' %}" class="btn btn-outline-secondary">Продолжить покупки</a>
<a href="{% url 'orders:order_create' %}" class="btn btn-outline-primary">Оформить заказ</a>
</div>
</div>

Binary file not shown.

View File

@ -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
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
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

View File

@ -42,10 +42,9 @@
}
.categories-sidebar {
width: 15%; /* Уменьшаем ширину боковой панели */
margin-left: auto; /* Выравнивание по правому краю */
width: 75%; /* Уменьшаем ширину боковой панели */
padding: 20px;
background: rgba(0, 0, 0, 0.5); /* Полупрозрачный фон для панели */
background: rgba(0, 0, 0, 0.07); /* Полупрозрачный фон для панели */
border-radius: 10px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

View File

@ -78,4 +78,10 @@ font-family: 'Playfair Display', fantasy;
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 */
}
}

View File

@ -70,42 +70,39 @@
</div>
</nav>
</header>
<main class="d-flex">
<img alt="backimg" src="{% static '/deps/images/bg-image2.png'%}" class="fixed-top z-0 vw-100 vh-100 object-fit-cover"/>
<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"/>
<div class="button-container vh-100 d-flex flex-column gap-5 justify-content-center">
<a href="/" class="button" id="shop-button">
<div class="icon-shop"></div>
<div class="button-container d-flex flex-column justify-content-around align-items-center ">
<a href="/" class="button m-2" id="shop-button">
<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 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>

View File

@ -5,7 +5,7 @@
<link rel="stylesheet" href="{% static 'deps/css/my_css.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 class="row">
{% for product in products %}
@ -44,7 +44,7 @@
{% endfor %}
</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="Категории">
<a href="{% url 'main:product_list' %}" class="btn btn-secondary rounded-0 {% if not category %}active{% endif %}">
Все