Kgshop commited on
Commit
0093130
·
verified ·
1 Parent(s): ff4306d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -10
app.py CHANGED
@@ -441,7 +441,7 @@ def catalog():
441
  </div>
442
  {% endif %}
443
  <h2>{{ product['name'] }}</h2>
444
- <div class="product-price">{{ product['price'] }} с</div>
445
  <p class="product-description">{{ product['description'][:50] }}{% if product['description']|length > 50 %}...{% endif %}</p>
446
  <button class="product-button" onclick="openModal({{ loop.index0 }})">Подробнее</button>
447
  <button class="product-button add-to-cart" onclick="openQuantityModal({{ loop.index0 }})">В корзину</button>
@@ -476,7 +476,7 @@ def catalog():
476
  <h2>Корзина</h2>
477
  <div id="cartContent"></div>
478
  <div style="margin-top: 20px; text-align: right;">
479
- <strong>Итого: <span id="cartTotal">0</span> с</strong>
480
  <button class="product-button clear-cart" onclick="clearCart()">Очистить</button>
481
  <button class="product-button order-button" onclick="orderViaWhatsApp()">Заказать</button>
482
  </div>
@@ -608,10 +608,10 @@ def catalog():
608
  ${item.photo ? `<img src="https://huggingface.co/datasets/{{ repo_id }}/resolve/main/photos/${item.photo}" alt="${item.name}">` : ''}
609
  <div>
610
  <strong>${item.name}</strong>
611
- <p>${item.price} с × ${item.quantity} (Цвет: ${item.color})</p>
612
  </div>
613
  </div>
614
- <span>${itemTotal} с</span>
615
  </div>
616
  `;
617
  }).join('');
@@ -631,9 +631,9 @@ def catalog():
631
  cart.forEach((item, index) => {
632
  const itemTotal = item.price * item.quantity;
633
  total += itemTotal;
634
- orderText += `${index + 1}. ${item.name} - ${item.price} с × ${item.quantity} (Цвет: ${item.color})%0A`;
635
  });
636
- orderText += `Итого: ${total} с`;
637
  window.open(`https://api.whatsapp.com/send?phone=996703763333&text=${orderText}`, '_blank');
638
  }
639
 
@@ -710,7 +710,7 @@ def product_detail(index):
710
  <div class="swiper-button-prev"></div>
711
  </div>
712
  <p><strong>Категория:</strong> {{ product.get('category', 'Без категории') }}</p>
713
- <p><strong>Цена:</strong> {{ product['price'] }} с</p>
714
  <p><strong>Описание:</strong> {{ product['description'] }}</p>
715
  <p><strong>Доступные цвета:</strong> {{ product.get('colors', ['Нет цветов'])|join(', ') }}</p>
716
  </div>
@@ -966,7 +966,7 @@ def admin():
966
  <input type="hidden" name="action" value="add">
967
  <label>Название товара:</label>
968
  <input type="text" name="name" required>
969
- <label>Цена:</label>
970
  <input type="number" name="price" step="0.01" required>
971
  <label>Описание:</label>
972
  <textarea name="description" rows="4" required></textarea>
@@ -1025,7 +1025,7 @@ def admin():
1025
  <div class="product-item">
1026
  <h3>{{ product['name'] }}</h3>
1027
  <p><strong>Категория:</strong> {{ product.get('category', 'Без категории') }}</p>
1028
- <p><strong>Цена:</strong> {{ product['price'] }} с</p>
1029
  <p><strong>Описание:</strong> {{ product['description'] }}</p>
1030
  <p><strong>Цвета:</strong> {{ product.get('colors', ['Нет цветов'])|join(', ') }}</p>
1031
  {% if product.get('photos') and product['photos']|length > 0 %}
@@ -1044,7 +1044,7 @@ def admin():
1044
  <input type="hidden" name="index" value="{{ loop.index0 }}">
1045
  <label>Название:</label>
1046
  <input type="text" name="name" value="{{ product['name'] }}" required>
