Spaces:
Sleeping
Sleeping
Update templates/menu.html
Browse files- templates/menu.html +28 -5
templates/menu.html
CHANGED
|
@@ -164,6 +164,27 @@
|
|
| 164 |
justify-content: space-between;
|
| 165 |
align-items: center;
|
| 166 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 167 |
|
| 168 |
</style>
|
| 169 |
</head>
|
|
@@ -303,6 +324,7 @@
|
|
| 303 |
<div id="addons-list" class="addons-container">Loading customization options...</div>
|
| 304 |
</div>
|
| 305 |
|
|
|
|
| 306 |
<div class="mt-4">
|
| 307 |
<h6>Special Instructions</h6>
|
| 308 |
<textarea id="modal-instructions" class="form-control" placeholder="Enter any special instructions here..."></textarea>
|
|
@@ -322,7 +344,7 @@
|
|
| 322 |
<script>
|
| 323 |
function showItemDetails(name, price, image, description, section, selectedCategory) {
|
| 324 |
document.getElementById('modal-name').innerText = name;
|
| 325 |
-
document.getElementById('modal-price').innerText =
|
| 326 |
document.getElementById('modal-img').src = image || '/static/placeholder.jpg';
|
| 327 |
document.getElementById('modal-description').innerText = description || 'No description available.';
|
| 328 |
document.getElementById('addons-list').innerHTML = 'Loading customization options...';
|
|
@@ -339,16 +361,16 @@
|
|
| 339 |
.then(data => {
|
| 340 |
const addonsList = document.getElementById('addons-list');
|
| 341 |
addonsList.innerHTML = ''; // Clear previous content
|
| 342 |
-
|
| 343 |
if (!data.success || !data.addons || data.addons.length === 0) {
|
| 344 |
addonsList.innerHTML = '<p>No customization options available.</p>';
|
| 345 |
return;
|
| 346 |
}
|
| 347 |
|
| 348 |
-
// Display customization options
|
| 349 |
data.addons.forEach(addon => {
|
| 350 |
const sectionDiv = document.createElement('div');
|
| 351 |
-
sectionDiv.classList.add('addon-section');
|
| 352 |
|
| 353 |
// Add section title
|
| 354 |
const title = document.createElement('h6');
|
|
@@ -367,7 +389,7 @@
|
|
| 367 |
<input type="checkbox" class="form-check-input addon-option" id="${optionId}" value="${option}"
|
| 368 |
data-name="${option}" data-price="${addon.extra_charge ? addon.extra_charge_amount : 0}">
|
| 369 |
<label class="form-check-label" for="${optionId}">
|
| 370 |
-
${option} ${addon.extra_charge ? `(
|
| 371 |
</label>
|
| 372 |
`;
|
| 373 |
optionsContainer.appendChild(listItem);
|
|
@@ -383,6 +405,7 @@
|
|
| 383 |
});
|
| 384 |
}
|
| 385 |
|
|
|
|
| 386 |
function filterMenu() {
|
| 387 |
let input = document.getElementById('searchBar').value.toLowerCase();
|
| 388 |
let sections = document.querySelectorAll('.menu-section'); // Select all sections
|
|
|
|
| 164 |
justify-content: space-between;
|
| 165 |
align-items: center;
|
| 166 |
}
|
| 167 |
+
/* Style for customization sections */
|
| 168 |
+
.addon-section {
|
| 169 |
+
background-color: #f8f9fa; /* Light gray background */
|
| 170 |
+
border: 2px solid #5bbfc1; /* Border color */
|
| 171 |
+
border-radius: 8px;
|
| 172 |
+
padding: 12px;
|
| 173 |
+
margin-bottom: 15px; /* Spacing between sections */
|
| 174 |
+
}
|
| 175 |
+
|
| 176 |
+
/* Customization section title */
|
| 177 |
+
.addon-section h6 {
|
| 178 |
+
margin-bottom: 10px;
|
| 179 |
+
font-size: 1.1rem;
|
| 180 |
+
font-weight: bold;
|
| 181 |
+
color: #333;
|
| 182 |
+
}
|
| 183 |
+
|
| 184 |
+
/* Style for add-on checkboxes */
|
| 185 |
+
.addon-section .form-check {
|
| 186 |
+
margin-left: 10px;
|
| 187 |
+
}
|
| 188 |
|
| 189 |
</style>
|
| 190 |
</head>
|
|
|
|
| 324 |
<div id="addons-list" class="addons-container">Loading customization options...</div>
|
| 325 |
</div>
|
| 326 |
|
| 327 |
+
|
| 328 |
<div class="mt-4">
|
| 329 |
<h6>Special Instructions</h6>
|
| 330 |
<textarea id="modal-instructions" class="form-control" placeholder="Enter any special instructions here..."></textarea>
|
|
|
|
| 344 |
<script>
|
| 345 |
function showItemDetails(name, price, image, description, section, selectedCategory) {
|
| 346 |
document.getElementById('modal-name').innerText = name;
|
| 347 |
+
document.getElementById('modal-price').innerText = `₹${price}`;
|
| 348 |
document.getElementById('modal-img').src = image || '/static/placeholder.jpg';
|
| 349 |
document.getElementById('modal-description').innerText = description || 'No description available.';
|
| 350 |
document.getElementById('addons-list').innerHTML = 'Loading customization options...';
|
|
|
|
| 361 |
.then(data => {
|
| 362 |
const addonsList = document.getElementById('addons-list');
|
| 363 |
addonsList.innerHTML = ''; // Clear previous content
|
| 364 |
+
|
| 365 |
if (!data.success || !data.addons || data.addons.length === 0) {
|
| 366 |
addonsList.innerHTML = '<p>No customization options available.</p>';
|
| 367 |
return;
|
| 368 |
}
|
| 369 |
|
| 370 |
+
// Display customization options inside styled divs
|
| 371 |
data.addons.forEach(addon => {
|
| 372 |
const sectionDiv = document.createElement('div');
|
| 373 |
+
sectionDiv.classList.add('addon-section'); // Add styling class
|
| 374 |
|
| 375 |
// Add section title
|
| 376 |
const title = document.createElement('h6');
|
|
|
|
| 389 |
<input type="checkbox" class="form-check-input addon-option" id="${optionId}" value="${option}"
|
| 390 |
data-name="${option}" data-price="${addon.extra_charge ? addon.extra_charge_amount : 0}">
|
| 391 |
<label class="form-check-label" for="${optionId}">
|
| 392 |
+
${option} ${addon.extra_charge ? `(₹${addon.extra_charge_amount})` : ''}
|
| 393 |
</label>
|
| 394 |
`;
|
| 395 |
optionsContainer.appendChild(listItem);
|
|
|
|
| 405 |
});
|
| 406 |
}
|
| 407 |
|
| 408 |
+
|
| 409 |
function filterMenu() {
|
| 410 |
let input = document.getElementById('searchBar').value.toLowerCase();
|
| 411 |
let sections = document.querySelectorAll('.menu-section'); // Select all sections
|