-
Notifications
You must be signed in to change notification settings - Fork 5
/
table_form.html
153 lines (140 loc) · 6.3 KB
/
table_form.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
{% load static %}
{% load widget_tweaks %}
{% load se_extras %}
{% load pages_extras %}
{% if cart|length %}
<h1>Оформление заказа</h1>
<div id="js-order-list" class="div-table order-list">
<div class="hidden-xs div-table-heading">
<div class="div-table-head order-th-code">Код</div>
<div class="div-table-head order-th-photo">Фото</div>
<div class="div-table-head order-th-product">Наименование</div>
<div class="div-table-head order-th-count">Количество</div>
<div class="div-table-head order-th-price">Цена</div>
<div class="hidden-xs div-table-head order-table-remove"></div>
</div>
<div class="div-table-body">
{% for id, position in cart %}
<div class="div-table-row" data-table-id="{{ id }}">
<div class="div-table-cell order-table-product-id">{{ position.vendor_code }}</div>
<div class="div-table-cell order-table-product-photo text-center">
{% if 'logo' in position.image %} {# position has no image #}
<img src="{% static 'images/camera-icon.png' %}" alt="{% get_img_alt position %}">
{% else %}
<a class="fancybox" rel="product-cart-gallery" href="{{ position.image }}"
title="{{ position.name }}">
<img src="{% static 'images/camera-icon-clr.png' %}" alt="{% get_img_alt position %}">
</a>
{% endif %}
</div>
<div class="div-table-cell">
<a class="js-product-link" href="{{ position.url }}">{{ position.name }}</a>
</div>
<div class="div-table-cell order-table-product-count">
<div class="stock">
{% if position.in_stock > 0 %}
<i class="fa fa-circle in-stock" title="В наличии"></i>
{% else %}
<i class="fa fa-circle out-stock" title="Под заказ"></i>
{% endif %}
</div>
<input class="prod-count input-number js-prod-count js-touchspin"
value="{{ position.quantity }}" type="number"
name="prod-count" productId="{{ id }}" productLastCount="{{ position.quantity }}">
</div>
<div class="div-table-cell order-table-product-price text-center js-product-price"
productId="{{ id }}" productPrice="{{ position.price }}">
{{ position.price|humanize_price }} руб.
</div>
<div class="div-table-cell text-center">
<div class="order-list-remove-item js-remove" productId="{{ id }}" productCount="{{ position.quantity }}" title="Убрать из заказа">
<i class="fa fa-close"></i>
</div>
</div>
</div>
{% endfor %}
</div>
<div class="div-table-footer">
<div class="hidden-xs div-table-cell"></div>
<div class="hidden-xs div-table-cell"></div>
<div class="div-table-cell order-table-sum-text">
<strong>Итого:</strong>
</div>
<div class="div-table-cell order-table-sum-count text-center">
<strong id="cart-page-prods-count">{{ cart.total_quantity }} шт.</strong>
</div>
<div class="div-table-cell order-table-sum-cash text-center">
<strong id="cart-page-sum">{{ cart.total_price|humanize_price }} руб.</strong>
</div>
<div class="hidden-xs div-table-cell"></div>
</div>
</div>
<form class="order-form" id="order-form-full" method="post">
{% csrf_token %}
<div class="order-info">
<div class="order-payment-types">
<div class="order-info-header text-center">СПОСОБЫ ОПЛАТЫ</div>
<div class="payment-types-form">
{% include 'ecommerce/order/payment_types.html' %}
</div>
</div>
<div class="order-user-info">
<div class="order-info-header text-center">ФОРМА ЗАКАЗА</div>
<p class="error-msg hidden js-form-error-text">Введите ваш телефон и почтовый адрес</p>
<div class="order-form-right form-horizontal">
<div class="form-group">
<label class="col-sm-5 control-label" for="{{ form.name.id_for_label }}">Ваше имя:</label>
<div class="col-sm-7">{{ form.name }}</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label" for="{{ form.phone.id_for_label }}">
Контактный телефон: <strong class="table-required-icon">*</strong>
</label>
<div class="col-sm-7">
{{ form.phone.errors }}
{{ form.phone|add_class:'js-masked-phone' }}
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label" for="{{ form.email.id_for_label }}">
Электронная почта: <strong class="table-required-icon">*</strong>
</label>
<div class="col-sm-7">
{{ form.email.errors }}
{{ form.email }}
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label" for="{{ form.city.id_for_label }}">Город:</label>
<div class="col-sm-7">
{{ form.city }}
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label" for="{{ form.address.id_for_label }}">Адрес:</label>
<div class="col-sm-7">
{{ form.address }}
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label" for="{{ form.comment.id_for_label }}">Комментарий:</label>
<div class="col-sm-7">
{{ form.comment }}
</div>
</div>
<div class="order-submit-wrapper">
<button id="submit-order" class="btn btn-pink" type="submit">
Продолжить
</button>
</div>
</div>
</div>
</div>
</form>
<div class="hidden" id="yandex-form-wrapper"></div>
{% else %}
<h1>Корзина пуста</h1>
<span class="page-info-message">В вашей корзине пока нет товаров.
<a href="{% custom_url 'catalog' %}">Перейти к каталогу</a>
</span>
{% endif %}