Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -63,9 +63,25 @@ def display_dishes(category):
|
|
| 63 |
def get_dish_details(dish_name):
|
| 64 |
for dish in menu_data:
|
| 65 |
if dish["name"] == dish_name:
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 69 |
def place_order(dish_name, spice_level, portion_size):
|
| 70 |
return f"✅ Order Confirmed: '{dish_name}' with {spice_level} spice level and {portion_size} portion size."
|
| 71 |
|
|
|
|
| 63 |
def get_dish_details(dish_name):
|
| 64 |
for dish in menu_data:
|
| 65 |
if dish["name"] == dish_name:
|
| 66 |
+
# JavaScript to simulate a click event
|
| 67 |
+
return (
|
| 68 |
+
dish["image"],
|
| 69 |
+
dish["name"],
|
| 70 |
+
dish["description"],
|
| 71 |
+
f"<script>selectDish('{dish_name}');</script>",
|
| 72 |
+
"🌶 Medium",
|
| 73 |
+
"🍽 Medium",
|
| 74 |
+
)
|
| 75 |
+
# Return placeholder if no match
|
| 76 |
+
return (
|
| 77 |
+
"https://via.placeholder.com/300x200",
|
| 78 |
+
"Unknown Dish",
|
| 79 |
+
"No description available.",
|
| 80 |
+
f"<script>alert('Dish not found!');</script>",
|
| 81 |
+
"N/A",
|
| 82 |
+
"N/A",
|
| 83 |
+
)
|
| 84 |
+
|
| 85 |
def place_order(dish_name, spice_level, portion_size):
|
| 86 |
return f"✅ Order Confirmed: '{dish_name}' with {spice_level} spice level and {portion_size} portion size."
|
| 87 |
|