1047
- <label>Цена:</label>
1048
  <input type="number" name="price" step="0.01" value="{{ product['price'] }}" required>
1049
  <label>Описание:</label>
1050
  <textarea name="description" rows="4" required>{{ product['description'] }}</textarea>
 
441
  </div>
442
  {% endif %}
443
  <h2>{{ product['name'] }}</h2>
444
+ <div class="product-price">${{ product['price'] }}</div>
445
  <p class="product-description">{{ product['description'][:50] }}{% if product['description']|length > 50 %}...{% endif %}</p>
446
  <button class="product-button" onclick="openModal({{ loop.index0 }})">Подробнее</button>
447
  <button class="product-button add-to-cart" onclick="openQuantityModal({{ loop.index0 }})">В корзину</button>
 
476
  <h2>Корзина</h2>
477
  <div id="cartContent"></div>
478
  <div style="margin-top: 20px; text-align: right;">
479
+ <strong>Итого: $<span id="cartTotal">0</span></strong>
480
  <button class="product-button clear-cart" onclick="clearCart()">Очистить</button>
481
  <button class="product-button order-button" onclick="orderViaWhatsApp()">Заказать</button>
482
  </div>
 
608
  ${item.photo ? `<img src="https://huggingface.co/datasets/{{ repo_id }}/resolve/main/photos/${item.photo}" alt="${item.name}">` : ''}
609
  <div>
610
  <strong>${item.name}</strong>
611
+ <p>$${item.price} × ${item.quantity} (Цвет: ${item.color})</p>
612
  </div>
613
  </div>
614
+ <span>$${itemTotal}</span>
615
  </div>
616
  `;
617
  }).join('');
 
631
  cart.forEach((item, index) => {
632
  const itemTotal = item.price * item.quantity;
633
  total += itemTotal;
634
+ orderText += `${index + 1}. ${item.name} - $${item.price} × ${item.quantity} (Цвет: ${item.color})%0A`;
635
  });
636
+ orderText += `Итого: $${total}`;
637
  window.open(`https://api.whatsapp.com/send?phone=996703763333&text=${orderText}`, '_blank');
638
  }
639
 
 
710
  <div class="swiper-button-prev"></div>
711
  </div>
712
  <p><strong>Категория:</strong> {{ product.get('category', 'Без категории') }}</p>
713
+ <p><strong>Цена:</strong> ${{ product['price'] }}</p>
714
  <p><strong>Описание:</strong> {{ product['description'] }}</p>
715
  <p><strong>Доступные цвета:</strong> {{ product.get('colors', ['Нет цветов'])|join(', ') }}</p>
716
  </div>
 
966
  <input type="hidden" name="action" value="add">
967
  <label>Название товара:</label>
968
  <input type="text" name="name" required>
969
+ <label>Цена ($):</label>
970
  <input type="number" name="price" step="0.01" required>
971
  <label>Описание:</label>
972
  <textarea name="description" rows="4" required></textarea>
 
1025
  <div class="product-item">
1026
  <h3>{{ product['name'] }}</h3>
1027
  <p><strong>Категория:</strong> {{ product.get('category', 'Без категории') }}</p>
1028
+ <p><strong>Цена:</strong> ${{ product['price'] }}</p>
1029
  <p><strong>Описание:</strong> {{ product['description'] }}</p>
1030
  <p><strong>Цвета:</strong> {{ product.get('colors', ['Нет цветов'])|join(', ') }}</p>
1031
  {% if product.get('photos') and product['photos']|length > 0 %}
 
1044
  <input type="hidden" name="index" value="{{ loop.index0 }}">
1045
  <label>Название:</label>
1046
  <input type="text" name="name" value="{{ product['name'] }}" required>
1047
+ <label>Цена ($):</label>
1048
  <input type="number" name="price" step="0.01" value="{{ product['price'] }}" required>
1049
  <label>Описание:</label>
1050
  <textarea name="description" rows="4" required>{{ product['description'] }}</textarea>