flpolprojects commited on
Commit
cbecbd8
·
verified ·
1 Parent(s): c972fff

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -450,7 +450,7 @@ def catalog():
450
  </div>
451
  {% endif %}
452
  <h2>{{ product['name'] }}</h2>
453
- <div class="product-price">{{ product['price'] }} ₽</div>
454
  <p class="product-description">{{ product['description'][:50] }}{% if product['description']|length > 50 %}...{% endif %}</p>
455
  <button class="product-button" onclick="openModal({{ loop.index0 }})">Подробнее</button>
456
  <button class="product-button add-to-cart" onclick="openQuantityModal({{ loop.index0 }})">В корзину</button>
@@ -484,7 +484,7 @@ def catalog():
484
  <h2>Корзина</h2>
485
  <div id="cartContent"></div>
486
  <div style="margin-top: 20px; text-align: right;">
487
- <strong>Итого: <span id="cartTotal">0</span> ₽</strong>
488
  <button class="product-button clear-cart" onclick="clearCart()">Очистить</button>
489
  <button class="product-button order-button" onclick="orderViaWhatsApp()">Заказать</button>
490
  </div>
@@ -596,10 +596,10 @@ def catalog():
596
  ${item.photo ? `<img src="https://huggingface.co/datasets/{{ repo_id }}/resolve/main/photos/${item.photo}" alt="${item.name}">` : ''}
597
  <div>
598
  <strong>${item.name}</strong>
599
- <p>${item.price} × ${item.quantity}</p>
600
  </div>
601
  </div>
602
- <span>${itemTotal} ₽</span>
603
  </div>
604
  `;
605
  }).join('');
@@ -619,9 +619,9 @@ def catalog():
619
  cart.forEach((item, index) => {
620
  const itemTotal = item.price * item.quantity;
621
  total += itemTotal;
622
- orderText += `${index + 1}. ${item.name} - ${item.price} × ${item.quantity}%0A`;
623
  });
624
- orderText += `Итого: ${total} ₽`;
625
  window.open(`https://api.whatsapp.com/send?phone=996500398754&text=${orderText}`, '_blank');
626
  }
627
 
@@ -698,7 +698,7 @@ def product_detail(index):
698
  <div class="swiper-button-prev"></div>
699
  </div>
700
  <p><strong>Категория:</strong> {{ product.get('category', 'Без категории') }}</p>
701
- <p><strong>Цена:</strong> {{ product['price'] }} ₽</p>
702
  <p><strong>Описание:</strong> {{ product['description'] }}</p>
703
  </div>
704
  '''
@@ -967,7 +967,7 @@ def admin():
967
  <div class="product-item">
968
  <h3>{{ product['name'] }}</h3>
969
  <p><strong>Категория:</strong> {{ product.get('category', 'Без категории') }}</p>
970
- <p><strong>Цена:</strong> {{ product['price'] }} ₽</p>
971
  <p><strong>Описание:</strong> {{ product['description'] }}</p>
972
  {% if product.get('photos') and product['photos']|length > 0 %}
973
  <img src="https://huggingface.co/datasets/{{ repo_id }}/resolve/main/photos/{{ product['photos'][0] }}"
 
450
  </div>
451
  {% endif %}
452
  <h2>{{ product['name'] }}</h2>
453
+ <div class="product-price">{{ product['price'] }} с</div>
454
  <p class="product-description">{{ product['description'][:50] }}{% if product['description']|length > 50 %}...{% endif %}</p>
455
  <button class="product-button" onclick="openModal({{ loop.index0 }})">Подробнее</button>
456
  <button class="product-button add-to-cart" onclick="openQuantityModal({{ loop.index0 }})">В корзину</button>
 
484
  <h2>Корзина</h2>
485
  <div id="cartContent"></div>
486
  <div style="margin-top: 20px; text-align: right;">
487
+ <strong>Итого: <span id="cartTotal">0</span> с</strong>
488
  <button class="product-button clear-cart" onclick="clearCart()">Очистить</button>
489
  <button class="product-button order-button" onclick="orderViaWhatsApp()">Заказать</button>
490
  </div>
 
596
  ${item.photo ? `<img src="https://huggingface.co/datasets/{{ repo_id }}/resolve/main/photos/${item.photo}" alt="${item.name}">` : ''}
597
  <div>
598
  <strong>${item.name}</strong>
599
+ <p>${item.price} с × ${item.quantity}</p>
600
  </div>
601
  </div>
602
+ <span>${itemTotal} с</span>
603
  </div>
604
  `;
605
  }).join('');
 
619
  cart.forEach((item, index) => {
620
  const itemTotal = item.price * item.quantity;
621
  total += itemTotal;
622
+ orderText += `${index + 1}. ${item.name} - ${item.price} с × ${item.quantity}%0A`;
623
  });
624
+ orderText += `Итого: ${total} с`;
625
  window.open(`https://api.whatsapp.com/send?phone=996500398754&text=${orderText}`, '_blank');
626
  }
627
 
 
698
  <div class="swiper-button-prev"></div>
699
  </div>
700
  <p><strong>Категория:</strong> {{ product.get('category', 'Без категории') }}</p>
701
+ <p><strong>Цена:</strong> {{ product['price'] }} с</p>
702
  <p><strong>Описание:</strong> {{ product['description'] }}</p>
703
  </div>
704
  '''
 
967
  <div class="product-item">
968
  <h3>{{ product['name'] }}</h3>
969
  <p><strong>Категория:</strong> {{ product.get('category', 'Без категории') }}</p>
970
+ <p><strong>Цена:</strong> {{ product['price'] }} с</p>
971
  <p><strong>Описание:</strong> {{ product['description'] }}</p>
972
  {% if product.get('photos') and product['photos']|length > 0 %}
973
  <img src="https://huggingface.co/datasets/{{ repo_id }}/resolve/main/photos/{{ product['photos'][0] }}"