nagasurendra commited on
Commit
a57b5d2
·
verified ·
1 Parent(s): e11a47c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -85,7 +85,7 @@ def filter_menu(preference):
85
  filtered_data[item["Section__c"]] = []
86
 
87
  if preference == "All" or (preference == "Veg" and item["Veg_NonVeg__c"] in ["Veg", "Both"]) or (preference == "Non-Veg" and item["Veg_NonVeg__c"] in ["Non veg", "Both"]):
88
- filtered_data[item["Section__c"]].append(item)
89
 
90
  html_content = '<div style="padding: 20px; max-width: 1200px; margin: auto;">'
91
  for section, items in filtered_data.items():
@@ -94,12 +94,12 @@ def filter_menu(preference):
94
  html_content += '<div style="display: flex; flex-wrap: wrap; gap: 20px; justify-content: center;">'
95
  for item in items:
96
  html_content += f"""
97
- <div style="width: 300px; border: 1px solid #ddd; border-radius: 10px; box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);">
98
- <img src="{item.get('Image1__c', '')}" style="width: 100%; height: 200px; object-fit: cover;">
99
  <div style="padding: 10px;">
100
- <h3>{item['Name']}</h3>
101
- <p>${item['Price__c']}</p>
102
- <p>{item['Description__c']}</p>
103
  </div>
104
  </div>
105
  """
 
85
  filtered_data[item["Section__c"]] = []
86
 
87
  if preference == "All" or (preference == "Veg" and item["Veg_NonVeg__c"] in ["Veg", "Both"]) or (preference == "Non-Veg" and item["Veg_NonVeg__c"] in ["Non veg", "Both"]):
88
+ filtered_data[item["Section__c"].strip()].append(item)
89
 
90
  html_content = '<div style="padding: 20px; max-width: 1200px; margin: auto;">'
91
  for section, items in filtered_data.items():
 
94
  html_content += '<div style="display: flex; flex-wrap: wrap; gap: 20px; justify-content: center;">'
95
  for item in items:
96
  html_content += f"""
97
+ <div style="width: 400px; border: 1px solid #ddd; border-radius: 10px; box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1); overflow: hidden;">
98
+ <img src="{item.get('Image1__c', '')}" style="width: 300px; height: 400px; object-fit: cover; margin: auto; display: block;">
99
  <div style="padding: 10px;">
100
+ <h3 style='font-size: 1.2em; text-align: center;'>{item['Name']}</h3>
101
+ <p style='font-size: 1.1em; color: green; text-align: center;'>${item['Price__c']}</p>
102
+ <p style='font-size: 0.9em; text-align: justify;'>{item['Description__c']}</p>
103
  </div>
104
  </div>
105
  """