nagasurendra commited on
Commit
e7a806e
·
verified ·
1 Parent(s): 2691732

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -14
app.py CHANGED
@@ -91,21 +91,17 @@ def filter_menu(preference):
91
  for section, items in filtered_data.items():
92
  html_content += f"<h2 style='text-align: center; margin-top: 10px;'>{section}</h2>"
93
  html_content += '<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 15px; justify-content: center;">'
94
- for _ in range(max(len(items), 4)): # Ensure at least 4 fixed slots
95
- if items:
96
- item = items.pop(0)
97
- html_content += f"""
98
- <div style="border: 1px solid #ddd; border-radius: 10px; box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1); overflow: hidden;">
99
- <img src="{item.get('Image1__c', '')}" style="width: 100%; height: 250px; object-fit: cover;">
100
- <div style="padding: 10px;">
101
- <h3 style='font-size: 1.2em; text-align: center;'>{item['Name']}</h3>
102
- <p style='font-size: 1.1em; color: green; text-align: center;'>${item['Price__c']}</p>
103
- <p style='font-size: 0.9em; text-align: justify;'>{item['Description__c']}</p>
104
- </div>
105
  </div>
106
- """
107
- else:
108
- html_content += "<div style='visibility: hidden; height: 250px;'></div>"
109
  html_content += '</div>'
110
  html_content += '</div>'
111
 
 
91
  for section, items in filtered_data.items():
92
  html_content += f"<h2 style='text-align: center; margin-top: 10px;'>{section}</h2>"
93
  html_content += '<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 15px; justify-content: center;">'
94
+ for item in items:
95
+ html_content += f"""
96
+ <div style="border: 1px solid #ddd; border-radius: 10px; box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1); overflow: hidden; height: 350px;">
97
+ <img src="{item.get('Image1__c', '')}" style="width: 100%; height: 200px; object-fit: cover;">
98
+ <div style="padding: 10px;">
99
+ <h3 style='font-size: 1.2em; text-align: center;'>{item['Name']}</h3>
100
+ <p style='font-size: 1.1em; color: green; text-align: center;'>${item['Price__c']}</p>
101
+ <p style='font-size: 0.9em; text-align: justify; margin: 5px;'>{item['Description__c']}</p>
 
 
 
102
  </div>
103
+ </div>
104
+ """
 
105
  html_content += '</div>'
106
  html_content += '</div>'
107