Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -72,7 +72,7 @@ def filter_menu(preference):
|
|
| 72 |
</div>
|
| 73 |
<div style="flex-shrink: 0; text-align: center;">
|
| 74 |
<img src="{item['Image URL']}" alt="{item['Dish Name']}" style="width: 100px; height: 100px; border-radius: 8px; object-fit: cover; margin-bottom: 10px;">
|
| 75 |
-
<button style="background-color: #28a745; color: white; border: none; padding: 8px 15px; font-size: 14px; border-radius: 5px; cursor: pointer;" onclick="openModal('{item['Dish Name']}', '{item['Image URL']}', '{item['Description']}', '{item['Price ($)']}')">Add</button>
|
| 76 |
</div>
|
| 77 |
</div>
|
| 78 |
"""
|
|
@@ -163,7 +163,7 @@ button {
|
|
| 163 |
"Veg Manchurian": 12
|
| 164 |
};
|
| 165 |
let finalized = false;
|
| 166 |
-
function openModal(name,
|
| 167 |
if (finalized) {
|
| 168 |
alert("You cannot add more items after finalizing your order.");
|
| 169 |
return;
|
|
@@ -180,7 +180,7 @@ button {
|
|
| 180 |
}
|
| 181 |
modal.style.left = '50%';
|
| 182 |
modal.style.transform = 'translate(-50%, -50%)';
|
| 183 |
-
document.getElementById('modal-image').src =
|
| 184 |
document.getElementById('modal-name').innerText = name;
|
| 185 |
document.getElementById('modal-description').innerText = description;
|
| 186 |
document.getElementById('modal-price').innerText = price;
|
|
@@ -341,7 +341,7 @@ def app():
|
|
| 341 |
|
| 342 |
# Radio button for selecting preference
|
| 343 |
selected_preference = gr.Radio(
|
| 344 |
-
choices=["All", "Vegetarian", "Halal/Non-Veg"],
|
| 345 |
value="All",
|
| 346 |
label="Choose a Preference",
|
| 347 |
)
|
|
@@ -365,7 +365,7 @@ def app():
|
|
| 365 |
<p id="modal-description"></p>
|
| 366 |
<p id="modal-price"></p>
|
| 367 |
<!-- Biryani Extras -->
|
| 368 |
-
<label for="biryani-extras">
|
| 369 |
<div id="biryani-extras-options" style="display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0;">
|
| 370 |
<label><input type="checkbox" name="biryani-extra" value="Thums up" /> Thums up + $2.00</label>
|
| 371 |
<label><input type="checkbox" name="biryani-extra" value="Sprite" /> Sprite + $2.00</label>
|
|
|
|
| 72 |
</div>
|
| 73 |
<div style="flex-shrink: 0; text-align: center;">
|
| 74 |
<img src="{item['Image URL']}" alt="{item['Dish Name']}" style="width: 100px; height: 100px; border-radius: 8px; object-fit: cover; margin-bottom: 10px;">
|
| 75 |
+
<button style="background-color: #28a745; color: white; border: none; padding: 8px 15px; font-size: 14px; border-radius: 5px; cursor: pointer;" onclick="openModal('{item['Dish Name']}', '{item['Image 2 URL']}', '{item['Description']}', '{item['Price ($)']}')">Add</button>
|
| 76 |
</div>
|
| 77 |
</div>
|
| 78 |
"""
|
|
|
|
| 163 |
"Veg Manchurian": 12
|
| 164 |
};
|
| 165 |
let finalized = false;
|
| 166 |
+
function openModal(name, image2, description, price) {
|
| 167 |
if (finalized) {
|
| 168 |
alert("You cannot add more items after finalizing your order.");
|
| 169 |
return;
|
|
|
|
| 180 |
}
|
| 181 |
modal.style.left = '50%';
|
| 182 |
modal.style.transform = 'translate(-50%, -50%)';
|
| 183 |
+
document.getElementById('modal-image').src = image2;
|
| 184 |
document.getElementById('modal-name').innerText = name;
|
| 185 |
document.getElementById('modal-description').innerText = description;
|
| 186 |
document.getElementById('modal-price').innerText = price;
|
|
|
|
| 341 |
|
| 342 |
# Radio button for selecting preference
|
| 343 |
selected_preference = gr.Radio(
|
| 344 |
+
choices=["All", "Vegetarian", "Halal/Non-Veg", "Guilt Free"],
|
| 345 |
value="All",
|
| 346 |
label="Choose a Preference",
|
| 347 |
)
|
|
|
|
| 365 |
<p id="modal-description"></p>
|
| 366 |
<p id="modal-price"></p>
|
| 367 |
<!-- Biryani Extras -->
|
| 368 |
+
<label for="biryani-extras">Extras :</label>
|
| 369 |
<div id="biryani-extras-options" style="display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0;">
|
| 370 |
<label><input type="checkbox" name="biryani-extra" value="Thums up" /> Thums up + $2.00</label>
|
| 371 |
<label><input type="checkbox" name="biryani-extra" value="Sprite" /> Sprite + $2.00</label>
|