Update templates/menu.html
Browse files- templates/menu.html +25 -21
templates/menu.html
CHANGED
@@ -832,7 +832,7 @@
|
|
832 |
<div class="button-container"
|
833 |
data-item-name="{{ item.Name | default('Unnamed Item') }}"
|
834 |
data-item-price="{{ item.Price__c | default('0.00') }}"
|
835 |
-
data-item-image="{{ item.Image1__c | default('/static/placeholder.jpg') }}"
|
836 |
data-item-section="{{ item.Section__c | default(section) }}"
|
837 |
data-item-category="{{ selected_category }}">
|
838 |
{% if item.Section__c == 'Soft Drinks' %}
|
@@ -852,7 +852,6 @@
|
|
852 |
</div>
|
853 |
</div>
|
854 |
</div>
|
855 |
-
<!-- Only show toggle-details if not Soft Drinks -->
|
856 |
{% if item.Section__c != 'Soft Drinks' %}
|
857 |
<div class="toggle-details" data-item-name="{{ item.Name | default('Unnamed Item') }}">Show Details</div>
|
858 |
<div class="item-details" id="details-{{ item.Name | default('unnamed-item') | replace(' ', '-') }}"></div>
|
@@ -872,6 +871,7 @@
|
|
872 |
</a>
|
873 |
<a href="{{ url_for('cart.cart') }}" class="btn btn-view-cart">
|
874 |
<i class="bi bi-cart"></i> View Cart
|
|
|
875 |
</a>
|
876 |
</div>
|
877 |
|
@@ -910,28 +910,30 @@
|
|
910 |
</div>
|
911 |
</div>
|
912 |
|
913 |
-
<!-- Modal for Soft Drinks Quantity Selection -->
|
914 |
<div class="modal fade" id="softDrinkModal" tabindex="-1" aria-labelledby="softDrinkModalLabel" aria-hidden="true">
|
915 |
<div class="modal-dialog modal-dialog-centered">
|
916 |
-
<div class="modal-content">
|
917 |
-
<div class="modal-header">
|
918 |
-
<h5 class="modal-title" id="softDrinkModalLabel">Select
|
919 |
-
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
920 |
</div>
|
921 |
-
<div class="modal-body">
|
922 |
-
<div class="text-center mb-
|
923 |
-
<
|
924 |
-
<
|
|
|
925 |
</div>
|
926 |
<div class="d-flex justify-content-center align-items-center mb-4">
|
927 |
-
<
|
928 |
-
|
929 |
-
|
|
|
|
|
930 |
</div>
|
931 |
</div>
|
932 |
-
<div class="modal-footer">
|
933 |
-
<button type="button" class="btn btn-
|
934 |
-
<button type="button" class="btn btn-primary" onclick="addSoftDrinkToCart()">Add to Cart</button>
|
935 |
</div>
|
936 |
</div>
|
937 |
</div>
|
@@ -1110,10 +1112,13 @@
|
|
1110 |
const buttonContainer = button.closest('.button-container');
|
1111 |
const itemName = buttonContainer.getAttribute('data-item-name');
|
1112 |
const itemPrice = buttonContainer.getAttribute('data-item-price');
|
|
|
1113 |
|
1114 |
document.getElementById('soft-drink-name').textContent = itemName;
|
1115 |
document.getElementById('soft-drink-price').textContent = `$${itemPrice}`;
|
1116 |
document.getElementById('soft-drink-quantity').value = '1';
|
|
|
|
|
1117 |
|
1118 |
const modal = new bootstrap.Modal(document.getElementById('softDrinkModal'));
|
1119 |
modal.show();
|
@@ -1213,7 +1218,7 @@
|
|
1213 |
const itemName = card.querySelector('.card-title').innerText;
|
1214 |
const detailsDiv = card.querySelector('.item-details');
|
1215 |
const detailsData = menuItemDetails[itemName];
|
1216 |
-
if (detailsDiv && detailsData) {
|
1217 |
detailsDiv.innerHTML = `
|
1218 |
<h6>Ingredients</h6>
|
1219 |
<p>${detailsData.ingredients}</p>
|
@@ -1417,7 +1422,6 @@
|
|
1417 |
quantityInput.value = currentQuantity;
|
1418 |
});
|
1419 |
|
1420 |
-
// Soft Drinks modal quantity controls
|
1421 |
const softDrinkDecreaseBtn = document.getElementById('soft-drink-decrease');
|
1422 |
const softDrinkIncreaseBtn = document.getElementById('soft-drink-increase');
|
1423 |
const softDrinkQuantityInput = document.getElementById('soft-drink-quantity');
|
@@ -1432,7 +1436,7 @@
|
|
1432 |
|
1433 |
softDrinkIncreaseBtn.addEventListener('click', function() {
|
1434 |
let currentQuantity = parseInt(softDrinkQuantityInput.value);
|
1435 |
-
if (currentQuantity <
|
1436 |
currentQuantity++;
|
1437 |
softDrinkQuantityInput.value = currentQuantity;
|
1438 |
}
|
@@ -1559,7 +1563,7 @@
|
|
1559 |
|
1560 |
function handleAddonClick(checkbox) {
|
1561 |
const groupName = checkbox.getAttribute('data-group');
|
1562 |
-
const isMultiSelectGroup = ["Extra Toppings", "Choose Raita/Sides", "Select Dip/Sauce", "Extra Add-ons", "Make it a Combo"
|
1563 |
if (!isMultiSelectGroup) {
|
1564 |
const checkboxes = document.querySelectorAll(`.addon-option[data-group="${groupName}"]`);
|
1565 |
checkboxes.forEach(otherCheckbox => {
|
|
|
832 |
<div class="button-container"
|
833 |
data-item-name="{{ item.Name | default('Unnamed Item') }}"
|
834 |
data-item-price="{{ item.Price__c | default('0.00') }}"
|
835 |
+
data-item-image="{{ item.Image2__c | default(item.Image1__c) | default('/static/placeholder.jpg') }}"
|
836 |
data-item-section="{{ item.Section__c | default(section) }}"
|
837 |
data-item-category="{{ selected_category }}">
|
838 |
{% if item.Section__c == 'Soft Drinks' %}
|
|
|
852 |
</div>
|
853 |
</div>
|
854 |
</div>
|
|
|
855 |
{% if item.Section__c != 'Soft Drinks' %}
|
856 |
<div class="toggle-details" data-item-name="{{ item.Name | default('Unnamed Item') }}">Show Details</div>
|
857 |
<div class="item-details" id="details-{{ item.Name | default('unnamed-item') | replace(' ', '-') }}"></div>
|
|
|
871 |
</a>
|
872 |
<a href="{{ url_for('cart.cart') }}" class="btn btn-view-cart">
|
873 |
<i class="bi bi-cart"></i> View Cart
|
874 |
+
<span class="cart-icon-badge" id="cart-item-count">0</span>
|
875 |
</a>
|
876 |
</div>
|
877 |
|
|
|
910 |
</div>
|
911 |
</div>
|
912 |
|
913 |
+
<!-- Modified Modal for Soft Drinks Quantity Selection -->
|
914 |
<div class="modal fade" id="softDrinkModal" tabindex="-1" aria-labelledby="softDrinkModalLabel" aria-hidden="true">
|
915 |
<div class="modal-dialog modal-dialog-centered">
|
916 |
+
<div class="modal-content" style="border-radius: 15px; box-shadow: 0 4px 15px rgba(0,0,0,0.2);">
|
917 |
+
<div class="modal-header" style="background: linear-gradient(45deg, #0FAA39, #0D9232); color: white; border-radius: 15px 15px 0 0;">
|
918 |
+
<h5 class="modal-title" id="softDrinkModalLabel">Select Your Drink</h5>
|
919 |
+
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal" aria-label="Close"></button>
|
920 |
</div>
|
921 |
+
<div class="modal-body" style="padding: 20px;">
|
922 |
+
<div class="text-center mb-4">
|
923 |
+
<img id="soft-drink-image" class="img-fluid rounded mb-3" alt="Soft Drink Image" style="max-height: 150px; width: auto; object-fit: contain;">
|
924 |
+
<h5 id="soft-drink-name" class="fw-bold" style="color: #333;"></h5>
|
925 |
+
<p id="soft-drink-price" class="text-muted" style="font-size: 1.1rem;"></p>
|
926 |
</div>
|
927 |
<div class="d-flex justify-content-center align-items-center mb-4">
|
928 |
+
<div class="quantity-selector" style="background-color: #f8f9fa; padding: 10px; border-radius: 10px;">
|
929 |
+
<button type="button" class="btn btn-outline-secondary" id="soft-drink-decrease" style="width: 40px; height: 40px;">-</button>
|
930 |
+
<input type="text" class="form-control text-center mx-2" id="soft-drink-quantity" value="1" readonly style="width: 60px; font-weight: bold; font-size: 1.1rem;">
|
931 |
+
<button type="button" class="btn btn-outline-secondary" id="soft-drink-increase" style="width: 40px; height: 40px;">+</button>
|
932 |
+
</div>
|
933 |
</div>
|
934 |
</div>
|
935 |
+
<div class="modal-footer" style="border-top: none; padding: 0 20px 20px 20px; justify-content: center;">
|
936 |
+
<button type="button" class="btn btn-primary" onclick="addSoftDrinkToCart()" style="width: 200px; padding: 12px; font-size: 1.1rem; background-color: #0FAA39; border-color: #0FAA39;">Add to Cart</button>
|
|
|
937 |
</div>
|
938 |
</div>
|
939 |
</div>
|
|
|
1112 |
const buttonContainer = button.closest('.button-container');
|
1113 |
const itemName = buttonContainer.getAttribute('data-item-name');
|
1114 |
const itemPrice = buttonContainer.getAttribute('data-item-price');
|
1115 |
+
const itemImage = buttonContainer.getAttribute('data-item-image');
|
1116 |
|
1117 |
document.getElementById('soft-drink-name').textContent = itemName;
|
1118 |
document.getElementById('soft-drink-price').textContent = `$${itemPrice}`;
|
1119 |
document.getElementById('soft-drink-quantity').value = '1';
|
1120 |
+
const softDrinkImage = document.getElementById('soft-drink-image');
|
1121 |
+
softDrinkImage.src = itemImage || '/static/placeholder.jpg';
|
1122 |
|
1123 |
const modal = new bootstrap.Modal(document.getElementById('softDrinkModal'));
|
1124 |
modal.show();
|
|
|
1218 |
const itemName = card.querySelector('.card-title').innerText;
|
1219 |
const detailsDiv = card.querySelector('.item-details');
|
1220 |
const detailsData = menuItemDetails[itemName];
|
1221 |
+
if (detailsDiv && detailsData) {
|
1222 |
detailsDiv.innerHTML = `
|
1223 |
<h6>Ingredients</h6>
|
1224 |
<p>${detailsData.ingredients}</p>
|
|
|
1422 |
quantityInput.value = currentQuantity;
|
1423 |
});
|
1424 |
|
|
|
1425 |
const softDrinkDecreaseBtn = document.getElementById('soft-drink-decrease');
|
1426 |
const softDrinkIncreaseBtn = document.getElementById('soft-drink-increase');
|
1427 |
const softDrinkQuantityInput = document.getElementById('soft-drink-quantity');
|
|
|
1436 |
|
1437 |
softDrinkIncreaseBtn.addEventListener('click', function() {
|
1438 |
let currentQuantity = parseInt(softDrinkQuantityInput.value);
|
1439 |
+
if (currentQuantity < 10) {
|
1440 |
currentQuantity++;
|
1441 |
softDrinkQuantityInput.value = currentQuantity;
|
1442 |
}
|
|
|
1563 |
|
1564 |
function handleAddonClick(checkbox) {
|
1565 |
const groupName = checkbox.getAttribute('data-group');
|
1566 |
+
const isMultiSelectGroup = ["Extra Toppings", "Choose Raita/Sides", "Select Dip/Sauce", "Extra Add-ons", "Make it a Combo"].includes(groupName);
|
1567 |
if (!isMultiSelectGroup) {
|
1568 |
const checkboxes = document.querySelectorAll(`.addon-option[data-group="${groupName}"]`);
|
1569 |
checkboxes.forEach(otherCheckbox => {
|