nagasurendra commited on
Commit
2146520
·
verified ·
1 Parent(s): f03d6fd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -22
app.py CHANGED
@@ -12,34 +12,15 @@ def load_menu():
12
  # Function to generate the popup content dynamically
13
  def generate_popup(item_name):
14
  menu_data = load_menu()
15
- try:
16
- item = menu_data[menu_data['Dish Name'] == item_name].iloc[0]
17
- except IndexError:
18
- return f"<p style='color: red;'>Item '{item_name}' not found!</p>"
19
 
20
  # Dynamic HTML for the popup
21
  popup_content = f"""
22
- <div style="background-color: white; padding: 20px; border-radius: 8px; width: 80%; margin: auto; box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2); position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 1000;">
23
  <img src="{item['Image URL']}" alt="{item_name}" style="width: 100%; border-radius: 8px; margin-bottom: 20px;">
24
  <h2>{item_name}</h2>
25
  <p>{item['Description']}</p>
26
  <p style="font-size: 18px; color: #333;"><strong>Price:</strong> ${item['Price ($)']}</p>
27
- <h3>Choose a Spice Level:</h3>
28
- <div style="display: flex; gap: 10px;">
29
- <label><input type="radio" name="spice" value="American Mild"> American Mild</label>
30
- <label><input type="radio" name="spice" value="American Medium"> American Medium</label>
31
- <label><input type="radio" name="spice" value="American Spicy"> American Spicy</label>
32
- <label><input type="radio" name="spice" value="Indian Mild"> Indian Mild</label>
33
- <label><input type="radio" name="spice" value="Indian Medium"> Indian Medium</label>
34
- <label><input type="radio" name="spice" value="Indian Spicy"> Indian Spicy</label>
35
- </div>
36
- <h3>Biryani Extras:</h3>
37
- <div style="display: flex; flex-wrap: wrap; gap: 10px;">
38
- <label><input type="checkbox" name="extras" value="Extra Raitha 4oz"> Extra Raitha 4oz ($1)</label>
39
- <label><input type="checkbox" name="extras" value="Extra Raitha 8oz"> Extra Raitha 8oz ($2)</label>
40
- <label><input type="checkbox" name="extras" value="Extra Salan 4oz"> Extra Salan 4oz ($1)</label>
41
- <label><input type="checkbox" name="extras" value="Extra Onion"> Extra Onion ($1)</label>
42
- </div>
43
  <h3>Special Instructions:</h3>
44
  <textarea placeholder="Add any requests here." style="width: 100%; height: 100px;"></textarea>
45
  <h3>Quantity:</h3>
@@ -67,7 +48,7 @@ def filter_menu_with_popup(preference):
67
  html_content = ""
68
  for _, item in filtered_data.iterrows():
69
  html_content += f"""
70
- <div style="display: flex; align-items: center; border: 1px solid #ddd; border-radius: 8px; padding: 15px; margin-bottom: 10px; box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1); position: relative;">
71
  <div style="flex: 1; margin-right: 15px;">
72
  <h3 style="margin: 0; font-size: 18px;">{item['Dish Name']}</h3>
73
  <p style="margin: 5px 0; font-size: 16px; color: #888;">${item['Price ($)']}</p>
 
12
  # Function to generate the popup content dynamically
13
  def generate_popup(item_name):
14
  menu_data = load_menu()
15
+ item = menu_data[menu_data['Dish Name'] == item_name].iloc[0]
 
 
 
16
 
17
  # Dynamic HTML for the popup
18
  popup_content = f"""
19
+ <div style="background-color: white; padding: 20px; border-radius: 8px; width: 50%; margin: auto; box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2); position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 1000;">
20
  <img src="{item['Image URL']}" alt="{item_name}" style="width: 100%; border-radius: 8px; margin-bottom: 20px;">
21
  <h2>{item_name}</h2>
22
  <p>{item['Description']}</p>
23
  <p style="font-size: 18px; color: #333;"><strong>Price:</strong> ${item['Price ($)']}</p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  <h3>Special Instructions:</h3>
25
  <textarea placeholder="Add any requests here." style="width: 100%; height: 100px;"></textarea>
26
  <h3>Quantity:</h3>
 
48
  html_content = ""
49
  for _, item in filtered_data.iterrows():
50
  html_content += f"""
51
+ <div style="display: flex; align-items: center; border: 1px solid #ddd; border-radius: 8px; padding: 15px; margin-bottom: 10px; box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);">
52
  <div style="flex: 1; margin-right: 15px;">
53
  <h3 style="margin: 0; font-size: 18px;">{item['Dish Name']}</h3>
54
  <p style="margin: 5px 0; font-size: 16px; color: #888;">${item['Price ($)']}</p>