Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -195,6 +195,39 @@ def filter_menu(preference):
|
|
195 |
|
196 |
return html_content
|
197 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
198 |
# JavaScript for Modal and Cart
|
199 |
def modal_js():
|
200 |
modal_script = """
|
|
|
195 |
|
196 |
return html_content
|
197 |
|
198 |
+
def create_modal_window():
|
199 |
+
add_ons = load_add_ons_from_salesforce()
|
200 |
+
add_ons_html = ""
|
201 |
+
for add_on in add_ons:
|
202 |
+
add_ons_html += f"""
|
203 |
+
<label>
|
204 |
+
<input type="checkbox" name="biryani-extra" value="{add_on['Name']}" data-price="{add_on['Price__c']}" />
|
205 |
+
{add_on['Name']} + ${add_on['Price__c']}
|
206 |
+
</label>
|
207 |
+
<br>
|
208 |
+
"""
|
209 |
+
|
210 |
+
modal_html = f"""
|
211 |
+
<div id="modal" style="display: none; position: fixed; background: white; border-radius: 8px; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); padding: 20px; z-index: 1000;">
|
212 |
+
<div style="text-align: right;">
|
213 |
+
<button onclick="closeModal()" style="background: none; border: none; font-size: 18px; cursor: pointer;">×</button>
|
214 |
+
</div>
|
215 |
+
<img id="modal-image" style="width: 100%; height: 300px; border-radius: 8px; margin-bottom: 20px;" />
|
216 |
+
<h2 id="modal-name"></h2>
|
217 |
+
<p id="modal-description"></p>
|
218 |
+
<p id="modal-price"></p>
|
219 |
+
<label for="biryani-extras"><strong>Add-ons :</strong></label>
|
220 |
+
<div id="biryani-extras-options" style="display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0;">
|
221 |
+
{add_ons_html}
|
222 |
+
</div>
|
223 |
+
<label for="quantity">Quantity:</label>
|
224 |
+
<input type="number" id="quantity" value="1" min="1" style="width: 50px;" />
|
225 |
+
<textarea id="special-instructions" placeholder="Add your special instructions here..." style="width: 100%; height: 60px;"></textarea>
|
226 |
+
<button style="background-color: #28a745; color: white; border: none; padding: 10px 20px; font-size: 14px; border-radius: 5px; cursor: pointer;" onclick="addToCart()">Add to Cart</button>
|
227 |
+
</div>
|
228 |
+
"""
|
229 |
+
return modal_html
|
230 |
+
|
231 |
# JavaScript for Modal and Cart
|
232 |
def modal_js():
|
233 |
modal_script = """
|