geethareddy commited on
Commit
79b0032
·
verified ·
1 Parent(s): 63c427c

Update templates/menu.html

Browse files
Files changed (1) hide show
  1. templates/menu.html +316 -940
templates/menu.html CHANGED
@@ -7,676 +7,168 @@
7
  <!-- Bootstrap CSS -->
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
-
13
- /* subbu */
14
- .addbutton .btn {
15
- background-color: #28a745; /* Green background color */
16
- color: white; /* White text color */
17
- padding: 10px 20px; /* Add padding to the button */
18
- font-size: 16px; /* Increase font size */
19
- font-weight: bold; /* Make text bold */
20
- border-radius: 5px; /* Rounded corners */
21
- border: none; /* Remove border */
22
- transition: background-color 0.3s ease; /* Smooth transition for hover effect */
23
- margin-left: 13px; /* Margin for positioning */
24
- }
25
-
26
- .addbutton .btn:hover {
27
- background-color: #218838; /* Darker green background on hover */
28
- }
29
-
30
- .customisable-text {
31
- color: #28a745; /* Same color as the "ADD" button */
32
- font-size: 12px; /* Same font size as the "ADD" button */
33
- margin-left: 5px;
34
- margin-top:1px;
35
- }
36
-
37
- /* model */
38
- /* .modal-footer {
39
- display: flex;
40
- align-items: center;
41
- justify-content: space-between; /* Space between quantity controls and Add to Cart button */
42
- padding: 10px;
43
- }
44
-
45
- .modal-footer .d-flex {
46
- display: flex;
47
- align-items: center;
48
- gap: 10px; /* Space between quantity buttons */
49
- }
50
-
51
- .modal-footer .btn {
52
- height: 40px; /* Set consistent button height */
53
- padding: 0 15px; /* Adjust padding to fit inside the buttons */
54
- }
55
-
56
- .modal-footer .form-control {
57
- width: 50px; /* Fixed width for quantity input */
58
- height: 40px; /* Match the height of buttons */
59
- text-align: center; /* Center the value inside the input */
60
- }
61
-
62
- .modal-footer .btn-primary {
63
- background-color: #0FAA39; /* Green background for Add to Cart button */
64
- border-color: #0FAA39; /* Border color to match button background */
65
- font-weight: bold; /* Bold text */
66
- padding: 10px 20px; /* Adjust padding to make the button look better */
67
- height: 40px; /* Match the height with quantity buttons */
68
- display: flex;
69
- justify-content: center;
70
- align-items: center;
71
- width: auto; /* Auto width to adjust to button text */
72
- border-radius: 5px; /* Rounded corners for the button */
73
- }
74
-
75
- .modal-footer .btn-outline-secondary {
76
- height: 40px; /* Ensure quantity buttons are the same size */
77
- width: 40px; /* Make sure the buttons are square */
78
- border-radius: 5px; /* Rounded corners for the buttons */
79
- }
80
-
81
- @media (max-width: 576px) {
82
- /* Responsive adjustments for smaller screens */
83
- .modal-dialog {
84
- max-width: 98%; /* Adjust modal width for smaller screens */
85
- }
86
-
87
- .modal-footer .btn {
88
- height: 35px; /* Smaller buttons for small screens */
89
- padding: 0 12px; /* Adjust padding to make the button look proportional */
90
- }
91
-
92
- .modal-footer .form-control {
93
- width: 40px; /* Adjust input size for smaller screens */
94
- height: 35px;
95
- }
96
-
97
- .modal-footer .d-flex {
98
- gap: 8px; /* Reduce space between quantity buttons on smaller screens */
99
- }
100
- } */
101
-
102
-
103
-
104
-
105
-
106
-
107
-
108
-
109
-
110
-
111
-
112
- body {
113
- font-family: Arial, sans-serif;
114
- background-color: #fdf4e3; /* Updated background color */
115
- margin: 0;
116
- padding: 0;
117
- display: flex;
118
- flex-direction: column;
119
- }
120
- .container {
121
- max-width: 900px;
122
- }
123
- .menu-card {
124
- max-width: 350px;
125
- border-radius: 15px;
126
- overflow: hidden;
127
- background-color: #fff;
128
- margin: auto;
129
- display: flex;
130
- flex-direction: column;
131
- }
132
- .menu-image {
133
- height: 200px; /* Fixed height */
134
- width: 100%; /* Full width of the card */
135
- object-fit: fill; /* Ensure the image covers the area and maintains the aspect ratio */
136
- border-radius: 15px 15px 0 0; /* Rounded top corners */
137
- }
138
- .card-title {
139
- font-size: 1.2rem;
140
- font-weight: bold;
141
- margin: 10px 0;
142
- }
143
- .card-text {
144
- font-size: 1rem;
145
- color: #6c757d;
146
- }
147
-
148
-
149
- .customize-btn {
150
- position: absolute;
151
- top: 50%;
152
- right: 0;
153
- transform: translateY(-50%);
154
- z-index: 2;
155
- background: linear-gradient(92.29deg, rgba(63, 63, 63, 0.7) 4.75%, rgba(0, 0, 0, 0.7) 93.57%);
156
- color: #fff;
157
- border: none;
158
- padding: 4px 12px; /* Reduced padding for smaller height */
159
- border-radius: 5px 0px 0px 5px ;
160
- display: flex;
161
- align-items: center;
162
- font-size: 12px; /* Slightly smaller text */
163
- }
164
-
165
- .customize-btn i {
166
- margin-left: 5px; /* Icon spacing */
167
- }
168
-
169
- /* .customize-btn:hover {
170
- background-color: #e08c00; /* Darker shade for hover effect */
171
- transition: background-color 0.3s ease;
172
- } *
173
-
174
-
175
-
176
-
177
-
178
-
179
-
180
-
181
-
182
-
183
-
184
- .btn-primary {
185
- font-size: 13px;
186
- font-weight: bold;
187
- border-radius: 5px;
188
- width: 100px;
189
- background-color: #0FAA39; /* Updated button background color */
190
- border-color: #0FAA39;
191
- }
192
- .btn-primary:hover {
193
- background-color: #0FAA39;
194
- border-color: #0FAA39;
195
- }
196
- .btn-primary:active,
197
- .btn-primary:focus {
198
- background-color: #0FAA39;
199
- border-color: #ffffff;
200
- box-shadow: none;
201
- }
202
- .view-cart-container {
203
- position: fixed;
204
- bottom: 20px;
205
- right: 20px;
206
- z-index: 999;
207
- }
208
- .view-cart-button {
209
- background-color: #0FAA39; /* Updated View Cart button background color */
210
- color: #fff;
211
- padding: 10px 20px;
212
- border-radius: 30px;
213
- font-size: 1rem;
214
- font-weight: bold;
215
- text-decoration: none;
216
- box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
217
- display: flex;
218
- align-items: center;
219
- justify-content: center;
220
- }
221
- .view-cart-button:hover {
222
- background-color: #109835; /* Slightly darker shade for hover effect */
223
- text-decoration: none;
224
- }
225
- .avatar-dropdown-container {
226
- position: relative;
227
- }
228
- .avatar-icon {
229
- width: 40px;
230
- height: 40px;
231
- border-radius: 50%;
232
- background-color: #5bbfc1;
233
- cursor: pointer;
234
- display: flex;
235
- align-items: center;
236
- justify-content: center;
237
- color: white;
238
- font-size: 20px;
239
- font-weight: bold;
240
- }
241
- .dropdown-menu {
242
- position: absolute;
243
- right: 0;
244
- top: 100%;
245
- background-color: #fff;
246
- border-radius: 5px;
247
- width: 200px; /* Adjust width as needed */
248
- box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
249
- display: none;
250
- }
251
- .avatar-dropdown-container:hover .dropdown-menu {
252
- display: block;
253
- }
254
- .avatar-dropdown-container {
255
- position: absolute;
256
- right: 20px; /* Adjust the value as needed to position it properly */
257
- top: 50%; /* Adjust top to place it within the header */
258
- transform: translateY(-50%); /* Correct the alignment to be perfectly centered */
259
- display: flex;
260
- align-items: right;
261
- justify-content: center;
262
- }
263
-
264
- .dropdown-menu .dropdown-item {
265
- padding: 10px 15px;
266
- text-decoration: none;
267
- color: #333;
268
- border-bottom: 1px solid #ddd;
269
- display: block; /* Make each item stack vertically */
270
- }
271
- .dropdown-menu .dropdown-item:last-child {
272
- border-bottom: none; /* Remove the bottom border from the last item */
273
- }
274
- .dropdown-menu .dropdown-item:hover {
275
- background-color: #f1f1f1;
276
- }
277
- .fixed-search-container {
278
- position: absolute;
279
- top: 90px; /* Move it slightly lower */
280
- left: 50%;
281
- transform: translateX(-50%);
282
- width: 80%;
283
- max-width: 600px;
284
- z-index: 999; /* Keep it above content */
285
- background-color: white;
286
- padding: 10px;
287
- border-radius: 25px;
288
- box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
289
- }
290
- /* Ensure the category filter dropdown does not overlap */
291
- form.text-center.mb-4 {
292
- margin-top: 10px; /* No margin at the top */
293
- margin-bottom: 0px; /* Small space at the bottom */
294
- }
295
- /* Ensure the container has enough margin so nothing is overlapped */
296
- .container {
297
- margin-top: 10px; /* Adjust spacing based on navbar and search bar */
298
- padding-top: 0 !important; /* Ensure no padding is added by default */
299
- }
300
- h1.text-center {
301
- margin-top: 10px; /* Reduced space above */
302
- padding-top: 0 !important; /* Removed padding */
303
- font-weight: semi-bold; /* Make the "Menu" text bold */
304
- }
305
- .fixed-top-bar {
306
- /* Remove the fixed positioning */
307
- position: relative; /* Change from fixed to relative */
308
- top: 0;
309
- left: 0;
310
- width: 100%;
311
- height: 54px;
312
- /* background-color: #FF6B35; */
313
- background: linear-gradient(45deg, #FFA07A, #FFB347);
314
- color: white;
315
- padding: 15px;
316
- display: flex;
317
- justify-content: space-between;
318
- align-items: center; /* Vertically align items */
319
- z-index: 1000; /* Make sure it's still above other content */
320
- }
321
- .search-bar-container {
322
- padding: 10px;
323
- position: absolute;
324
- left: 20px;
325
- top: 50%;
326
- transform: translateY(-50%);
327
- display: flex;
328
- justify-content: flex-start;
329
- align-items: center;
330
- width: 300px; /* Adjust width as needed */
331
- }
332
- .search-bar-container input {
333
- width: 85%;
334
- padding: 8px 10px 8px 30px; /* Add padding for the icon */
335
- font-size: 16px;
336
- border-radius: 10px;
337
- border: none;
338
- }
339
- .search-icon {
340
- position: absolute;
341
- left: 15px; /* Position the icon inside the input box */
342
- font-size: 20px;
343
- color: #888; /* Icon color */
344
- }
345
- /* Style for customization sections */
346
- .addon-section {
347
- background-color: #fff; /* Light gray background */
348
- border: 2px solid #6c757d; /* Border color */
349
- border-radius: 8px;
350
- padding: 12px;
351
- margin-bottom: 10px; /* Spacing between sections */
352
- }
353
- /* Customization section title */
354
- .addon-section h6 {
355
- margin-bottom: 10px;
356
- font-size: 1.1rem;
357
- font-weight: bold;
358
- color: #343a40; /* Darker title text */
359
- }
360
- /* Style for add-on checkboxes */
361
- .addon-section .form-check {
362
- display: inline-flex; /* Display checkboxes horizontally */
363
- align-items: center; /* Align checkboxes and labels */
364
- margin-left: 10px; /* Space between checkboxes */
365
- color: #343a40; /* Darker text color */
366
- }
367
- /* Customize the default checkbox */
368
- .addon-section .form-check-input {
369
- -webkit-appearance: none; /* Remove default checkbox styling in Webkit browsers (e.g. Chrome, Safari) */
370
- -moz-appearance: none; /* Remove default checkbox styling in Firefox */
371
- appearance: none; /* Remove default checkbox styling in all browsers */
372
- width: 20px;
373
- height: 20px;
374
- border: 2px solid #343a40; /* Darker border color */
375
- border-radius: 5px; /* Rounded corners */
376
- background-color: #f0f0f0; /* Lighter gray background when unchecked */
377
- position: relative;
378
- margin-right: 10px; /* Add space between the checkbox and label */
379
- }
380
-
381
- /* Checked state for the custom checkbox */
382
- .addon-section .form-check-input:checked {
383
- background-color: #006400; /* Dark green background when checked */
384
- border-color: #006400; /* Dark green border when checked */
385
- }
386
- /* Add the check mark when checkbox is checked */
387
- .addon-section .form-check-input:checked::before {
388
- content: ''; /* Unicode check mark */
389
- font-size: 14px;
390
- position: absolute;
391
- top: 3px;
392
- left: 4px;
393
- color: white; /* White color for the check mark */
394
- }
395
- /* Hover effect for the checkboxes */
396
- .addon-section .form-check-input:hover {
397
- /* background-color: #006400; /* Slightly darker background on hover */
398
- }
399
- /* Focus effect on custom checkbox */
400
- .addon-section .form-check-input:focus {
401
- outline: none;
402
- box-shadow: 0 0 0 2px #006400; /* Green focus outline */
403
- }
404
- /* Custom checkbox label styles */
405
- .addon-section .form-check-label {
406
- font-size: 16px;
407
- margin-left: 5px;
408
- cursor: pointer;
409
- display: inline-block; /* Ensure label aligns correctly with checkbox */
410
- vertical-align: middle; /* Align text vertically with the checkbox */
411
- }
412
- /* Fix alignment of text and checkbox */
413
- .addon-section .form-check input[type="checkbox"],
414
- .addon-section .form-check label {
415
- display: inline-block;
416
- /* vertical-align: middle; /* Align text and checkboxes vertically */
417
- }
418
- /* Category Filter with Custom Radio Buttons */
419
- form.text-center.mb-4 {
420
- display: flex;
421
- flex-direction: column;
422
- align-items: center;
423
- justify-content: center;
424
- margin-bottom: 5px; /* Reduce bottom margin */
425
- }
426
- .form-check {
427
- display: inline-block;
428
- margin-right: 5px; /* Reduced space between radio button and label */
429
- margin-bottom: 0; /* Remove bottom margin */
430
- margin-top: 10px; /* Adds space between categories and Customized Dish */
431
- vertical-align: middle; /* Align radio buttons vertically */
432
- }
433
- .form-check-inline {
434
- display: inline-block;
435
- margin-right: 5px; /* Decrease space between each radio button */
436
- }
437
- .form-check-label {
438
- display: inline-block;
439
- font-size: 16px;
440
- margin-left: 5px; /* Spacing between radio button and label */
441
- vertical-align: middle; /* Align label vertically */
442
- }
443
- form-check-input addon-option{
444
- color: #333d47;
445
- }
446
- .custom-radio {
447
- appearance: none;
448
- -webkit-appearance: none;
449
- -moz-appearance: none;
450
- width: 20px;
451
- height: 20px;
452
- border: 3px solid #4CAF50; /* Green border */
453
- border-radius: 50%;
454
- margin-right: -5px; /* Reduced spacing between button and label */
455
- outline: none;
456
- cursor: pointer;
457
- position: relative;
458
- display: inline-block;
459
- vertical-align: middle; /* Align vertically with text */
460
- }
461
- .custom-radio:checked {
462
- background-color: #4CAF50; /* Green color when checked */
463
- border-color: #4CAF50; /* Matching border color */
464
- }
465
- .custom-radio:checked::after {
466
- content: '';
467
- position: relative;
468
- top: 5px;
469
- left: 5px;
470
- border-radius: 50%;
471
- }
472
- .custom-radio:hover {
473
- border-color: #388E3C;
474
- }
475
- /* Optional: Style the labels */
476
- .form-check-label {
477
- font-size: 16px;
478
- margin-left: 8px; /* Space between the radio button and the label */
479
- }
480
- .cart-container {
481
- display: flex;
482
- align-items: center;
483
- gap: 10px;
484
- }
485
-
486
- /* modal################## */
487
- .modal-footer {
488
- display: flex;
489
- align-items: center;
490
- justify-content: space-between; /* Space between quantity and Add to Cart button */
491
- padding: 10px;
492
- }
493
- .modal-footer .d-flex {
494
- display: flex;
495
- align-items: center;
496
- gap: 10px; /* Space between quantity buttons */
497
- }
498
- .modal-footer .btn {
499
- height: 40px; /* Set consistent button height */
500
- padding: 0 15px; /* Adjust padding to fit inside the buttons */
501
- }
502
- .modal-footer .form-control {
503
- width: 50px; /* Fixed width for quantity input */
504
- height: 40px; /* Match the height of buttons */
505
- text-align: center; /* Center the value inside the input */
506
- }
507
- .modal-footer .btn-primary {
508
- background-color: #0FAA39; /* Green background for Add to Cart button */
509
- border-color: #0FAA39; /* Border color to match button background */
510
- font-weight: bold; /* Bold text */
511
- padding: 10px 20px; /* Adjust padding to make the button look better */
512
- height: 40px; /* Match the height with quantity buttons */
513
- display: flex;
514
- justify-content: center;
515
- align-items: center;
516
- width: auto; /* Auto width to adjust to button text */
517
- }
518
- .modal-footer .btn-outline-secondary {
519
- height: 40px; /* Ensure quantity buttons are the same size */
520
- width: 40px; /* Make sure the buttons are square */
521
- }
522
- @media (max-width: 576px) {
523
- /* Responsive adjustments for smaller screens */
524
- .modal-dialog {
525
- max-width: 98%; /* Adjust modal width for smaller screens */
526
- }
527
- .modal-footer .btn {
528
- height: 35px; /* Smaller buttons for small screens */
529
- }
530
- .modal-footer .form-control {
531
- width: 40px; /* Adjust input size for smaller screens */
532
- height: 35px;
533
- }
534
- }
535
- </style>
536
- </head>
537
- <body>
538
 
539
- <div class="fixed-top-bar">
540
- <!-- Avatar and Dropdown -->
541
- <div class="avatar-dropdown-container">
542
- <div class="avatar-icon">
543
- <span>{{ first_letter }}</span> <!-- Display the first letter of the customer's name -->
544
- </div>
545
- <div class="dropdown-menu">
546
- <a href="{{ url_for('user_details.customer_details') }}" class="dropdown-item">View Profile</a>
547
 
548
- <a href="{{ url_for('orderhistory.order_history') }}" class="dropdown-item">Order History</a>
549
- <a href="{{ url_for('logout') }}" class="dropdown-item">Logout</a>
550
- </div>
551
- </div>
552
-
 
553
 
 
 
 
 
 
 
554
 
555
- <!-- Search Bar Section -->
556
- <div class="search-bar-container">
557
- <input type="text" id="searchBar" class="form-control" placeholder="Search items or sections..." onkeyup="filterMenu()">
558
- <i class="bi bi-search search-icon"></i> <!-- Search icon inside the input -->
559
- </div>
560
- </div>
561
-
562
- <!-- Category Filter with Custom Radio Buttons -->
563
- <form method="get" action="/menu" class="text-center mb-4">
564
- <label class="form-label fw-bold">Select a Category:</label>
565
- <div class="form-check form-check-inline">
566
- {% for category in categories %}
567
- <input type="radio" id="category-{{ category }}" name="category" value="{{ category }}" class="custom-radio"
568
- {% if selected_category == category %}checked{% endif %} onchange="this.form.submit()">
569
- <label class="form-check-label" for="category-{{ category }}">{{ category }}</label>
570
- {% endfor %}
571
- </div>
572
- <!-- Separate Customized Dish radio button in a new div to align it properly -->
573
- <div class="form-check">
574
- <input type="radio" id="category-CustomizedDish" name="category" value="Customized Dish" class="custom-radio"
575
- {% if selected_category == "Customized Dish" %}checked{% endif %} onchange="this.form.submit()">
576
- <label class="form-check-label" for="category-CustomizedDish">Customized Dish</label>
577
- </div>
578
- </form>
579
-
580
- <!-- Show menu items only when Customized Dish is not selected -->
581
- <div class="container mt-4">
582
- <!-- <h1 class="text-center">Menu</h1> -->
583
-
584
- <!-- Display text boxes for Customized Dish -->
585
- {% if selected_category == "Customized Dish" %}
586
- <div id="custom-dish-form" class="mt-4">
587
- <h3>Create Your Custom Dish</h3>
588
- <form method="POST" action="/customdish/generate_custom_dish">
589
- <div class="mb-3">
590
- <label for="custom-dish-name" class="form-label">Dish Name</label>
591
- <input type="text" class="form-control" id="custom-dish-name" name="name" required>
592
- </div>
593
- <div class="mb-3">
594
- <label for="custom-dish-description" class="form-label">Dish Description</label>
595
- <textarea class="form-control" id="custom-dish-description" name="description" required></textarea>
596
- </div>
597
- <button type="submit" class="btn btn-primary">Submit</button>
598
- </form>
599
- </div>
600
- {% else %}
601
-
602
- <!-- Menu Sections -->
603
- {% for section, items in ordered_menu.items() %}
604
- <h3>{{ section }}</h3>
605
- <div class="row">
606
- {% for item in items %}
607
- <!-- <div class="col-md-6 mb-4">
608
- <div class="card menu-card">
609
- <img src="{{ item.Image1__c }}" class="card-img-top menu-image" alt="{{ item.Name }}" onerror="this.src='/static/placeholder.jpg';" "loading="lazy">
610
- <div class="card-body">
611
- <h5 class="card-title">{{ item.Name }}</h5>
612
- <p class="card-text">${{ item.Price__c }}</p>
613
- <button class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#itemModal"
614
- onclick="showItemDetails('{{ item.Name }}', '{{ item.Price__c }}', '{{ item.Image2__c }}', '{{ item.Description__c }}', '{{ item.Section__c }}','{{ selected_category }}')">
615
- Add
616
- </button>
617
- </div>
618
- </div>
619
- </div> -->
620
- <div class="col-md-6 mb-4">
621
- <div class="card menu-card">
622
- <img src="{{ item.Image1__c }}" class="card-img-top menu-image" alt="{{ item.Name }}"
623
- onerror="this.src='/static/placeholder.jpg';" loading="lazy">
624
-
625
- <!-- Customize Button on Image -->
626
- <!-- <button class="btn customize-btn"
627
- data-bs-toggle="modal" data-bs-target="#itemModal"
628
- onclick="showItemDetails('{{ item.Name }}', '{{ item.Price__c }}', '{{ item.Image2__c }}', '{{ item.Description__c }}', '{{ item.Section__c }}','{{ selected_category }}')">
629
- Customize <i class="bi bi-caret-right-fill"></i>
630
- </button> -->
631
-
632
- <!-- <div class="card-body">
633
- <h5 class="card-title">{{ item.Name }}</h5>
634
- <p class="card-text">${{ item.Price__c }}</p>
635
- </div> -->
636
- <div class="addbutton">
637
- <div class="card-body d-flex align-items-center justify-content-between">
638
- <div>
639
- <h5 class="card-title">{{ item.Name }}</h5>
640
- <p class="card-text">${{ item.Price__c }}</p>
641
- </div>
642
- <div class= "d-flex flex-column align-item-center justify-content-center">
643
- <!-- <button class="btn btn-primary>ADD</button> -->
644
-
645
- <div >
646
- <button class="btn btn btn-primary "
647
- data-bs-toggle="modal" data-bs-target="#itemModal"
648
- onclick="showItemDetails('{{ item.Name }}', '{{ item.Price__c }}', '{{ item.Image2__c }}', '{{ item.Description__c }}', '{{ item.Section__c }}','{{ selected_category }}')">
649
- ADD
650
- </button>
651
- </div>
652
- <div class="w-100 text-center">
653
-
654
- {% if item.Section__c != 'Apetizer' and item.Section__c != 'Customized dish' and item.Section__c !='Soft Drinks' %}
655
- <h5 class="customisable-text">Customisable</h5>
656
- {% endif %}
657
 
658
- </div>
659
-
660
-
661
-
662
- </div>
663
 
 
 
 
 
 
 
 
 
 
 
 
664
 
 
 
 
 
665
 
666
-
667
- </div>
668
-
669
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
670
 
671
-
672
- </div>
673
- </div>
674
- {% endfor %}
675
  </div>
676
- {% endfor %}
 
 
 
 
 
 
 
 
 
 
677
  </div>
678
- {% endif %}
679
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
680
  </div>
681
 
682
  <!-- View Cart Button -->
@@ -686,298 +178,182 @@ form-check-input addon-option{
686
  </a>
687
  </div>
688
 
689
- <!-- Modal for Item Details -->
690
- <div class="modal fade" id="itemModal" tabindex="-1" aria-labelledby="itemModalLabel" aria-hidden="true">
691
- <div class="modal-dialog modal-dialog-centered">
692
- <div class="modal-content">
693
- <div class="modal-header">
694
- <h5 class="modal-title" id="itemModalLabel">Item Details</h5>
695
- <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
696
- </div>
697
- <div class="modal-body">
698
- <!-- Item Image -->
699
- <img id="modal-img" class="img-fluid rounded mb-3 d-block mx-auto" alt="Item Image" style="max-height: 200px; object-fit: cover;">
700
- <!-- Item Name -->
701
- <h5 id="modal-name" class="fw-bold text-center"></h5>
702
- <!-- Item Price -->
703
- <p id="modal-price" class="text-muted text-center"></p>
704
- <!-- Item Description -->
705
- <p id="modal-description" class="text-secondary"></p>
706
- <!-- Add-ons -->
707
- <div id="modal-addons" class="modal-addons mt-4">
708
- <h6>Customization Options</h6>
709
- <div id="addons-list" class="addons-container">Loading customization options...</div>
710
  </div>
711
- <div class="mt-4">
712
- <h6>Custom Request</h6>
713
- <textarea id="modal-instructions" class="form-control" placeholder="Enter any special instructions here..."></textarea>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
714
  </div>
715
- <span id="modal-section" data-section="" data-category="" style="display: none;"></span>
716
- </div>
717
- <!-- Quantity Controls and Add to Cart Button -->
718
- <div class="modal-footer d-flex align-items-center justify-content-between">
719
- <!-- Quantity Controls -->
720
- <div class="d-flex align-items-center gap-2">
721
- <button type="button" class="btn btn-outline-secondary" id="decreaseQuantity">-</button>
722
- <input type="text" class="form-control text-center" id="quantityInput" value="1" readonly style="width: 50px;"/>
723
- <button type="button" class="btn btn-outline-secondary" id="increaseQuantity">+</button>
 
724
  </div>
725
- <!-- Add to Cart Button -->
726
- <button type="button" class="btn btn-primary" onclick="addToCartFromModal()">Add to Cart</button>
727
  </div>
728
  </div>
729
  </div>
730
- </div>
731
-
732
-
733
-
734
- <!-- JavaScript -->
735
- <script>
736
- // Show item details and fetch customization options
737
- function showItemDetails(name, price, image, description, section, selectedCategory) {
738
- document.getElementById('modal-name').innerText = name;
739
- document.getElementById('modal-price').innerText = `$${price}`;
740
- document.getElementById('modal-img').src = image || '/static/placeholder.jpg';
741
- document.getElementById('modal-description').innerText = description || 'No description available.';
742
- document.getElementById('addons-list').innerHTML = 'Loading customization options...';
743
- document.getElementById('modal-instructions').value = '';
744
-
745
- const modalSectionEl = document.getElementById('modal-section');
746
- modalSectionEl.setAttribute('data-section', section);
747
- modalSectionEl.setAttribute('data-category', selectedCategory);
748
-
749
- // Set the default quantity to 1
750
- document.getElementById('quantityInput').value = 1;
751
-
752
- // Fetch customization options based on the section
753
- fetch(`/api/addons?item_name=${encodeURIComponent(name)}&item_section=${encodeURIComponent(section)}`)
754
- .then(response => response.json())
755
- .then(data => {
756
- const addonsList = document.getElementById('addons-list');
757
- addonsList.innerHTML = ''; // Clear previous content
758
-
759
- if (!data.success || !data.addons || data.addons.length === 0) {
760
- addonsList.innerHTML = '<p>No customization options available.</p>';
761
- return;
762
- }
763
-
764
- // Display customization options inside styled divs
765
- data.addons.forEach(addon => {
766
- const sectionDiv = document.createElement('div');
767
- sectionDiv.classList.add('addon-section'); // Add styling class
768
-
769
- // Add section title
770
- const title = document.createElement('h6');
771
- title.innerText = addon.name;
772
- sectionDiv.appendChild(title);
773
-
774
- // Create options list
775
- const optionsContainer = document.createElement('div');
776
- addon.options.forEach((option, index) => {
777
- const optionId = `addon-${addon.name.replace(/\s+/g, '')}-${index}`;
778
- const listItem = document.createElement('div');
779
- listItem.classList.add('form-check');
780
- listItem.innerHTML = `
781
- <input type="checkbox" class="form-check-input addon-option" id="${optionId}" value="${option}"
782
- data-name="${option}" data-group="${addon.name}" data-price="${addon.extra_charge ? addon.extra_charge_amount : 0}">
783
- <label class="form-check-label" for="${optionId}">
784
- ${option} ${addon.extra_charge ? `($${addon.extra_charge_amount})` : ''}
785
- </label>
786
- `;
787
- optionsContainer.appendChild(listItem);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
788
  });
789
- sectionDiv.appendChild(optionsContainer);
790
- addonsList.appendChild(sectionDiv);
 
 
791
  });
792
- })
793
- .catch(err => {
794
- console.error('Error fetching add-ons:', err);
795
- document.getElementById('addons-list').innerHTML = '<p>Error loading customization options.</p>';
796
- });
797
- }
798
-
799
- // Handle single-select/deselect logic for checkbox groups in all modals
800
- document.addEventListener('click', function(event) {
801
- if (event.target.classList.contains('addon-option')) {
802
- handleAddonClick(event.target);
803
  }
804
- });
805
-
806
- // Handle checkbox selection logic
807
- function handleAddonClick(checkbox) {
808
- const groupName = checkbox.getAttribute('data-group');
809
- const isMultiSelectGroup = ["Extra Toppings", "Choose Raita/Sides","Select Dip/Sauce","Extra Add-ons","Make it a Combo","Beverages","Sauces"].includes(groupName);
810
-
811
- // If it's not multi-select, uncheck all other checkboxes in the same group
812
- if (!isMultiSelectGroup) {
813
- const checkboxes = document.querySelectorAll(`.addon-option[data-group="${groupName}"]`);
814
- checkboxes.forEach(otherCheckbox => {
815
- if (otherCheckbox !== checkbox) {
816
- otherCheckbox.checked = false;
817
- }
818
- });
819
- }
820
- }
821
- function filterMenu() {
822
- let input = document.getElementById('searchBar').value.toLowerCase(); // Get the value from search bar
823
- let sections = document.querySelectorAll('h3'); // Select section headers
824
- let items = document.querySelectorAll('.menu-card'); // Select all items
825
- let matchedSections = new Set(); // Store matched sections
826
-
827
- // Hide all items initially
828
- items.forEach(item => {
829
- let itemName = item.querySelector('.card-title').innerText.toLowerCase(); // Get item name
830
- let itemSection = item.closest('.row').previousElementSibling.innerText.toLowerCase(); // Get section name
831
-
832
- // If the search matches item name or section, show the item
833
- if (itemName.includes(input) || (itemSection && itemSection.includes(input))) {
834
- item.style.display = 'block'; // Show item if it matches search
835
- matchedSections.add(item.closest('.row')); // Add section to matched list
836
- } else {
837
- item.style.display = 'none'; // Hide item if not matched
838
- }
839
- });
840
-
841
- // Show or hide sections based on matched items
842
- sections.forEach(section => {
843
- let sectionRow = section.nextElementSibling; // The row containing items
844
- if (matchedSections.has(sectionRow)) {
845
- section.style.display = 'block'; // Show section header
846
- sectionRow.style.display = 'flex'; // Show section items
847
- } else {
848
- section.style.display = 'none'; // Hide section header
849
- sectionRow.style.display = 'none'; // Hide section items
850
- }
851
- });
852
- }
853
-
854
- function addToCartFromModal() {
855
- const itemName = document.getElementById('modal-name').innerText;
856
- let itemPrice = parseFloat(document.getElementById('modal-price').innerText.replace('$', ''));
857
-
858
- // Validate item price
859
- if (isNaN(itemPrice)) {
860
- alert('Invalid price for the item. Please check the item details.');
861
- return;
862
- }
863
-
864
- const itemImage = document.getElementById('modal-img').src;
865
- console.log(itemName, itemPrice, itemImage); // Log values for debugging
866
- const modalSectionEl = document.getElementById('modal-section');
867
- const section = modalSectionEl.getAttribute('data-section');
868
- const selectedCategory = modalSectionEl.getAttribute('data-category');
869
- if (!itemName || !itemPrice || !section || !itemImage) {
870
- console.error('Missing data for cart item:', { itemName, itemPrice, section, itemImage});
871
- return;
872
- }
873
-
874
- // Collect selected add-ons
875
- let selectedAddOns = Array.from(
876
- document.querySelectorAll('#addons-list input[type="checkbox"]:checked')
877
- ).map(addon => ({
878
- name: addon.getAttribute('data-name') || 'Default Name', // Fallback Name
879
- price: parseFloat(addon.getAttribute('data-price') || 0)
880
- }));
881
-
882
- // Get the selected quantity
883
- const quantity = parseInt(document.getElementById('quantityInput').value) || 1; // Default to 1 if invalid
884
-
885
- const instructions = document.getElementById('modal-instructions').value;
886
-
887
- // Prepare data for the cart
888
- const cartPayload = {
889
- itemName: itemName,
890
- itemPrice: itemPrice,
891
- itemImage: itemImage,
892
- section: section,
893
- category: selectedCategory,
894
- addons: selectedAddOns,
895
- instructions: instructions,
896
- quantity: quantity // Include the quantity
897
- };
898
-
899
- // Send the cart data to the server
900
- fetch('/cart/add', {
901
- method: 'POST',
902
- headers: {
903
- 'Content-Type': 'application/json',
904
- },
905
- body: JSON.stringify(cartPayload)
906
- })
907
- .then(response => response.json())
908
- .then(data => {
909
- if (data.success) {
910
- alert('Item added to cart successfully!');
911
- updateCartUI(data.cart); // Update cart UI after adding an item
912
- const modal = document.getElementById('itemModal');
913
- const modalInstance = bootstrap.Modal.getInstance(modal);
914
- modalInstance.hide();
915
- } else {
916
- alert(data.error || 'Failed to add item to cart.');
917
- }
918
- })
919
- .catch(err => {
920
- console.error('Error adding item to cart:', err);
921
- alert('An error occurred while adding the item to the cart.');
922
- });
923
- }
924
-
925
- function updateCartUI(cart) {
926
- if (!Array.isArray(cart)) {
927
- console.error('Invalid cart data:', cart);
928
- return;
929
- }
930
- const cartIcon = document.getElementById('cart-icon');
931
- cartIcon.innerText = cart.length; // Assuming cart is an array of items
932
- }
933
-
934
- function updateCartDisplay(cart) {
935
- if (!Array.isArray(cart)) {
936
- console.error('Invalid cart data:', cart);
937
- return;
938
- }
939
- // Optional: Update quantity on the cart page
940
- const cartCountElement = document.getElementById('cart-count');
941
- cartCountElement.innerText = cart.reduce((total, item)=> total+item.quantity,0); // Update cart item count //Sum of all quantities
942
-
943
- // Optionally, show a small success notification that the item was added
944
- const successNotification = document.createElement('div');
945
- successNotification.classList.add('success-notification');
946
- successNotification.innerText = 'Item added to cart!';
947
- document.body.appendChild(successNotification);
948
- setTimeout(() => {
949
- successNotification.remove(); // Remove success notification after a few seconds
950
- }, 2000);
951
- }
952
-
953
- document.addEventListener('DOMContentLoaded', function () {
954
- // Get references to the quantity buttons and the input field
955
- const decreaseBtn = document.getElementById('decreaseQuantity');
956
- const increaseBtn = document.getElementById('increaseQuantity');
957
- const quantityInput = document.getElementById('quantityInput');
958
-
959
- // Add event listener to decrease button
960
- decreaseBtn.addEventListener('click', function () {
961
- let currentQuantity = parseInt(quantityInput.value);
962
- if (currentQuantity > 1) {
963
- currentQuantity--;
964
- quantityInput.value = currentQuantity;
965
- }
966
- });
967
-
968
- // Add event listener to increase button
969
- increaseBtn.addEventListener('click', function () {
970
- let currentQuantity = parseInt(quantityInput.value);
971
- currentQuantity++;
972
- quantityInput.value = currentQuantity;
973
- });
974
- });
975
-
976
-
977
-
978
  </script>
979
 
980
- <!-- Bootstrap JS -->
981
- <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"></script>
982
  </body>
983
  </html>
 
7
  <!-- Bootstrap CSS -->
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
+ /* Your existing CSS styles here... */
12
+
13
+ .addbutton .btn {
14
+ background-color: #28a745;
15
+ color: white;
16
+ padding: 10px 20px;
17
+ font-size: 16px;
18
+ font-weight: bold;
19
+ border-radius: 5px;
20
+ border: none;
21
+ transition: background-color 0.3s ease;
22
+ margin-left: 13px;
23
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
 
25
+ .addbutton .btn:hover {
26
+ background-color: #218838;
27
+ }
 
 
 
 
 
28
 
29
+ .customisable-text {
30
+ color: #28a745;
31
+ font-size: 12px;
32
+ margin-left: 5px;
33
+ margin-top:1px;
34
+ }
35
 
36
+ .modal-footer {
37
+ display: flex;
38
+ align-items: center;
39
+ justify-content: space-between;
40
+ padding: 10px;
41
+ }
42
 
43
+ .modal-footer .d-flex {
44
+ display: flex;
45
+ align-items: center;
46
+ gap: 10px;
47
+ }
48
+
49
+ .modal-footer .btn {
50
+ height: 40px;
51
+ padding: 0 15px;
52
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
 
54
+ .modal-footer .form-control {
55
+ width: 50px;
56
+ height: 40px;
57
+ text-align: center;
58
+ }
59
 
60
+ .modal-footer .btn-primary {
61
+ background-color: #0FAA39;
62
+ border-color: #0FAA39;
63
+ font-weight: bold;
64
+ padding: 10px 20px;
65
+ height: 40px;
66
+ display: flex;
67
+ justify-content: center;
68
+ align-items: center;
69
+ width: auto;
70
+ }
71
 
72
+ .modal-footer .btn-outline-secondary {
73
+ height: 40px;
74
+ width: 40px;
75
+ }
76
 
77
+ /* Adjust modal for small screens */
78
+ @media (max-width: 576px) {
79
+ .modal-dialog {
80
+ max-width: 98%;
81
+ }
82
+
83
+ .modal-footer .btn {
84
+ height: 35px;
85
+ padding: 0 12px;
86
+ }
87
+
88
+ .modal-footer .form-control {
89
+ width: 40px;
90
+ height: 35px;
91
+ }
92
+ }
93
+ </style>
94
+ </head>
95
+ <body>
96
 
97
+ <div class="fixed-top-bar">
98
+ <div class="avatar-dropdown-container">
99
+ <div class="avatar-icon">
100
+ <span>{{ first_letter }}</span>
101
  </div>
102
+ <div class="dropdown-menu">
103
+ <a href="{{ url_for('user_details.customer_details') }}" class="dropdown-item">View Profile</a>
104
+ <a href="{{ url_for('orderhistory.order_history') }}" class="dropdown-item">Order History</a>
105
+ <a href="{{ url_for('logout') }}" class="dropdown-item">Logout</a>
106
+ </div>
107
+ </div>
108
+ <!-- Search Bar Section -->
109
+ <div class="search-bar-container">
110
+ <input type="text" id="searchBar" class="form-control" placeholder="Search items or sections..." onkeyup="filterMenu()">
111
+ <i class="bi bi-search search-icon"></i>
112
+ </div>
113
  </div>
 
114
 
115
+ <!-- Category Filter with Custom Radio Buttons -->
116
+ <form method="get" action="/menu" class="text-center mb-4">
117
+ <label class="form-label fw-bold">Select a Category:</label>
118
+ <div class="form-check form-check-inline">
119
+ {% for category in categories %}
120
+ <input type="radio" id="category-{{ category }}" name="category" value="{{ category }}" class="custom-radio"
121
+ {% if selected_category == category %}checked{% endif %} onchange="this.form.submit()">
122
+ <label class="form-check-label" for="category-{{ category }}">{{ category }}</label>
123
+ {% endfor %}
124
+ </div>
125
+ <div class="form-check">
126
+ <input type="radio" id="category-CustomizedDish" name="category" value="Customized Dish" class="custom-radio"
127
+ {% if selected_category == "Customized Dish" %}checked{% endif %} onchange="this.form.submit()">
128
+ <label class="form-check-label" for="category-CustomizedDish">Customized Dish</label>
129
+ </div>
130
+ </form>
131
+
132
+ <!-- Menu Items -->
133
+ <div class="container mt-4">
134
+ {% if selected_category == "Customized Dish" %}
135
+ <div id="custom-dish-form" class="mt-4">
136
+ <h3>Create Your Custom Dish</h3>
137
+ <form method="POST" action="/customdish/generate_custom_dish">
138
+ <div class="mb-3">
139
+ <label for="custom-dish-name" class="form-label">Dish Name</label>
140
+ <input type="text" class="form-control" id="custom-dish-name" name="name" required>
141
+ </div>
142
+ <div class="mb-3">
143
+ <label for="custom-dish-description" class="form-label">Dish Description</label>
144
+ <textarea class="form-control" id="custom-dish-description" name="description" required></textarea>
145
+ </div>
146
+ <button type="submit" class="btn btn-primary">Submit</button>
147
+ </form>
148
+ </div>
149
+ {% else %}
150
+ {% for section, items in ordered_menu.items() %}
151
+ <h3>{{ section }}</h3>
152
+ <div class="row">
153
+ {% for item in items %}
154
+ <div class="col-md-6 mb-4">
155
+ <div class="card menu-card">
156
+ <img src="{{ item.Image1__c }}" class="card-img-top menu-image" alt="{{ item.Name }}"
157
+ onerror="this.src='/static/placeholder.jpg';" loading="lazy">
158
+ <div class="card-body">
159
+ <h5 class="card-title">{{ item.Name }}</h5>
160
+ <p class="card-text">${{ item.Price__c }}</p>
161
+ <button class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#itemModal"
162
+ onclick="showItemDetails('{{ item.Name }}', '{{ item.Price__c }}', '{{ item.Image2__c }}', '{{ item.Description__c }}', '{{ item.Section__c }}','{{ selected_category }}')">
163
+ Add
164
+ </button>
165
+ </div>
166
+ </div>
167
+ </div>
168
+ {% endfor %}
169
+ </div>
170
+ {% endfor %}
171
+ {% endif %}
172
  </div>
173
 
174
  <!-- View Cart Button -->
 
178
  </a>
179
  </div>
180
 
181
+ <!-- Modal for Item Details -->
182
+ <div class="modal fade" id="itemModal" tabindex="-1" aria-labelledby="itemModalLabel" aria-hidden="true">
183
+ <div class="modal-dialog modal-dialog-centered">
184
+ <div class="modal-content">
185
+ <div class="modal-header">
186
+ <h5 class="modal-title" id="itemModalLabel">Item Details</h5>
187
+ <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
188
  </div>
189
+ <div class="modal-body">
190
+ <!-- Item Image -->
191
+ <img id="modal-img" class="img-fluid rounded mb-3 d-block mx-auto" alt="Item Image" style="max-height: 200px; object-fit: cover;">
192
+ <!-- Item Name -->
193
+ <h5 id="modal-name" class="fw-bold text-center"></h5>
194
+ <!-- Item Price -->
195
+ <p id="modal-price" class="text-muted text-center"></p>
196
+ <!-- Item Description -->
197
+ <p id="modal-description" class="text-secondary"></p>
198
+
199
+ <!-- For Starters: Type and Spice Level Fields -->
200
+ <div id="first-row">
201
+ <div class="row">
202
+ <div class="col-6">
203
+ <h6>Type</h6>
204
+ <div id="type-options">
205
+ <!-- Options will be populated dynamically for Starters -->
206
+ </div>
207
+ </div>
208
+ <div class="col-6">
209
+ <h6>Spice Level</h6>
210
+ <div id="spice-level-options">
211
+ <!-- Options will be populated dynamically for Starters -->
212
+ </div>
213
+ </div>
214
+ </div>
215
+ </div>
216
+
217
+ <!-- Add-ons -->
218
+ <div id="modal-addons" class="modal-addons mt-4">
219
+ <h6>Customization Options</h6>
220
+ <div id="addons-list" class="addons-container">Loading customization options...</div>
221
+ </div>
222
+
223
+ <div class="mt-4">
224
+ <h6>Custom Request</h6>
225
+ <textarea id="modal-instructions" class="form-control" placeholder="Enter any special instructions here..."></textarea>
226
+ </div>
227
+ <span id="modal-section" data-section="" data-category="" style="display: none;"></span>
228
  </div>
229
+ <!-- Quantity Controls and Add to Cart Button -->
230
+ <div class="modal-footer d-flex align-items-center justify-content-between">
231
+ <!-- Quantity Controls -->
232
+ <div class="d-flex align-items-center gap-2">
233
+ <button type="button" class="btn btn-outline-secondary" id="decreaseQuantity">-</button>
234
+ <input type="text" class="form-control text-center" id="quantityInput" value="1" readonly style="width: 50px;"/>
235
+ <button type="button" class="btn btn-outline-secondary" id="increaseQuantity">+</button>
236
+ </div>
237
+ <!-- Add to Cart Button -->
238
+ <button type="button" class="btn btn-primary" onclick="addToCartFromModal()">Add to Cart</button>
239
  </div>
 
 
240
  </div>
241
  </div>
242
  </div>
243
+
244
+ <!-- Bootstrap JS -->
245
+ <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"></script>
246
+
247
+ <script>
248
+ // Show item details and fetch customization options for both Starters and other sections
249
+ function showItemDetails(name, price, image, description, section, selectedCategory) {
250
+ document.getElementById('modal-name').innerText = name;
251
+ document.getElementById('modal-price').innerText = `$${price}`;
252
+ document.getElementById('modal-img').src = image || '/static/placeholder.jpg';
253
+ document.getElementById('modal-description').innerText = description || 'No description available.';
254
+ document.getElementById('addons-list').innerHTML = 'Loading customization options...';
255
+ document.getElementById('modal-instructions').value = '';
256
+
257
+ const modalSectionEl = document.getElementById('modal-section');
258
+ modalSectionEl.setAttribute('data-section', section);
259
+ modalSectionEl.setAttribute('data-category', selectedCategory);
260
+
261
+ // Set the default quantity to 1
262
+ document.getElementById('quantityInput').value = 1;
263
+
264
+ // Get references for the Type and Spice Level options
265
+ const typeOptions = document.getElementById('type-options');
266
+ const spiceLevelOptions = document.getElementById('spice-level-options');
267
+
268
+ // Clear previous content for Type and Spice Level
269
+ typeOptions.innerHTML = '';
270
+ spiceLevelOptions.innerHTML = '';
271
+
272
+ // Fetch customization options based on the section
273
+ fetch(`/api/addons?item_name=${encodeURIComponent(name)}&item_section=${encodeURIComponent(section)}`)
274
+ .then(response => response.json())
275
+ .then(data => {
276
+ const addonsList = document.getElementById('addons-list');
277
+ addonsList.innerHTML = ''; // Clear previous content
278
+
279
+ if (!data.success || !data.addons || data.addons.length === 0) {
280
+ addonsList.innerHTML = '<p>No customization options available.</p>';
281
+ return;
282
+ }
283
+
284
+ // For Starters Section, add Type and Spice Level first
285
+ if (section.toLowerCase() === 'starters') {
286
+ data.addons.forEach(addon => {
287
+ // Dynamically add Type options
288
+ if (addon.name.toLowerCase() === "type") {
289
+ addon.options.forEach(option => {
290
+ const optionId = `addon-type-${option}`;
291
+ const optionHTML = `
292
+ <div class="form-check">
293
+ <input type="checkbox" class="form-check-input" id="${optionId}" value="${option}" data-name="${option}" data-group="Type">
294
+ <label class="form-check-label" for="${optionId}">
295
+ ${option}
296
+ </label>
297
+ </div>
298
+ `;
299
+ typeOptions.innerHTML += optionHTML;
300
+ });
301
+ }
302
+
303
+ // Dynamically add Spice Level options
304
+ if (addon.name.toLowerCase() === "spice level") {
305
+ addon.options.forEach(option => {
306
+ const optionId = `addon-spice-level-${option}`;
307
+ const optionHTML = `
308
+ <div class="form-check">
309
+ <input type="checkbox" class="form-check-input" id="${optionId}" value="${option}" data-name="${option}" data-group="Spice Level">
310
+ <label class="form-check-label" for="${optionId}">
311
+ ${option}
312
+ </label>
313
+ </div>
314
+ `;
315
+ spiceLevelOptions.innerHTML += optionHTML;
316
+ });
317
+ }
318
+ });
319
+ }
320
+
321
+ // Add the rest of the customization options for all sections (Curries, Biryanis, etc.)
322
+ data.addons.forEach(addon => {
323
+ if (addon.name.toLowerCase() !== "type" && addon.name.toLowerCase() !== "spice level") {
324
+ const sectionDiv = document.createElement('div');
325
+ sectionDiv.classList.add('addon-section');
326
+
327
+ const title = document.createElement('h6');
328
+ title.innerText = addon.name;
329
+ sectionDiv.appendChild(title);
330
+
331
+ const optionsContainer = document.createElement('div');
332
+ addon.options.forEach((option, index) => {
333
+ const optionId = `addon-${addon.name.replace(/\s+/g, '')}-${index}`;
334
+ const listItem = document.createElement('div');
335
+ listItem.classList.add('form-check');
336
+ listItem.innerHTML = `
337
+ <input type="checkbox" class="form-check-input addon-option" id="${optionId}" value="${option}"
338
+ data-name="${option}" data-group="${addon.name}" data-price="${addon.extra_charge ? addon.extra_charge_amount : 0}">
339
+ <label class="form-check-label" for="${optionId}">
340
+ ${option} ${addon.extra_charge ? `($${addon.extra_charge_amount})` : ''}
341
+ </label>
342
+ `;
343
+ optionsContainer.appendChild(listItem);
344
+ });
345
+
346
+ sectionDiv.appendChild(optionsContainer);
347
+ addonsList.appendChild(sectionDiv);
348
+ }
349
  });
350
+ })
351
+ .catch(err => {
352
+ console.error('Error fetching add-ons:', err);
353
+ document.getElementById('addons-list').innerHTML = '<p>Error loading customization options.</p>';
354
  });
 
 
 
 
 
 
 
 
 
 
 
355
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
356
  </script>
357
 
 
 
358
  </body>
359
  </html>