Spaces:
Runtime error
Runtime error
Update templates/menu.html
Browse files- templates/menu.html +20 -25
templates/menu.html
CHANGED
@@ -851,7 +851,7 @@
|
|
851 |
<button class="btn btn-primary"
|
852 |
data-bs-toggle="modal"
|
853 |
data-bs-target="#itemModal"
|
854 |
-
onclick="showItemDetails('{{ item.Name | default('Unnamed Item') }}', '{{ item.Price__c | default('0.00') }}', '{{ item.Image2__c | default(item.Image1__c) }}', '{{ item.Description__c | default('No description') }}', '{{ item.Section__c | default(section) }}', '{{ selected_category }}')">
|
855 |
ADD
|
856 |
</button>
|
857 |
{% endif %}
|
@@ -865,25 +865,14 @@
|
|
865 |
{% if item.Section__c != 'Soft Drinks' %}
|
866 |
<div class="toggle-details" data-item-name="{{ item.Name | default('Unnamed Item') }}">Show Details</div>
|
867 |
<div class="item-details" id="details-{{ item.Name | default('unnamed-item') | replace(' ', '-') }}">
|
868 |
-
|
869 |
-
|
870 |
-
|
871 |
-
{
|
872 |
-
|
873 |
-
|
874 |
-
|
875 |
-
{
|
876 |
-
{% if item.Nutritional_Info__c %}
|
877 |
-
<h6>Nutritional Info</h6>
|
878 |
-
<p>{{ item.Nutritional_Info__c }}</p>
|
879 |
-
{% endif %}
|
880 |
-
{% if item.Allergens__c %}
|
881 |
-
<h6>Allergens</h6>
|
882 |
-
<p>{{ item.Allergens__c }}</p>
|
883 |
-
{% endif %}
|
884 |
-
{% if not (item.Ingredients__c or item.Description__c or item.Nutritional_Info__c or item.Allergens__c) %}
|
885 |
-
<p>No details available.</p>
|
886 |
-
{% endif %}
|
887 |
</div>
|
888 |
{% endif %}
|
889 |
</div>
|
@@ -901,7 +890,7 @@
|
|
901 |
</a>
|
902 |
<a href="{{ url_for('cart.cart') }}" class="btn btn-view-cart">
|
903 |
<i class="bi bi-cart"></i> View Cart
|
904 |
-
<span class="cart-icon-badge" id="cart-item-count">
|
905 |
</a>
|
906 |
</div>
|
907 |
|
@@ -918,6 +907,11 @@
|
|
918 |
<h5 id="modal-name" class="fw-bold text-center"></h5>
|
919 |
<p id="modal-price" class="text-muted text-center"></p>
|
920 |
<p id="modal-description" class="text-secondary"></p>
|
|
|
|
|
|
|
|
|
|
|
921 |
<div id="modal-addons" class="modal-addons mt-4">
|
922 |
<h6>Customization Options</h6>
|
923 |
<div id="addons-list" class="addons-container">Loading customization options...</div>
|
@@ -940,7 +934,7 @@
|
|
940 |
</div>
|
941 |
</div>
|
942 |
|
943 |
-
<!--
|
944 |
<div class="modal fade" id="softDrinkModal" tabindex="-1" aria-labelledby="softDrinkModalLabel" aria-hidden="true">
|
945 |
<div class="modal-dialog modal-dialog-centered">
|
946 |
<div class="modal-content" style="border-radius: 15px; box-shadow: 0 4px 15px rgba(0,0,0,0.2);">
|
@@ -1194,7 +1188,6 @@
|
|
1194 |
const detailsDiv = document.getElementById(`details-${itemName}`);
|
1195 |
const isCurrentlyShown = detailsDiv.classList.contains('show');
|
1196 |
|
1197 |
-
// Close all other details sections
|
1198 |
document.querySelectorAll('.item-details.show').forEach(otherDetails => {
|
1199 |
if (otherDetails !== detailsDiv) {
|
1200 |
otherDetails.classList.remove('show');
|
@@ -1205,7 +1198,6 @@
|
|
1205 |
}
|
1206 |
});
|
1207 |
|
1208 |
-
// Toggle the current details section
|
1209 |
if (!isCurrentlyShown) {
|
1210 |
detailsDiv.classList.add('show');
|
1211 |
this.innerText = 'Hide Details';
|
@@ -1440,12 +1432,15 @@
|
|
1440 |
}
|
1441 |
}
|
1442 |
|
1443 |
-
function showItemDetails(name, price, image, description, section, selectedCategory) {
|
1444 |
document.getElementById('modal-name').innerText = name;
|
1445 |
document.getElementById('modal-price').innerText = `$${price}`;
|
1446 |
const modalImg = document.getElementById('modal-img');
|
1447 |
modalImg.src = image || '/static/placeholder.jpg';
|
1448 |
document.getElementById('modal-description').innerText = description || 'No description available.';
|
|
|
|
|
|
|
1449 |
document.getElementById('addons-list').innerHTML = 'Loading customization options...';
|
1450 |
document.getElementById('modal-instructions').value = '';
|
1451 |
const modalSectionEl = document.getElementById('modal-section');
|
|
|
851 |
<button class="btn btn-primary"
|
852 |
data-bs-toggle="modal"
|
853 |
data-bs-target="#itemModal"
|
854 |
+
onclick="showItemDetails('{{ item.Name | default('Unnamed Item') }}', '{{ item.Price__c | default('0.00') }}', '{{ item.Image2__c | default(item.Image1__c) }}', '{{ item.Description__c | default('No description') }}', '{{ item.IngredientsInfo__c | default('Not specified') }}', '{{ item.NutritionalInfo__c | default('Not available') }}', '{{ item.Allergens__c | default('None listed') }}', '{{ item.Section__c | default(section) }}', '{{ selected_category }}')">
|
855 |
ADD
|
856 |
</button>
|
857 |
{% endif %}
|
|
|
865 |
{% if item.Section__c != 'Soft Drinks' %}
|
866 |
<div class="toggle-details" data-item-name="{{ item.Name | default('Unnamed Item') }}">Show Details</div>
|
867 |
<div class="item-details" id="details-{{ item.Name | default('unnamed-item') | replace(' ', '-') }}">
|
868 |
+
<h6>Description</h6>
|
869 |
+
<p>{{ item.Description__c | default('No description available') }}</p>
|
870 |
+
<h6>Ingredients</h6>
|
871 |
+
<p>{{ item.IngredientsInfo__c | default('Not specified') }}</p>
|
872 |
+
<h6>Nutritional Info</h6>
|
873 |
+
<p>{{ item.NutritionalInfo__c | default('Not available') }}</p>
|
874 |
+
<h6>Allergens</h6>
|
875 |
+
<p>{{ item.Allergens__c | default('None listed') }}</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
876 |
</div>
|
877 |
{% endif %}
|
878 |
</div>
|
|
|
890 |
</a>
|
891 |
<a href="{{ url_for('cart.cart') }}" class="btn btn-view-cart">
|
892 |
<i class="bi bi-cart"></i> View Cart
|
893 |
+
<span class="cart-icon-badge" id="cart-item-count">{{ cart_item_count }}</span>
|
894 |
</a>
|
895 |
</div>
|
896 |
|
|
|
907 |
<h5 id="modal-name" class="fw-bold text-center"></h5>
|
908 |
<p id="modal-price" class="text-muted text-center"></p>
|
909 |
<p id="modal-description" class="text-secondary"></p>
|
910 |
+
<div class="nutritional-info">
|
911 |
+
<strong>Ingredients:</strong> <span id="modal-ingredients"></span><br>
|
912 |
+
<strong>Nutrition:</strong> <span id="modal-nutrition"></span><br>
|
913 |
+
<strong>Allergens:</strong> <span id="modal-allergens"></span>
|
914 |
+
</div>
|
915 |
<div id="modal-addons" class="modal-addons mt-4">
|
916 |
<h6>Customization Options</h6>
|
917 |
<div id="addons-list" class="addons-container">Loading customization options...</div>
|
|
|
934 |
</div>
|
935 |
</div>
|
936 |
|
937 |
+
<!-- Modal for Soft Drinks Quantity Selection -->
|
938 |
<div class="modal fade" id="softDrinkModal" tabindex="-1" aria-labelledby="softDrinkModalLabel" aria-hidden="true">
|
939 |
<div class="modal-dialog modal-dialog-centered">
|
940 |
<div class="modal-content" style="border-radius: 15px; box-shadow: 0 4px 15px rgba(0,0,0,0.2);">
|
|
|
1188 |
const detailsDiv = document.getElementById(`details-${itemName}`);
|
1189 |
const isCurrentlyShown = detailsDiv.classList.contains('show');
|
1190 |
|
|
|
1191 |
document.querySelectorAll('.item-details.show').forEach(otherDetails => {
|
1192 |
if (otherDetails !== detailsDiv) {
|
1193 |
otherDetails.classList.remove('show');
|
|
|
1198 |
}
|
1199 |
});
|
1200 |
|
|
|
1201 |
if (!isCurrentlyShown) {
|
1202 |
detailsDiv.classList.add('show');
|
1203 |
this.innerText = 'Hide Details';
|
|
|
1432 |
}
|
1433 |
}
|
1434 |
|
1435 |
+
function showItemDetails(name, price, image, description, ingredients, nutrition, allergens, section, selectedCategory) {
|
1436 |
document.getElementById('modal-name').innerText = name;
|
1437 |
document.getElementById('modal-price').innerText = `$${price}`;
|
1438 |
const modalImg = document.getElementById('modal-img');
|
1439 |
modalImg.src = image || '/static/placeholder.jpg';
|
1440 |
document.getElementById('modal-description').innerText = description || 'No description available.';
|
1441 |
+
document.getElementById('modal-ingredients').innerText = ingredients || 'Not specified';
|
1442 |
+
document.getElementById('modal-nutrition').innerText = nutrition || 'Not available';
|
1443 |
+
document.getElementById('modal-allergens').innerText = allergens || 'None listed';
|
1444 |
document.getElementById('addons-list').innerHTML = 'Loading customization options...';
|
1445 |
document.getElementById('modal-instructions').value = '';
|
1446 |
const modalSectionEl = document.getElementById('modal-section');
|