nagasurendra commited on
Commit
72d7c8a
·
verified ·
1 Parent(s): 8558df4

Update app.py

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