DSatishchandra commited on
Commit
bf68e16
·
verified ·
1 Parent(s): 26e37f3

Update templates/menu.html

Browse files
Files changed (1) hide show
  1. templates/menu.html +60 -95
templates/menu.html CHANGED
@@ -598,112 +598,77 @@ form-check-input addon-option{
598
  </div>
599
  </form>
600
 
601
- <!-- Show menu items only when Customized Dish is not selected -->
602
- <div class="container mt-4">
603
- <h1 class="text-center">Menu</h1>
604
-
605
- <!-- Display text boxes for Customized Dish -->
606
- {% if selected_category == "Customized Dish" %}
607
- <div id="custom-dish-form" class="mt-4">
608
- <h3>Create Your Custom Dish</h3>
609
- <form method="POST" action="/customdish/generate_custom_dish">
610
- <div class="mb-3">
611
- <label for="custom-dish-name" class="form-label">Dish Name</label>
612
- <input type="text" class="form-control" id="custom-dish-name" name="name" required>
613
- </div>
614
- <div class="mb-3">
615
- <label for="custom-dish-description" class="form-label">Dish Description</label>
616
- <textarea class="form-control" id="custom-dish-description" name="description" required></textarea>
617
- </div>
618
- <button type="submit" class="btn btn-primary">Submit</button>
619
- </form>
620
- </div>
621
- {% else %}
622
-
623
  <!-- Menu Sections -->
624
  {% for section, items in ordered_menu.items() %}
625
  <h3>{{ section }}</h3>
626
  <div class="row">
627
  {% for item in items %}
628
- <!-- <div class="col-md-6 mb-4">
629
  <div class="card menu-card">
630
- <img src="{{ item.Image1__c }}" class="card-img-top menu-image" alt="{{ item.Name }}" onerror="this.src='/static/placeholder.jpg';" "loading="lazy">
631
- <div class="card-body">
632
- <h5 class="card-title">{{ item.Name }}</h5>
633
- <p class="card-text">${{ item.Price__c }}</p>
634
- <button class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#itemModal"
635
- onclick="showItemDetails('{{ item.Name }}', '{{ item.Price__c }}', '{{ item.Image2__c }}', '{{ item.Description__c }}', '{{ item.Section__c }}','{{ selected_category }}')">
636
- Add
637
- </button>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
638
  </div>
639
  </div>
640
- </div> -->
641
- <div class="col-md-6 mb-4">
642
- <div class="card menu-card">
643
- <img src="{{ item.Image1__c }}" class="card-img-top menu-image" alt="{{ item.Name }}"
644
- onerror="this.src='/static/placeholder.jpg';" loading="lazy">
645
-
646
- <!-- Customize Button on Image -->
647
- <!-- <button class="btn customize-btn"
648
- data-bs-toggle="modal" data-bs-target="#itemModal"
649
- onclick="showItemDetails('{{ item.Name }}', '{{ item.Price__c }}', '{{ item.Image2__c }}', '{{ item.Description__c }}', '{{ item.Section__c }}','{{ selected_category }}')">
650
- Customize <i class="bi bi-caret-right-fill"></i>
651
- </button> -->
652
-
653
- <!-- <div class="card-body">
654
- <h5 class="card-title">{{ item.Name }}</h5>
655
- <p class="card-text">${{ item.Price__c }}</p>
656
- </div> -->
657
- <div class="addbutton">
658
- <div class="card-body d-flex align-items-center justify-content-between">
659
- <div>
660
- <h5 class="card-title">{{ item.Name }}</h5>
661
- <p class="card-text">${{ item.Price__c }}</p>
662
- </div>
663
- <div class= "d-flex flex-column align-item-center justify-content-center">
664
- <!-- <button class="btn btn-primary>ADD</button> -->
665
- {% if item.Section__c == 'Soft Drinks' %}
666
- <!-- Soft Drinks: Direct Add-to-Cart Button -->
667
- <div id="quantity-control-{{ loop.index }}" class="quantity-control" style="display: none;">
668
- <button class="btn btn-outline-secondary btn-sm" onclick="decreaseQuantity('{{ item.Name }}', {{ loop.index }})">−</button>
669
- <span class="quantity mx-2" id="quantity-{{ loop.index }}">1</span>
670
- <button class="btn btn-outline-secondary btn-sm" onclick="increaseQuantity('{{ item.Name }}', {{ loop.index }})">+</button>
671
- </div>
672
- <button class="btn btn-primary" id="add-btn-{{ loop.index }}"
673
- onclick="addSoftDrinkToCart('{{ item.Name }}', '{{ item.Price__c }}', '{{ item.Image1__c }}', '{{ item.Section__c }}', '{{ selected_category }}', {{ loop.index }})">
674
- ADD
675
- </button>
676
-
677
- {% else %}
678
- <!-- Other Items: Modal Button -->
679
- <button class="btn btn btn-primary "
680
- data-bs-toggle="modal" data-bs-target="#itemModal"
681
- onclick="showItemDetails('{{ item.Name }}', '{{ item.Price__c }}', '{{ item.Image2__c }}', '{{ item.Description__c }}', '{{ item.Section__c }}','{{ selected_category }}')">
682
- ADD
683
- </button>
684
- </div>
685
- <div class="w-100 text-center">
686
-
687
-
688
-
689
- {% if item.Section__c != 'Apetizer' and item.Section__c != 'Customized dish' and item.Section__c !='Soft Drinks' %}
690
- <h5 class="customisable-text">Customisable</h5>
691
- {% endif %}
692
- </div>
693
- </div>
694
- </div>
695
- </div>
696
-
697
-
698
- </div>
699
- </div>
700
  {% endfor %}
701
  </div>
702
  {% endfor %}
703
- </div>
704
- {% endif %}
705
-
706
- </div>
707
 
708
  <!-- View Cart Button -->
709
  <div class="view-cart-container">
 
598
  </div>
599
  </form>
600
 
601
+ <!-- Show menu items only when Customized Dish is not selected -->
602
+ <div class="container mt-4">
603
+ <h1 class="text-center">Menu</h1>
604
+
605
+ <!-- Display text boxes for Customized Dish -->
606
+ {% if selected_category == "Customized Dish" %}
607
+ <div id="custom-dish-form" class="mt-4">
608
+ <h3>Create Your Custom Dish</h3>
609
+ <form method="POST" action="/customdish/generate_custom_dish">
610
+ <div class="mb-3">
611
+ <label for="custom-dish-name" class="form-label">Dish Name</label>
612
+ <input type="text" class="form-control" id="custom-dish-name" name="name" required>
613
+ </div>
614
+ <div class="mb-3">
615
+ <label for="custom-dish-description" class="form-label">Dish Description</label>
616
+ <textarea class="form-control" id="custom-dish-description" name="description" required></textarea>
617
+ </div>
618
+ <button type="submit" class="btn btn-primary">Submit</button>
619
+ </form>
620
+ </div>
621
+ {% else %}
 
622
  <!-- Menu Sections -->
623
  {% for section, items in ordered_menu.items() %}
624
  <h3>{{ section }}</h3>
625
  <div class="row">
626
  {% for item in items %}
627
+ <div class="col-md-6 mb-4">
628
  <div class="card menu-card">
629
+ <img src="{{ item.Image1__c }}" class="card-img-top menu-image" alt="{{ item.Name }}"
630
+ onerror="this.src='/static/placeholder.jpg';" loading="lazy">
631
+ <div class="addbutton">
632
+ <div class="card-body d-flex align-items-center justify-content-between">
633
+ <div>
634
+ <h5 class="card-title">{{ item.Name }}</h5>
635
+ <p class="card-text">${{ item.Price__c }}</p>
636
+ </div>
637
+ <div class="d-flex flex-column align-items-center justify-content-center">
638
+ {% if item.Section__c == 'Soft Drinks' %}
639
+ <!-- Soft Drinks: Direct Add-to-Cart Button -->
640
+ <div id="quantity-control-{{ loop.index }}" class="quantity-control" style="display: none;">
641
+ <button class="btn btn-outline-secondary btn-sm" onclick="decreaseQuantity('{{ item.Name }}', {{ loop.index }})">−</button>
642
+ <span class="quantity mx-2" id="quantity-{{ loop.index }}">1</span>
643
+ <button class="btn btn-outline-secondary btn-sm" onclick="increaseQuantity('{{ item.Name }}', {{ loop.index }})">+</button>
644
+ </div>
645
+ <button class="btn btn-primary" id="add-btn-{{ loop.index }}"
646
+ onclick="addSoftDrinkToCart('{{ item.Name }}', '{{ item.Price__c }}', '{{ item.Image1__c }}', '{{ item.Section__c }}', '{{ selected_category }}', {{ loop.index }})">
647
+ ADD
648
+ </button>
649
+ {% else %}
650
+ <!-- Other Items: Modal Button -->
651
+ <button class="btn btn-primary"
652
+ data-bs-toggle="modal" data-bs-target="#itemModal"
653
+ onclick="showItemDetails('{{ item.Name }}', '{{ item.Price__c }}', '{{ item.Image2__c }}', '{{ item.Description__c }}', '{{ item.Section__c }}', '{{ selected_category }}')">
654
+ ADD
655
+ </button>
656
+ <div class="w-100 text-center">
657
+ {% if item.Section__c != 'Apetizer' and item.Section__c != 'Customized dish' and item.Section__c != 'Soft Drinks' %}
658
+ <h5 class="customisable-text">Customisable</h5>
659
+ {% endif %}
660
+ </div>
661
+ {% endif %}
662
+ </div>
663
+ </div>
664
  </div>
665
  </div>
666
+ </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
667
  {% endfor %}
668
  </div>
669
  {% endfor %}
670
+ {% endif %}
671
+ </div>
 
 
672
 
673
  <!-- View Cart Button -->
674
  <div class="view-cart-container">