lokesh341 commited on
Commit
ec024ba
·
verified ·
1 Parent(s): 06f605c

Update templates/menu.html

Browse files
Files changed (1) hide show
  1. templates/menu.html +111 -189
templates/menu.html CHANGED
@@ -9,7 +9,7 @@
9
  <link href="https://cdn.jsdelivr.net/npm/bootstrap-icons/font/bootstrap-icons.css" rel="stylesheet">
10
  <!-- Preload Placeholder Image -->
11
  <link rel="preload" href="/static/placeholder.jpg" as="image">
12
- <!-- Preload First Few Menu Item Images -->
13
  {% for section, items in ordered_menu.items() %}
14
  {% for item in items[:2] %}
15
  <link rel="preload" href="{{ item.Image1__c }}" as="image">
@@ -37,6 +37,7 @@
37
  flex-direction: column;
38
  opacity: 0;
39
  transition: opacity 0.3s ease-in-out;
 
40
  }
41
  .menu-card.visible {
42
  opacity: 1;
@@ -52,28 +53,39 @@
52
  .menu-image.loaded {
53
  opacity: 1;
54
  }
 
 
 
55
  .card-title {
56
  font-size: 1.2rem;
57
  font-weight: bold;
58
- margin: 10px 0;
 
 
59
  }
60
- .card-text {
61
- font-size: 1rem;
62
  color: #6c757d;
 
 
 
 
 
 
 
63
  }
64
  .addbutton .btn {
65
- background-color: #28a745;
66
  color: white;
67
- padding: 10px 20px;
68
- font-size: 16px;
69
  font-weight: bold;
70
  border-radius: 5px;
71
  border: none;
72
  transition: background-color 0.3s ease;
73
- margin-left: 13px;
74
  }
75
  .addbutton .btn:hover {
76
- background-color: #218838;
77
  }
78
  .customisable-text {
79
  color: #28a745;
@@ -81,6 +93,25 @@
81
  margin-left: 5px;
82
  margin-top: 1px;
83
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
84
  .btn-primary {
85
  font-size: 13px;
86
  font-weight: bold;
@@ -350,65 +381,6 @@
350
  height: 40px;
351
  width: 40px;
352
  }
353
- /* Styles for Toggleable Sections in Modal */
354
- .toggle-section {
355
- margin-bottom: 10px;
356
- }
357
- .toggle-header {
358
- display: flex;
359
- justify-content: space-between;
360
- align-items: center;
361
- cursor: pointer;
362
- padding: 5px 0;
363
- }
364
- .toggle-header h6 {
365
- margin: 0;
366
- font-size: 1.1rem;
367
- font-weight: bold;
368
- color: #343a40;
369
- }
370
- .toggle-content {
371
- display: none;
372
- padding: 10px;
373
- background-color: #f8f9fa;
374
- border-radius: 5px;
375
- }
376
- .toggle-content.show {
377
- display: block;
378
- }
379
- .toggle-arrow {
380
- transition: transform 0.3s ease;
381
- }
382
- .toggle-arrow.down {
383
- transform: rotate(0deg);
384
- }
385
- .toggle-arrow.up {
386
- transform: rotate(180deg);
387
- }
388
- .ingredients-list,
389
- .allergens-list {
390
- list-style-type: none;
391
- padding: 0;
392
- }
393
- .ingredients-list li,
394
- .allergens-list li {
395
- display: inline-block;
396
- margin-right: 10px;
397
- margin-bottom: 5px;
398
- background-color: #e9ecef;
399
- padding: 2px 8px;
400
- border-radius: 12px;
401
- font-size: 0.9rem;
402
- }
403
- .nutritional-info {
404
- display: flex;
405
- flex-wrap: wrap;
406
- gap: 15px;
407
- }
408
- .nutritional-info p {
409
- margin: 0;
410
- font-size: 0.9rem;
411
- }
412
  @media (max-width: 576px) {
413
  .modal-dialog {
414
  max-width: 98%;
@@ -476,10 +448,50 @@
476
  </form>
477
  </div>
478
  {% else %}
479
- {% for section, items in ordered_menu.items() %}
480
- <h3>{{ section }}</h3>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
481
  <div class="row">
482
- {% for item in items %}
483
  <div class="col-md-6 mb-4">
484
  <div class="card menu-card">
485
  <picture>
@@ -493,26 +505,26 @@
493
  loading="lazy"
494
  onerror="this.src='/static/placeholder.jpg';">
495
  </picture>
496
- <div class="addbutton">
497
- <div class="card-body d-flex align-items-center justify-content-between">
498
- <div>
499
- <h5 class="card-title">{{ item.Name }}</h5>
500
- <p class="card-text">${{ item.Price__c }}</p>
501
- </div>
502
- <div class="d-flex flex-column align-item-center justify-content-center">
503
- <div>
504
- <button class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#itemModal"
505
- onclick="showItemDetails('{{ item.Name }}', '{{ item.Price__c }}', '{{ item.Image2__c }}', '{{ item.Description__c }}', '{{ item.Section__c }}', '{{ selected_category }}', {{ item.Ingredients__c|tojson }}, {{ item.NutritionalInfo__c|tojson }}, {{ item.Allergens__c|tojson }})">
506
- ADD
507
- </button>
508
- </div>
509
- <div class="w-100 text-center">
510
- {% if item.Section__c != 'Apetizer' and item.Section__c != 'Customized dish' and item.Section__c !='Soft Drinks' %}
511
- <h5 class="customisable-text">Customisable</h5>
512
- {% endif %}
513
- </div>
514
  </div>
515
  </div>
 
 
 
 
 
 
 
 
516
  </div>
517
  </div>
518
  </div>
@@ -539,40 +551,7 @@
539
  <img id="modal-img" class="img-fluid rounded mb-3 d-block mx-auto" alt="Item Image" style="max-height: 200px; object-fit: cover;">
540
  <h5 id="modal-name" class="fw-bold text-center"></h5>
541
  <p id="modal-price" class="text-muted text-center"></p>
542
- <p id="modal-description" class="text-secondary text-center"></p>
543
-
544
- <!-- Ingredients Section -->
545
- <div class="toggle-section">
546
- <div class="toggle-header" onclick="toggleSection('ingredients')">
547
- <h6>Ingredients</h6>
548
- <i class="bi bi-chevron-down toggle-arrow" id="ingredients-arrow"></i>
549
- </div>
550
- <div class="toggle-content" id="modal-ingredients">
551
- <ul class="ingredients-list" id="modal-ingredients-list"></ul>
552
- </div>
553
- </div>
554
-
555
- <!-- Nutritional Info Section -->
556
- <div class="toggle-section">
557
- <div class="toggle-header" onclick="toggleSection('nutritional')">
558
- <h6>Nutritional Info</h6>
559
- <i class="bi bi-chevron-down toggle-arrow" id="nutritional-arrow"></i>
560
- </div>
561
- <div class="toggle-content" id="modal-nutritional">
562
- <div class="nutritional-info" id="modal-nutritional-info"></div>
563
- </div>
564
- </div>
565
-
566
- <!-- Allergens Section -->
567
- <div class="toggle-section">
568
- <div class="toggle-header" onclick="toggleSection('allergens')">
569
- <h6>Allergens</h6>
570
- <i class="bi bi-chevron-down toggle-arrow" id="allergens-arrow"></i>
571
- </div>
572
- <div class="toggle-content" id="modal-allergens">
573
- <ul class="allergens-list" id="modal-allergens-list"></ul>
574
- </div>
575
- </div>
576
 
577
  <div id="first-row">
578
  <h6 id="first-row-title" style="display: none;">Customization Options</h6>
@@ -653,6 +632,12 @@
653
  menuImages.forEach(img => imageObserver.observe(img));
654
  });
655
 
 
 
 
 
 
 
656
  // Debounce Function for Search
657
  function debounce(func, wait) {
658
  let timeout;
@@ -662,24 +647,9 @@
662
  };
663
  }
664
 
665
- // Toggle Section Visibility
666
- function toggleSection(section) {
667
- const content = document.getElementById(`modal-${section}`);
668
- const arrow = document.getElementById(`${section}-arrow`);
669
- if (content.classList.contains('show')) {
670
- content.classList.remove('show');
671
- arrow.classList.remove('up');
672
- arrow.classList.add('down');
673
- } else {
674
- content.classList.add('show');
675
- arrow.classList.remove('down');
676
- arrow.classList.add('up');
677
- }
678
- }
679
-
680
- function showItemDetails(name, price, image, description, section, selectedCategory, ingredients, nutritionalInfo, allergens) {
681
  document.getElementById('modal-name').innerText = name;
682
- document.getElementById('modal-price').innerText = `Starting from $${price}`;
683
  document.getElementById('modal-img').src = image || '/static/placeholder.jpg';
684
  document.getElementById('modal-description').innerText = description || 'No description available.';
685
  document.getElementById('addons-list').innerHTML = 'Loading customization options...';
@@ -691,54 +661,6 @@
691
 
692
  document.getElementById('quantityInput').value = 1;
693
 
694
- // Populate Ingredients
695
- const ingredientsList = document.getElementById('modal-ingredients-list');
696
- ingredientsList.innerHTML = '';
697
- if (ingredients && ingredients.length > 0) {
698
- ingredients.forEach(ingredient => {
699
- const li = document.createElement('li');
700
- li.innerText = ingredient;
701
- ingredientsList.appendChild(li);
702
- });
703
- } else {
704
- ingredientsList.innerHTML = '<li>No ingredients available.</li>';
705
- }
706
-
707
- // Populate Nutritional Info
708
- const nutritionalInfoDiv = document.getElementById('modal-nutritional-info');
709
- nutritionalInfoDiv.innerHTML = '';
710
- if (nutritionalInfo) {
711
- for (const [key, value] of Object.entries(nutritionalInfo)) {
712
- const p = document.createElement('p');
713
- p.innerText = `${key}: ${value}`;
714
- nutritionalInfoDiv.appendChild(p);
715
- }
716
- } else {
717
- nutritionalInfoDiv.innerHTML = '<p>No nutritional info available.</p>';
718
- }
719
-
720
- // Populate Allergens
721
- const allergensList = document.getElementById('modal-allergens-list');
722
- allergensList.innerHTML = '';
723
- if (allergens && allergens.length > 0) {
724
- allergens.forEach(allergen => {
725
- const li = document.createElement('li');
726
- li.innerText = allergen;
727
- allergensList.appendChild(li);
728
- });
729
- } else {
730
- allergensList.innerHTML = '<li>No allergens.</li>';
731
- }
732
-
733
- // Reset toggle sections to hidden
734
- ['ingredients', 'nutritional', 'allergens'].forEach(section => {
735
- const content = document.getElementById(`modal-${section}`);
736
- const arrow = document.getElementById(`${section}-arrow`);
737
- content.classList.remove('show');
738
- arrow.classList.remove('up');
739
- arrow.classList.add('down');
740
- });
741
-
742
  const prepStyleOptions = document.getElementById('prep-style-options');
743
  const typeOptions = document.getElementById('type-options');
744
  const spiceLevelOptions = document.getElementById('spice-level-options');
@@ -957,7 +879,7 @@
957
 
958
  function addToCartFromModal() {
959
  const itemName = document.getElementById('modal-name').innerText;
960
- let itemPrice = parseFloat(document.getElementById('modal-price').innerText.replace('Starting from $', ''));
961
 
962
  if (isNaN(itemPrice)) {
963
  alert('Invalid price for the item. Please check the item details.');
 
9
  <link href="https://cdn.jsdelivr.net/npm/bootstrap-icons/font/bootstrap-icons.css" rel="stylesheet">
10
  <!-- Preload Placeholder Image -->
11
  <link rel="preload" href="/static/placeholder.jpg" as="image">
12
+ <!-- Preload First Few Menu Item Images (Example) -->
13
  {% for section, items in ordered_menu.items() %}
14
  {% for item in items[:2] %}
15
  <link rel="preload" href="{{ item.Image1__c }}" as="image">
 
37
  flex-direction: column;
38
  opacity: 0;
39
  transition: opacity 0.3s ease-in-out;
40
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
41
  }
42
  .menu-card.visible {
43
  opacity: 1;
 
53
  .menu-image.loaded {
54
  opacity: 1;
55
  }
56
+ .card-body {
57
+ padding: 15px;
58
+ }
59
  .card-title {
60
  font-size: 1.2rem;
61
  font-weight: bold;
62
+ margin: 0;
63
+ cursor: pointer;
64
+ color: #333;
65
  }
66
+ .card-description {
67
+ font-size: 0.9rem;
68
  color: #6c757d;
69
+ margin: 5px 0;
70
+ }
71
+ .card-price {
72
+ font-size: 1rem;
73
+ font-weight: bold;
74
+ color: #333;
75
+ margin: 5px 0;
76
  }
77
  .addbutton .btn {
78
+ background-color: #ff6200;
79
  color: white;
80
+ padding: 8px 16px;
81
+ font-size: 14px;
82
  font-weight: bold;
83
  border-radius: 5px;
84
  border: none;
85
  transition: background-color 0.3s ease;
 
86
  }
87
  .addbutton .btn:hover {
88
+ background-color: #e55a00;
89
  }
90
  .customisable-text {
91
  color: #28a745;
 
93
  margin-left: 5px;
94
  margin-top: 1px;
95
  }
96
+ .details-section {
97
+ display: none;
98
+ padding: 10px;
99
+ background-color: #f8f9fa;
100
+ border-top: 1px solid #ddd;
101
+ font-size: 0.9rem;
102
+ color: #333;
103
+ }
104
+ .details-section.show {
105
+ display: block;
106
+ }
107
+ .details-section h6 {
108
+ font-size: 1rem;
109
+ font-weight: bold;
110
+ margin-bottom: 5px;
111
+ }
112
+ .details-section p {
113
+ margin: 3px 0;
114
+ }
115
  .btn-primary {
116
  font-size: 13px;
117
  font-weight: bold;
 
381
  height: 40px;
382
  width: 40px;
383
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
384
  @media (max-width: 576px) {
385
  .modal-dialog {
386
  max-width: 98%;
 
448
  </form>
449
  </div>
450
  {% else %}
451
+ {% set menu_items = [
452
+ {
453
+ "section": "Starters",
454
+ "items": [
455
+ {"Name": "Veg Manchurian", "Description": "Stir-fried vegetables in a tangy soy sauce", "Price__c": 5, "Image1__c": "/static/veg_manchurian.jpg", "Image2__c": "/static/veg_manchurian_large.jpg", "Section__c": "Starters", "Ingredients": "Cauliflower, Onion, Ginger, Garlic, Soy Sauce, Cornflour, Green Chilies, Capsicum, Spring Onion", "Nutritional Info": "Calories: 250 kcal, Protein: 5g, Carbs: 35g, Fats: 12g", "Allergens": "Soy, Gluten"},
456
+ {"Name": "Samosa", "Description": "Crispy pastry filled with spiced potatoes and peas", "Price__c": 3, "Image1__c": "/static/samosa.jpg", "Image2__c": "/static/samosa_large.jpg", "Section__c": "Starters", "Ingredients": "Potatoes, Peas, Onion, Ginger, Cumin Seeds, Garam Masala, Wheat Flour (for dough), Oil (for frying)", "Nutritional Info": "Calories: 150 kcal, Protein: 3g, Carbs: 25g, Fats: 7g", "Allergens": "Gluten"},
457
+ {"Name": "Onion Pakoda", "Description": "Crispy onion fritters with chickpea flour", "Price__c": 4, "Image1__c": "/static/onion_pakoda.jpg", "Image2__c": "/static/onion_pakoda_large.jpg", "Section__c": "Starters", "Ingredients": "Onion, Chickpea Flour (Besan), Rice Flour, Green Chilies, Cumin Seeds, Ginger, Turmeric Powder, Oil (for frying)", "Nutritional Info": "Calories: 200 kcal, Protein: 5g, Carbs: 30g, Fats: 8g", "Allergens": "Gluten (if cross-contamination)"},
458
+ {"Name": "Chilli Gobi", "Description": "Spicy cauliflower stir-fry with Indo-Chinese flavors", "Price__c": 5, "Image1__c": "/static/chilli_gobi.jpg", "Image2__c": "/static/chilli_gobi_large.jpg", "Section__c": "Starters", "Ingredients": "Cauliflower, Onion, Green Chilies, Soy Sauce, Cornflour, Garlic, Ginger, Cumin Powder", "Nutritional Info": "Calories: 250 kcal, Protein: 6g, Carbs: 35g, Fats: 12g", "Allergens": "Soy, Gluten"}
459
+ ]
460
+ },
461
+ {
462
+ "section": "Main Course - Vegetarian",
463
+ "items": [
464
+ {"Name": "Veg Biryani", "Description": "Aromatic basmati rice with mixed vegetables", "Price__c": 8, "Image1__c": "/static/veg_biryani.jpg", "Image2__c": "/static/veg_biryani_large.jpg", "Section__c": "Main Course", "Ingredients": "Basmati Rice, Mixed Vegetables (Carrot, Peas, Potato, Cauliflower), Ginger, Garlic, Biryani Masala, Mint Leaves, Curd, Onion, Ghee", "Nutritional Info": "Calories: 300 kcal, Protein: 6g, Carbs: 50g, Fats: 12g", "Allergens": "Dairy"},
465
+ {"Name": "Paneer Butter Masala", "Description": "Creamy paneer in a rich tomato-butter sauce", "Price__c": 9, "Image1__c": "/static/paneer_butter_masala.jpg", "Image2__c": "/static/paneer_butter_masala_large.jpg", "Section__c": "Main Course", "Ingredients": "Paneer, Butter, Cream, Tomato Puree, Onion, Ginger, Garlic, Garam Masala", "Nutritional Info": "Calories: 400 kcal, Protein: 15g, Carbs: 20g, Fats: 25g", "Allergens": "Dairy"},
466
+ {"Name": "Paneer Biryani", "Description": "Flavorful basmati rice with paneer and vegetables", "Price__c": 9, "Image1__c": "/static/paneer_biryani.jpg", "Image2__c": "/static/paneer_biryani_large.jpg", "Section__c": "Main Course", "Ingredients": "Paneer, Basmati Rice, Mixed Vegetables (Carrot, Peas, Potato), Onion, Tomatoes, Biryani Masala, Mint Leaves, Curd", "Nutritional Info": "Calories: 350 kcal, Protein: 12g, Carbs: 55g, Fats: 15g", "Allergens": "Dairy"},
467
+ {"Name": "Channa Masala", "Description": "Spiced chickpeas in a tangy tomato gravy", "Price__c": 7, "Image1__c": "/static/channa_masala.jpg", "Image2__c": "/static/channa_masala_large.jpg", "Section__c": "Main Course", "Ingredients": "Chickpeas, Onion, Tomatoes, Ginger-Garlic Paste, Garam Masala, Coriander Powder, Cumin Seeds, Lemon Juice", "Nutritional Info": "Calories: 250 kcal, Protein: 10g, Carbs: 45g, Fats: 5g", "Allergens": "None"}
468
+ ]
469
+ },
470
+ {
471
+ "section": "Main Course - Non-Vegetarian",
472
+ "items": [
473
+ {"Name": "Sukka Gosht (Goat)", "Description": "Dry spiced goat curry with aromatic spices", "Price__c": 12, "Image1__c": "/static/sukka_gosht.jpg", "Image2__c": "/static/sukka_gosht_large.jpg", "Section__c": "Main Course", "Ingredients": "Goat Meat, Ginger-Garlic Paste, Green Chilies, Onion, Tomatoes, Garam Masala, Coriander Powder, Cumin Powder, Fresh Coriander", "Nutritional Info": "Calories: 450 kcal, Protein: 35g, Carbs: 10g, Fats: 30g", "Allergens": "None"},
474
+ {"Name": "Prawn Fry", "Description": "Crispy prawns with spicy seasoning", "Price__c": 14, "Image1__c": "/static/prawn_fry.jpg", "Image2__c": "/static/prawn_fry_large.jpg", "Section__c": "Main Course", "Ingredients": "Prawns, Garlic, Ginger, Chili Powder, Coriander Powder, Cumin Powder, Lemon Juice, Oil", "Nutritional Info": "Calories: 350 kcal, Protein: 25g, Carbs: 10g, Fats: 20g", "Allergens": "Shellfish"},
475
+ {"Name": "Mutton Biryani", "Description": "Rich basmati rice with tender mutton", "Price__c": 15, "Image1__c": "/static/mutton_biryani.jpg", "Image2__c": "/static/mutton_biryani_large.jpg", "Section__c": "Main Course", "Ingredients": "Mutton, Basmati Rice, Onion, Tomatoes, Ginger-Garlic Paste, Biryani Masala, Mint Leaves, Yogurt, Ghee", "Nutritional Info": "Calories: 500 kcal, Protein: 30g, Carbs: 50g, Fats: 25g", "Allergens": "Dairy"},
476
+ {"Name": "Fish Curry", "Description": "Tangy fish curry with coconut milk", "Price__c": 13, "Image1__c": "/static/fish_curry.jpg", "Image2__c": "/static/fish_curry_large.jpg", "Section__c": "Main Course", "Ingredients": "Fish (any firm fish like Salmon or King Fish), Onion, Tomato, Ginger-Garlic Paste, Curry Leaves, Coconut Milk, Tamarind, Mustard Seeds", "Nutritional Info": "Calories: 300 kcal, Protein: 25g, Carbs: 10g, Fats: 20g", "Allergens": "Fish"},
477
+ {"Name": "Fiery Mango Glaze Chicken", "Description": "Sweet and spicy chicken with mango glaze", "Price__c": 12, "Image1__c": "/static/fiery_mango_glaze_chicken.jpg", "Image2__c": "/static/fiery_mango_glaze_chicken_large.jpg", "Section__c": "Main Course", "Ingredients": "Chicken, Mango Puree, Chili Sauce, Soy Sauce, Honey, Garlic, Ginger, Lemon Juice", "Nutritional Info": "Calories: 350 kcal, Protein: 30g, Carbs: 15g, Fats: 18g", "Allergens": "Soy"},
478
+ {"Name": "Chilli Chicken", "Description": "Spicy Indo-Chinese chicken with bell peppers", "Price__c": 11, "Image1__c": "/static/chilli_chicken.jpg", "Image2__c": "/static/chilli_chicken_large.jpg", "Section__c": "Main Course", "Ingredients": "Chicken, Bell Pepper, Onion, Green Chilies, Soy Sauce, Cornflour, Garlic, Ginger", "Nutritional Info": "Calories: 400 kcal, Protein: 35g, Carbs: 20g, Fats: 18g", "Allergens": "Soy, Gluten"},
479
+ {"Name": "Chicken Manchurian", "Description": "Indo-Chinese chicken in a thick soy sauce", "Price__c": 11, "Image1__c": "/static/chicken_manchurian.jpg", "Image2__c": "/static/chicken_manchurian_large.jpg", "Section__c": "Main Course", "Ingredients": "Chicken, Onion, Garlic, Ginger, Soy Sauce, Cornflour, Green Chilies, Capsicum", "Nutritional Info": "Calories: 350 kcal, Protein: 25g, Carbs: 20g, Fats: 18g", "Allergens": "Soy, Gluten"},
480
+ {"Name": "Chicken Curry", "Description": "Classic chicken curry with coconut milk", "Price__c": 12, "Image1__c": "/static/chicken_curry.jpg", "Image2__c": "/static/chicken_curry_large.jpg", "Section__c": "Main Course", "Ingredients": "Chicken, Onion, Tomatoes, Ginger-Garlic Paste, Garam Masala, Coconut Milk, Coriander Leaves", "Nutritional Info": "Calories: 400 kcal, Protein: 30g, Carbs: 15g, Fats: 20g", "Allergens": "None"},
481
+ {"Name": "Chicken Biryani", "Description": "Aromatic basmati rice with spiced chicken", "Price__c": 14, "Image1__c": "/static/chicken_biryani.jpg", "Image2__c": "/static/chicken_biryani_large.jpg", "Section__c": "Main Course", "Ingredients": "Chicken, Basmati Rice, Onion, Tomatoes, Ginger-Garlic Paste, Biryani Masala, Mint Leaves, Curd", "Nutritional Info": "Calories: 500 kcal, Protein: 35g, Carbs: 60g, Fats: 20g", "Allergens": "Dairy"}
482
+ ]
483
+ },
484
+ {
485
+ "section": "Breads",
486
+ "items": [
487
+ {"Name": "Roti", "Description": "Soft whole wheat flatbread", "Price__c": 2, "Image1__c": "/static/roti.jpg", "Image2__c": "/static/roti_large.jpg", "Section__c": "Breads", "Ingredients": "Whole Wheat Flour, Water, Salt", "Nutritional Info": "Calories: 150 kcal, Protein: 4g, Carbs: 30g, Fats: 1g", "Allergens": "Gluten"}
488
+ ]
489
+ }
490
+ ] %}
491
+ {% for section in menu_items %}
492
+ <h3>{{ section.section }}</h3>
493
  <div class="row">
494
+ {% for item in section.items %}
495
  <div class="col-md-6 mb-4">
496
  <div class="card menu-card">
497
  <picture>
 
505
  loading="lazy"
506
  onerror="this.src='/static/placeholder.jpg';">
507
  </picture>
508
+ <div class="card-body">
509
+ <h5 class="card-title" onclick="toggleDetails('details-{{ loop.parent.loop.index }}-{{ loop.index }}')">{{ item.Name }}</h5>
510
+ <p class="card-description">{{ item.Description }}</p>
511
+ <div class="d-flex justify-content-between align-items-center">
512
+ <p class="card-price">Starting from ${{ item.Price__c }}</p>
513
+ <div class="addbutton">
514
+ <button class="btn" data-bs-toggle="modal" data-bs-target="#itemModal"
515
+ onclick="showItemDetails('{{ item.Name }}', '{{ item.Price__c }}', '{{ item.Image2__c }}', '{{ item.Description }}', '{{ item.Section__c }}','{{ selected_category }}')">
516
+ Add to Cart
517
+ </button>
 
 
 
 
 
 
 
 
518
  </div>
519
  </div>
520
+ <div class="details-section" id="details-{{ loop.parent.loop.index }}-{{ loop.index }}">
521
+ <h6>Ingredients</h6>
522
+ <p>{{ item.Ingredients }}</p>
523
+ <h6>Nutritional Info</h6>
524
+ <p>{{ item['Nutritional Info'] }}</p>
525
+ <h6>Allergens</h6>
526
+ <p>{{ item.Allergens }}</p>
527
+ </div>
528
  </div>
529
  </div>
530
  </div>
 
551
  <img id="modal-img" class="img-fluid rounded mb-3 d-block mx-auto" alt="Item Image" style="max-height: 200px; object-fit: cover;">
552
  <h5 id="modal-name" class="fw-bold text-center"></h5>
553
  <p id="modal-price" class="text-muted text-center"></p>
554
+ <p id="modal-description" class="text-secondary"></p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
555
 
556
  <div id="first-row">
557
  <h6 id="first-row-title" style="display: none;">Customization Options</h6>
 
632
  menuImages.forEach(img => imageObserver.observe(img));
633
  });
634
 
635
+ // Toggle Details Section
636
+ function toggleDetails(detailsId) {
637
+ const detailsSection = document.getElementById(detailsId);
638
+ detailsSection.classList.toggle('show');
639
+ }
640
+
641
  // Debounce Function for Search
642
  function debounce(func, wait) {
643
  let timeout;
 
647
  };
648
  }
649
 
650
+ function showItemDetails(name, price, image, description, section, selectedCategory) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
651
  document.getElementById('modal-name').innerText = name;
652
+ document.getElementById('modal-price').innerText = `$${price}`;
653
  document.getElementById('modal-img').src = image || '/static/placeholder.jpg';
654
  document.getElementById('modal-description').innerText = description || 'No description available.';
655
  document.getElementById('addons-list').innerHTML = 'Loading customization options...';
 
661
 
662
  document.getElementById('quantityInput').value = 1;
663
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
664
  const prepStyleOptions = document.getElementById('prep-style-options');
665
  const typeOptions = document.getElementById('type-options');
666
  const spiceLevelOptions = document.getElementById('spice-level-options');
 
879
 
880
  function addToCartFromModal() {
881
  const itemName = document.getElementById('modal-name').innerText;
882
+ let itemPrice = parseFloat(document.getElementById('modal-price').innerText.replace('$', ''));
883
 
884
  if (isNaN(itemPrice)) {
885
  alert('Invalid price for the item. Please check the item details.');