Rammohan0504 commited on
Commit
8c97028
·
verified ·
1 Parent(s): 22b697b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -3
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
- return dish["image"], dish["name"], dish["description"], "🌶 Medium", "🍽 Medium"
67
- return "https://via.placeholder.com/300x200", "Unknown Dish", "No description available.", "N/A", "N/A"
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