Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -51,17 +51,26 @@ def filter_dishes(category):
|
|
| 51 |
return [dish for dish in menu_data if dish["category"] == category]
|
| 52 |
|
| 53 |
# Function to display dishes
|
| 54 |
-
def display_dishes(category
|
| 55 |
filtered_dishes = filter_dishes(category)
|
| 56 |
-
html_content = "<div style='display: flex; flex-
|
| 57 |
for dish in filtered_dishes:
|
| 58 |
html_content += f"""
|
| 59 |
-
<div style='
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
<
|
| 63 |
-
|
| 64 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 65 |
</div>
|
| 66 |
"""
|
| 67 |
html_content += "</div>"
|
|
|
|
| 51 |
return [dish for dish in menu_data if dish["category"] == category]
|
| 52 |
|
| 53 |
# Function to display dishes
|
| 54 |
+
def display_dishes(category):
|
| 55 |
filtered_dishes = filter_dishes(category)
|
| 56 |
+
html_content = "<div style='display: flex; flex-direction: column; align-items: center; width: 100%; height:100%'>"
|
| 57 |
for dish in filtered_dishes:
|
| 58 |
html_content += f"""
|
| 59 |
+
<div style='margin: 10px; display: flex; align-items: center; justify-content: space-between;
|
| 60 |
+
width: 80%; padding: 10px; border: 1px solid #ddd; border-radius: 10px;
|
| 61 |
+
background-color: #f9f9f9;'>
|
| 62 |
+
<div style='flex: 1; margin-right: 20px; text-align: left;'>
|
| 63 |
+
<h4 style='font-size: 18px; color: #444; margin: 0;'>{dish['name']}</h4>
|
| 64 |
+
<p style='font-size: 14px; color: #666; margin: 5px 0;'>{dish['description']}</p>
|
| 65 |
+
<p style='font-size: 16px; color: #444; margin: 0;'>Price: {dish['price']}</p>
|
| 66 |
+
</div>
|
| 67 |
+
<div style='text-align: center;'>
|
| 68 |
+
<img src='{dish['image']}' alt='{dish['name']}'
|
| 69 |
+
style='width: 150px; height: 100px; object-fit: cover; border-radius: 10px;'>
|
| 70 |
+
<button onclick="showPopup('{dish['image']}', '{dish['name']}', '{dish['description']}', '{dish['price']}')"
|
| 71 |
+
style="margin-top: 15px; padding: 10px 20px; background-color: #28a745; color: white; border: none;
|
| 72 |
+
border-radius: 5px; cursor: pointer;">Add</button>
|
| 73 |
+
</div>
|
| 74 |
</div>
|
| 75 |
"""
|
| 76 |
html_content += "</div>"
|