Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -150,7 +150,7 @@ popup_html = """
|
|
| 150 |
def display_dishes(category):
|
| 151 |
html_content = "<div style='display: flex; flex-direction: column; gap: 20px; padding-bottom: 20px; box-sizing: border-box;'>"
|
| 152 |
for dish in menu_data:
|
| 153 |
-
if category == "ALL"
|
| 154 |
html_content += f"""
|
| 155 |
<div style='display: flex; align-items: center; justify-content: space-between; padding: 20px; border: 1px solid #ddd; border-radius: 10px; background-color: #f9f9f9;'>
|
| 156 |
<div style='flex: 3; text-align: left;'>
|
|
@@ -165,6 +165,22 @@ def display_dishes(category):
|
|
| 165 |
Add
|
| 166 |
</button>
|
| 167 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 168 |
</div>
|
| 169 |
"""
|
| 170 |
html_content += "</div>"
|
|
|
|
| 150 |
def display_dishes(category):
|
| 151 |
html_content = "<div style='display: flex; flex-direction: column; gap: 20px; padding-bottom: 20px; box-sizing: border-box;'>"
|
| 152 |
for dish in menu_data:
|
| 153 |
+
if category == "ALL":
|
| 154 |
html_content += f"""
|
| 155 |
<div style='display: flex; align-items: center; justify-content: space-between; padding: 20px; border: 1px solid #ddd; border-radius: 10px; background-color: #f9f9f9;'>
|
| 156 |
<div style='flex: 3; text-align: left;'>
|
|
|
|
| 165 |
Add
|
| 166 |
</button>
|
| 167 |
</div>
|
| 168 |
+
|
| 169 |
+
elif category == dish["category"] == category:
|
| 170 |
+
html_content += f"""
|
| 171 |
+
<div style='display: flex; align-items: center; justify-content: space-between; padding: 20px; height:100%; border: 1px solid #ddd; border-radius: 10px; background-color: #f9f9f9;'>
|
| 172 |
+
<div style='flex: 3; text-align: left;'>
|
| 173 |
+
<h3 style='margin: 0; font-size: 20px;'>{dish['name']}</h3>
|
| 174 |
+
<p style='margin: 5px 0; font-size: 14px; color: #555;'>{dish['description']}</p>
|
| 175 |
+
<p style='margin: 0; font-size: 16px; font-weight: bold;'>Price: {dish['price']}</p>
|
| 176 |
+
</div>
|
| 177 |
+
<div style='flex: 1; text-align: center;'>
|
| 178 |
+
<img src='{dish['image']}' alt='{dish['name']}' style='width: 120px; height: 80px; object-fit: cover; border-radius: 10px;'>
|
| 179 |
+
<button onclick="showPopup('{dish['name']}', '{dish['description']}', '{dish['price']}', '{dish['image']}')"
|
| 180 |
+
style='margin-top: 10px; padding: 10px 20px; background-color: #28a745; color: white; border: none; border-radius: 5px; cursor: pointer;'>
|
| 181 |
+
Add
|
| 182 |
+
</button>
|
| 183 |
+
</div>
|
| 184 |
</div>
|
| 185 |
"""
|
| 186 |
html_content += "</div>"
|