geethareddy commited on
Commit
beda108
·
verified ·
1 Parent(s): 480cb3f

Update templates/menu.html

Browse files
Files changed (1) hide show
  1. templates/menu.html +205 -38
templates/menu.html CHANGED
@@ -8,6 +8,100 @@
8
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet">
9
  <link href="https://cdn.jsdelivr.net/npm/bootstrap-icons/font/bootstrap-icons.css" rel="stylesheet">
10
  <style>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  body {
12
  font-family: Arial, sans-serif;
13
  background-color: #fdf4e3; /* Updated background color */
@@ -43,6 +137,43 @@
43
  font-size: 1rem;
44
  color: #6c757d;
45
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
  .btn-primary {
47
  font-size: 13px;
48
  font-weight: bold;
@@ -343,7 +474,9 @@ form-check-input addon-option{
343
  align-items: center;
344
  gap: 10px;
345
  }
346
- .modal-footer {
 
 
347
  display: flex;
348
  align-items: center;
349
  justify-content: space-between; /* Space between quantity and Add to Cart button */
@@ -390,7 +523,7 @@ form-check-input addon-option{
390
  width: 40px; /* Adjust input size for smaller screens */
391
  height: 35px;
392
  }
393
- }
394
  </style>
395
  </head>
396
  <body>
@@ -402,8 +535,9 @@ form-check-input addon-option{
402
  <span>{{ first_letter }}</span> <!-- Display the first letter of the customer's name -->
403
  </div>
404
  <div class="dropdown-menu">
405
- <a href="{{ url_for('customer_details') }}" class="dropdown-item">View Profile</a>
406
- <a href="{{ url_for('order_history') }}" class="dropdown-item">Order History</a>
 
407
  <a href="{{ url_for('logout') }}" class="dropdown-item">Logout</a>
408
  </div>
409
  </div>
@@ -441,7 +575,7 @@ form-check-input addon-option{
441
  {% if selected_category == "Customized Dish" %}
442
  <div id="custom-dish-form" class="mt-4">
443
  <h3>Create Your Custom Dish</h3>
444
- <form method="POST" action="/generate_custom_dish">
445
  <div class="mb-3">
446
  <label for="custom-dish-name" class="form-label">Dish Name</label>
447
  <input type="text" class="form-control" id="custom-dish-name" name="name" required>
@@ -460,9 +594,9 @@ form-check-input addon-option{
460
  <h3>{{ section }}</h3>
461
  <div class="row">
462
  {% for item in items %}
463
- <div class="col-md-6 mb-4">
464
  <div class="card menu-card">
465
- <img src="{{ item.Image1__c }}" class="card-img-top menu-image" alt="{{ item.Name }}" onerror="this.src='/static/placeholder.jpg';">
466
  <div class="card-body">
467
  <h5 class="card-title">{{ item.Name }}</h5>
468
  <p class="card-text">${{ item.Price__c }}</p>
@@ -472,7 +606,61 @@ form-check-input addon-option{
472
  </button>
473
  </div>
474
  </div>
475
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
476
  {% endfor %}
477
  </div>
478
  {% endfor %}
@@ -483,13 +671,13 @@ form-check-input addon-option{
483
 
484
  <!-- View Cart Button -->
485
  <div class="view-cart-container">
486
- <a href="/cart" class="view-cart-button">
487
  View Cart
488
  </a>
489
  </div>
490
 
491
- <!-- Modal for Item Details -->
492
- <div class="modal fade" id="itemModal" tabindex="-1" aria-labelledby="itemModalLabel" aria-hidden="true">
493
  <div class="modal-dialog modal-dialog-centered">
494
  <div class="modal-content">
495
  <div class="modal-header">
@@ -529,7 +717,9 @@ form-check-input addon-option{
529
  </div>
530
  </div>
531
  </div>
532
- </div>
 
 
533
 
534
  <!-- JavaScript -->
535
  <script>
@@ -606,7 +796,7 @@ form-check-input addon-option{
606
  // Handle checkbox selection logic
607
  function handleAddonClick(checkbox) {
608
  const groupName = checkbox.getAttribute('data-group');
609
- const isMultiSelectGroup = ["Extra Toppings", "Choose Raita/Sides","Select Dip/Sauce","Extra Add-ons","Make it a Combo"].includes(groupName);
610
 
611
  // If it's not multi-select, uncheck all other checkboxes in the same group
612
  if (!isMultiSelectGroup) {
@@ -773,34 +963,11 @@ document.addEventListener('DOMContentLoaded', function () {
773
  });
774
  });
775
 
776
- // Function to round reward points to a single digit
777
- function roundRewardPoints() {
778
- // Get the reward points element
779
- let rewardPointsElement = document.getElementById('reward-points');
780
-
781
- // Check if the element exists in the DOM
782
- if (rewardPointsElement) {
783
- let rewardPointsText = rewardPointsElement.innerText.trim(); // Get and trim the value to remove any extra spaces
784
-
785
- // Check if the innerText is a valid number
786
- let rewardPoints = parseFloat(rewardPointsText);
787
-
788
- // If it's a valid number, round it to 1 decimal place
789
- if (!isNaN(rewardPoints)) {
790
- rewardPointsElement.innerText = rewardPoints.toFixed(1); // Round to 1 decimal place
791
- } else {
792
- console.error("Reward points value is not a valid number:", rewardPointsText);
793
- }
794
- } else {
795
- console.error("Reward points element is missing.");
796
- }
797
- }
798
- // Run the function when the page loads
799
- window.onload = roundRewardPoints;
800
 
801
  </script>
802
 
803
  <!-- Bootstrap JS -->
804
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"></script>
805
  </body>
806
- </html>
 
8
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet">
9
  <link href="https://cdn.jsdelivr.net/npm/bootstrap-icons/font/bootstrap-icons.css" rel="stylesheet">
10
  <style>
11
+
12
+ .addbutton .btn {
13
+ background-color: #28a745; /* Green background color */
14
+ color: white; /* White text color */
15
+ padding: 10px 20px; /* Add padding to the button */
16
+ font-size: 16px; /* Increase font size */
17
+ font-weight: bold; /* Make text bold */
18
+ border-radius: 5px; /* Rounded corners */
19
+ border: none; /* Remove border */
20
+ transition: background-color 0.3s ease; /* Smooth transition for hover effect */
21
+ margin-left: 13px; /* Margin for positioning */
22
+ }
23
+
24
+ .addbutton .btn:hover {
25
+ background-color: #218838; /* Darker green background on hover */
26
+ }
27
+
28
+ .customisable-text {
29
+ color: #28a745; /* Same color as the "ADD" button */
30
+ font-size: 12px; /* Same font size as the "ADD" button */
31
+ margin-left: 5px;
32
+ margin-top:1px;
33
+ }
34
+
35
+ /* model */
36
+ .modal-footer {
37
+ display: flex;
38
+ align-items: center;
39
+ justify-content: space-between; /* Space between quantity controls and Add to Cart button */
40
+ padding: 10px;
41
+ }
42
+ .modal-footer .d-flex {
43
+ display: flex;
44
+ align-items: center;
45
+ gap: 10px; /* Space between quantity buttons */
46
+ }
47
+ .modal-footer .btn {
48
+ height: 40px; /* Set consistent button height */
49
+ padding: 0 15px; /* Adjust padding to fit inside the buttons */
50
+ }
51
+ .modal-footer .form-control {
52
+ width: 50px; /* Fixed width for quantity input */
53
+ height: 40px; /* Match the height of buttons */
54
+ text-align: center; /* Center the value inside the input */
55
+ }
56
+ .modal-footer .btn-primary {
57
+ background-color: #0FAA39; /* Green background for Add to Cart button */
58
+ border-color: #0FAA39; /* Border color to match button background */
59
+ font-weight: bold; /* Bold text */
60
+ padding: 10px 20px; /* Adjust padding to make the button look better */
61
+ height: 40px; /* Match the height with quantity buttons */
62
+ display: flex;
63
+ justify-content: center;
64
+ align-items: center;
65
+ width: auto; /* Auto width to adjust to button text */
66
+ border-radius: 5px; /* Rounded corners for the button */
67
+ }
68
+ .modal-footer .btn-outline-secondary {
69
+ height: 40px; /* Ensure quantity buttons are the same size */
70
+ width: 40px; /* Make sure the buttons are square */
71
+ border-radius: 5px; /* Rounded corners for the buttons */
72
+ }
73
+
74
+ @media (max-width: 576px) {
75
+ /* Responsive adjustments for smaller screens */
76
+ .modal-dialog {
77
+ max-width: 98%; /* Adjust modal width for smaller screens */
78
+ }
79
+
80
+ .modal-footer .btn {
81
+ height: 35px; /* Smaller buttons for small screens */
82
+ padding: 0 12px; /* Adjust padding to make the button look proportional */
83
+ }
84
+
85
+ .modal-footer .form-control {
86
+ width: 40px; /* Adjust input size for smaller screens */
87
+ height: 35px;
88
+ }
89
+
90
+ .modal-footer .d-flex {
91
+ gap: 8px; /* Reduce space between quantity buttons on smaller screens */
92
+ }
93
+ } */
94
+
95
+
96
+
97
+
98
+
99
+
100
+
101
+
102
+
103
+
104
+
105
  body {
106
  font-family: Arial, sans-serif;
107
  background-color: #fdf4e3; /* Updated background color */
 
137
  font-size: 1rem;
138
  color: #6c757d;
139
  }
140
+
141
+
142
+ .customize-btn {
143
+ position: absolute;
144
+ top: 50%;
145
+ right: 0;
146
+ transform: translateY(-50%);
147
+ z-index: 2;
148
+ background: linear-gradient(92.29deg, rgba(63, 63, 63, 0.7) 4.75%, rgba(0, 0, 0, 0.7) 93.57%);
149
+ color: #fff;
150
+ border: none;
151
+ padding: 4px 12px; /* Reduced padding for smaller height */
152
+ border-radius: 5px 0px 0px 5px ;
153
+ display: flex;
154
+ align-items: center;
155
+ font-size: 12px; /* Slightly smaller text */
156
+ }
157
+
158
+ .customize-btn i {
159
+ margin-left: 5px; /* Icon spacing */
160
+ }
161
+
162
+ /* .customize-btn:hover {
163
+ background-color: #e08c00; /* Darker shade for hover effect */
164
+ transition: background-color 0.3s ease;
165
+ } *
166
+
167
+
168
+
169
+
170
+
171
+
172
+
173
+
174
+
175
+
176
+
177
  .btn-primary {
178
  font-size: 13px;
179
  font-weight: bold;
 
474
  align-items: center;
475
  gap: 10px;
476
  }
477
+
478
+ /* modal################## */
479
+ .modal-footer {
480
  display: flex;
481
  align-items: center;
482
  justify-content: space-between; /* Space between quantity and Add to Cart button */
 
523
  width: 40px; /* Adjust input size for smaller screens */
524
  height: 35px;
525
  }
526
+ }
527
  </style>
528
  </head>
529
  <body>
 
535
  <span>{{ first_letter }}</span> <!-- Display the first letter of the customer's name -->
536
  </div>
537
  <div class="dropdown-menu">
538
+ <a href="{{ url_for('user_details.customer_details') }}" class="dropdown-item">View Profile</a>
539
+
540
+ <a href="{{ url_for('orderhistory.order_history') }}" class="dropdown-item">Order History</a>
541
  <a href="{{ url_for('logout') }}" class="dropdown-item">Logout</a>
542
  </div>
543
  </div>
 
575
  {% if selected_category == "Customized Dish" %}
576
  <div id="custom-dish-form" class="mt-4">
577
  <h3>Create Your Custom Dish</h3>
578
+ <form method="POST" action="/customdish/generate_custom_dish">
579
  <div class="mb-3">
580
  <label for="custom-dish-name" class="form-label">Dish Name</label>
581
  <input type="text" class="form-control" id="custom-dish-name" name="name" required>
 
594
  <h3>{{ section }}</h3>
595
  <div class="row">
596
  {% for item in items %}
597
+ <!-- <div class="col-md-6 mb-4">
598
  <div class="card menu-card">
599
+ <img src="{{ item.Image1__c }}" class="card-img-top menu-image" alt="{{ item.Name }}" onerror="this.src='/static/placeholder.jpg';" "loading="lazy">
600
  <div class="card-body">
601
  <h5 class="card-title">{{ item.Name }}</h5>
602
  <p class="card-text">${{ item.Price__c }}</p>
 
606
  </button>
607
  </div>
608
  </div>
609
+ </div> -->
610
+ <div class="col-md-6 mb-4">
611
+ <div class="card menu-card">
612
+ <img src="{{ item.Image1__c }}" class="card-img-top menu-image" alt="{{ item.Name }}"
613
+ onerror="this.src='/static/placeholder.jpg';" loading="lazy">
614
+
615
+ <!-- Customize Button on Image -->
616
+ <!-- <button class="btn customize-btn"
617
+ data-bs-toggle="modal" data-bs-target="#itemModal"
618
+ onclick="showItemDetails('{{ item.Name }}', '{{ item.Price__c }}', '{{ item.Image2__c }}', '{{ item.Description__c }}', '{{ item.Section__c }}','{{ selected_category }}')">
619
+ Customize <i class="bi bi-caret-right-fill"></i>
620
+ </button> -->
621
+
622
+ <!-- <div class="card-body">
623
+ <h5 class="card-title">{{ item.Name }}</h5>
624
+ <p class="card-text">${{ item.Price__c }}</p>
625
+ </div> -->
626
+ <div class="addbutton">
627
+ <div class="card-body d-flex align-items-center justify-content-between">
628
+ <div>
629
+ <h5 class="card-title">{{ item.Name }}</h5>
630
+ <p class="card-text">${{ item.Price__c }}</p>
631
+ </div>
632
+ <div class= "d-flex flex-column align-item-center justify-content-center">
633
+ <!-- <button class="btn btn-primary>ADD</button> -->
634
+
635
+ <div >
636
+ <button class="btn btn btn-primary "
637
+ data-bs-toggle="modal" data-bs-target="#itemModal"
638
+ onclick="showItemDetails('{{ item.Name }}', '{{ item.Price__c }}', '{{ item.Image2__c }}', '{{ item.Description__c }}', '{{ item.Section__c }}','{{ selected_category }}')">
639
+ ADD
640
+ </button>
641
+ </div>
642
+ <div class="w-100 text-center">
643
+
644
+
645
+
646
+ {% if item.Section__c != 'Apetizer' and item.Section__c != 'Customized dish' and item.Section__c != 'Soft Drinks' %}
647
+ <h5 class="customisable-text">Customisable</h5>
648
+ {% endif %}
649
+ </div>
650
+
651
+
652
+
653
+ </div>
654
+
655
+
656
+
657
+
658
+ </div>
659
+ </div>
660
+
661
+
662
+ </div>
663
+ </div>
664
  {% endfor %}
665
  </div>
666
  {% endfor %}
 
671
 
672
  <!-- View Cart Button -->
673
  <div class="view-cart-container">
674
+ <a href="{{ url_for('cart.cart') }}" class="view-cart-button">
675
  View Cart
676
  </a>
677
  </div>
678
 
679
+ <!-- Modal for Item Details -->
680
+ <div class="modal fade" id="itemModal" tabindex="-1" aria-labelledby="itemModalLabel" aria-hidden="true">
681
  <div class="modal-dialog modal-dialog-centered">
682
  <div class="modal-content">
683
  <div class="modal-header">
 
717
  </div>
718
  </div>
719
  </div>
720
+ </div>
721
+
722
+
723
 
724
  <!-- JavaScript -->
725
  <script>
 
796
  // Handle checkbox selection logic
797
  function handleAddonClick(checkbox) {
798
  const groupName = checkbox.getAttribute('data-group');
799
+ const isMultiSelectGroup = ["Extra Toppings", "Choose Raita/Sides","Select Dip/Sauce","Extra Add-ons","Make it a Combo","Beverages","Sauces"].includes(groupName);
800
 
801
  // If it's not multi-select, uncheck all other checkboxes in the same group
802
  if (!isMultiSelectGroup) {
 
963
  });
964
  });
965
 
966
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
967
 
968
  </script>
969
 
970
  <!-- Bootstrap JS -->
971
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"></script>
972
  </body>
973
+ </html>