lokesh341 commited on
Commit
891f8e9
·
verified ·
1 Parent(s): 366c00e

Update templates/menu.html

Browse files
Files changed (1) hide show
  1. templates/menu.html +5 -57
templates/menu.html CHANGED
@@ -279,14 +279,6 @@
279
  display: inline-block;
280
  vertical-align: middle;
281
  }
282
- .spice-level-grid {
283
- display: grid;
284
- grid-template-columns: 1fr 1fr;
285
- gap: 10px;
286
- }
287
- .spice-level-grid .form-check {
288
- margin-left: 0;
289
- }
290
  form.text-center.mb-4 {
291
  display: flex;
292
  flex-direction: column;
@@ -635,9 +627,6 @@
635
  font-size: 12px;
636
  margin-right: 10px;
637
  }
638
- .spice-level-grid {
639
- gap: 5px;
640
- }
641
  }
642
  </style>
643
  </head>
@@ -783,27 +772,6 @@
783
  <h6>Type</h6>
784
  <div id="type-options"></div>
785
  </div>
786
- <div class="addon-section">
787
- <h6>Select Spice Level</h6>
788
- <div id="spice-level-options" class="spice-level-grid">
789
- <div class="form-check">
790
- <input type="checkbox" class="form-check-input spice-level-option" id="spice-mild" value="Mild" data-name="Mild" data-group="Spice Level">
791
- <label class="form-check-label" for="spice-mild">Mild</label>
792
- </div>
793
- <div class="form-check">
794
- <input type="checkbox" class="form-check-input spice-level-option" id="spice-spicy" value="Spicy" data-name="Spicy" data-group="Spice Level">
795
- <label class="form-check-label" for="spice-spicy">Spicy</label>
796
- </div>
797
- <div class="form-check">
798
- <input type="checkbox" class="form-check-input spice-level-option" id="spice-medium" value="Medium" data-name="Medium" data-group="Spice Level">
799
- <label class="form-check-label" for="spice-medium">Medium</label>
800
- </div>
801
- <div class="form-check">
802
- <input type="checkbox" class="form-check-input spice-level-option" id="spice-extra-spicy" value="Extra Spicy" data-name="Extra Spicy" data-group="Spice Level">
803
- <label class="form-check-label" for="spice-extra-spicy">Extra Spicy</label>
804
- </div>
805
- </div>
806
- </div>
807
  </div>
808
 
809
  <div id="modal-addons" class="modal-addons mt-4">
@@ -1116,14 +1084,12 @@
1116
 
1117
  const prepStyleOptions = document.getElementById('prep-style-options');
1118
  const typeOptions = document.getElementById('type-options');
1119
- const spiceLevelOptions = document.getElementById('spice-level-options');
1120
  const firstRow = document.getElementById('first-row');
1121
  const firstRowTitle = document.getElementById('first-row-title');
1122
  const addonsTitle = document.getElementById('addons-title');
1123
 
1124
  prepStyleOptions.innerHTML = '';
1125
  typeOptions.innerHTML = '';
1126
- spiceLevelOptions.innerHTML = '';
1127
 
