nagasurendra commited on
Commit
94da675
·
verified ·
1 Parent(s): d0355bc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +33 -0
app.py CHANGED
@@ -111,6 +111,39 @@ def filter_menu(preference):
111
  return "<p>No items match your filter.</p>"
112
 
113
  return html_content
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
114
 
115
  # JavaScript for Modal and Cart
116
  def modal_js():
 
111
  return "<p>No items match your filter.</p>"
112
 
113
  return html_content
114
+ # Create Modal Window HTML
115
+ def create_modal_window():
116
+ add_ons = load_add_ons_from_salesforce()
117
+ add_ons_html = ""
118
+ for add_on in add_ons:
119
+ add_ons_html += f"""
120
+ <label>
121
+ <input type="checkbox" name="biryani-extra" value="{add_on['Name']}" data-price="{add_on['Price__c']}" />
122
+ {add_on['Name']} + ${add_on['Price__c']}
123
+ </label>
124
+ <br>
125
+ """
126
+
127
+ modal_html = f"""
128
+ <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;">
129
+ <div style="text-align: right;">
130
+ <button onclick="closeModal()" style="background: none; border: none; font-size: 18px; cursor: pointer;">&times;</button>
131
+ </div>
132
+ <img id="modal-image" style="width: 100%; height: 300px; border-radius: 8px; margin-bottom: 20px;" />
133
+ <h2 id="modal-name"></h2>
134
+ <p id="modal-description"></p>
135
+ <p id="modal-price"></p>
136
+ <label for="biryani-extras"><strong>Add-ons :</strong></label>
137
+ <div id="biryani-extras-options" style="display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0;">
138
+ {add_ons_html}
139
+ </div>
140
+ <label for="quantity">Quantity:</label>
141
+ <input type="number" id="quantity" value="1" min="1" style="width: 50px;" />
142
+ <textarea id="special-instructions" placeholder="Add your special instructions here..." style="width: 100%; height: 60px;"></textarea>
143
+ <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>
144
+ </div>
145
+ """
146
+ return modal_html
147
 
148
  # JavaScript for Modal and Cart
149
  def modal_js():