1128
  if (section.toLowerCase() === 'starters') {
1129
  firstRow.style.display = 'block';
@@ -1222,7 +1188,6 @@
1222
  data.addons.forEach(addon => {
1223
  if (section.toLowerCase() === 'starters' &&
1224
  (addon.name.toLowerCase() === "type" ||
1225
- addon.name.toLowerCase() === "spice level" ||
1226
  addon.name.toLowerCase() === "choose preparation style")) {
1227
  return;
1228
  }
@@ -1242,7 +1207,7 @@
1242
  listItem.classList.add('form-check');
1243
 
1244
  listItem.innerHTML = `
1245
- <input type="checkbox" class="form-check-input ${addon.name.toLowerCase() === 'spice level' ? 'spice-level-option' : 'addon-option'}" id="${optionId}" value="${option}"
1246
  data-name="${option}" data-group="${addon.name}" data-price="${addon.extra_charge ? addon.extra_charge_amount : 0}">
1247
  <label class="form-check-label" for="${optionId}">
1248
  ${option} ${addon.extra_charge ? `($${addon.extra_charge_amount})` : ''}
@@ -1261,7 +1226,6 @@
1261
  ];
1262
 
1263
  const desiredOrder = [
1264
- "Spice Level",
1265
  "Choose Preparation Style",
1266
  "Select Dip/Sauce",
1267
  "Extra Add-ons",
@@ -1295,7 +1259,7 @@
1295
  }
1296
 
1297
  document.addEventListener('click', function(event) {
1298
- if (event.target.classList.contains('spice-level-option') || event.target.classList.contains('addon-option')) {
1299
  handleAddonClick(event.target);
1300
  }
1301
  });
@@ -1304,15 +1268,7 @@
1304
  const groupName = checkbox.getAttribute('data-group');
1305
  const isMultiSelectGroup = ["Extra Toppings", "Choose Raita/Sides", "Select Dip/Sauce", "Extra Add-ons", "Make it a Combo", "Beverages", "Sauces"].includes(groupName);
1306
 
1307
- if (groupName.toLowerCase() === "spice level") {
1308
- const allSpiceLevelCheckboxes = document.querySelectorAll('.spice-level-option');
1309
- allSpiceLevelCheckboxes.forEach(otherCheckbox => {
1310
- if (otherCheckbox !== checkbox) {
1311
- otherCheckbox.checked = false;
1312
- }
1313
- });
1314
- }
1315
- else if (!isMultiSelectGroup) {
1316
  const checkboxes = document.querySelectorAll(`.addon-option[data-group="${groupName}"]`);
1317
  checkboxes.forEach(otherCheckbox => {
1318
  if (otherCheckbox !== checkbox) {
@@ -1398,12 +1354,7 @@
1398
  name: option.getAttribute('data-name') || 'Default Type',
1399
  price: 0
1400
  }));
1401
- const spiceLevelOption = document.querySelector('#spice-level-options input[type="checkbox"].spice-level-option:checked');
1402
- const spiceLevelOptions = spiceLevelOption ? [{
1403
- name: spiceLevelOption.getAttribute('data-name') || 'Default Spice Level',
1404
- price: 0
1405
- }] : [];
1406
- selectedAddOns = [...selectedAddOns, ...prepStyleOptions, ...typeOptions, ...spiceLevelOptions];
1407
  }
1408
 
1409
  const quantity = parseInt(document.getElementById('quantityInput').value) || 1;
@@ -1737,7 +1688,4 @@
1737
  });
1738
  </script>
1739
  </body>
1740
- </html>
1741
-
1742
-
1743
-
 
279
  display: inline-block;
280
  vertical-align: middle;
281
  }
 
 
 
 
 
 
 
 
282
  form.text-center.mb-4 {
283
  display: flex;
284
  flex-direction: column;
 
627
  font-size: 12px;
628
  margin-right: 10px;
629
  }
 
 
 
630
  }
631
  </style>
632
  </head>
 
772
  <h6>Type</h6>
773
  <div id="type-options"></div>
774
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
775
  </div>
776
 
777
  <div id="modal-addons" class="modal-addons mt-4">
 
1084
 
1085
  const prepStyleOptions = document.getElementById('prep-style-options');
1086
  const typeOptions = document.getElementById('type-options');
 
1087
  const firstRow = document.getElementById('first-row');
1088
  const firstRowTitle = document.getElementById('first-row-title');
1089
  const addonsTitle = document.getElementById('addons-title');
1090
 
1091
  prepStyleOptions.innerHTML = '';
1092
  typeOptions.innerHTML = '';
 
1093
 
1094
  if (section.toLowerCase() === 'starters') {
1095
  firstRow.style.display = 'block';
 
1188
  data.addons.forEach(addon => {
1189
  if (section.toLowerCase() === 'starters' &&
1190
  (addon.name.toLowerCase() === "type" ||
 
1191
  addon.name.toLowerCase() === "choose preparation style")) {
1192
  return;
1193
  }
 
1207
  listItem.classList.add('form-check');
1208
 
1209
  listItem.innerHTML = `
1210
+ <input type="checkbox" class="form-check-input addon-option" id="${optionId}" value="${option}"
1211
  data-name="${option}" data-group="${addon.name}" data-price="${addon.extra_charge ? addon.extra_charge_amount : 0}">
1212
  <label class="form-check-label" for="${optionId}">
1213
  ${option} ${addon.extra_charge ? `($${addon.extra_charge_amount})` : ''}
 
1226
  ];
1227
 
1228
  const desiredOrder = [
 
1229
  "Choose Preparation Style",
1230
  "Select Dip/Sauce",
1231
  "Extra Add-ons",
 
1259
  }
1260
 
1261
  document.addEventListener('click', function(event) {
1262
+ if (event.target.classList.contains('addon-option')) {
1263
  handleAddonClick(event.target);
1264
  }
1265
  });
 
1268
  const groupName = checkbox.getAttribute('data-group');
1269
  const isMultiSelectGroup = ["Extra Toppings", "Choose Raita/Sides", "Select Dip/Sauce", "Extra Add-ons", "Make it a Combo", "Beverages", "Sauces"].includes(groupName);
1270
 
1271
+ if (!isMultiSelectGroup) {
 
 
 
 
 
 
 
 
1272
  const checkboxes = document.querySelectorAll(`.addon-option[data-group="${groupName}"]`);
1273
  checkboxes.forEach(otherCheckbox => {
1274
  if (otherCheckbox !== checkbox) {
 
1354
  name: option.getAttribute('data-name') || 'Default Type',
1355
  price: 0
1356
  }));
1357
+ selectedAddOns = [...selectedAddOns, ...prepStyleOptions, ...typeOptions];
 
 
 
 
 
1358
  }
1359
 
1360
  const quantity = parseInt(document.getElementById('quantityInput').value) || 1;
 
1688
  });
1689
  </script>
1690
  </body>
1691
+ </html>