RajaThor commited on
Commit
972ff8d
·
verified ·
1 Parent(s): 7e4f930

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +34 -2
app.py CHANGED
@@ -192,6 +192,13 @@ def delete_person(name):
192
  except Exception as e:
193
  return f"Failed to delete person: {str(e)}"
194
 
 
 
 
 
 
 
 
195
  # Streamlit interface for adding a person
196
  def add_person_ui():
197
  st.title("Add Person")
@@ -232,6 +239,29 @@ def delete_person_ui():
232
  result = delete_person(name)
233
  st.success(result)
234
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
235
  def tour_guide_ui():
236
  st.title("Tour Guide")
237
  st.markdown("This tour will guide you through the application.")
@@ -341,10 +371,10 @@ def display_tour_steps(steps):
341
  st.write(step['content'])
342
  st.markdown("---")
343
 
344
- # Update the main function to include the new option
345
  def main():
346
  st.sidebar.title("Options")
347
- option = st.sidebar.radio("Select Option", ["Add Person", "Recognize Face", "Delete Person", "Recognize Face (Optimal)","Tour Guide"])
348
 
349
  if option == "Add Person":
350
  add_person_ui()
@@ -356,6 +386,8 @@ def main():
356
  recognize_face_optimal_ui()
357
  elif option == "Tour Guide":
358
  tour_guide_ui()
 
 
359
 
360
  # Run the tour guide
361
  if __name__ == "__main__":
 
192
  except Exception as e:
193
  return f"Failed to delete person: {str(e)}"
194
 
195
+ # Send feedback to Firebase
196
+ def send_feedback(feedback_data):
197
+ try:
198
+ db.collection('feedback').add(feedback_data)
199
+ except Exception as e:
200
+ st.error(f"Failed to submit feedback: {str(e)}")
201
+
202
  # Streamlit interface for adding a person
203
  def add_person_ui():
204
  st.title("Add Person")
 
239
  result = delete_person(name)
240
  st.success(result)
241
 
242
+ # Streamlit interface for feedback
243
+ def feedback_ui():
244
+ st.title("Feedback")
245
+ st.write("Your feedback is important to us! Please fill out the form below:")
246
+
247
+ name = st.text_input("Name (optional)")
248
+ email = st.text_input("Email (optional)")
249
+ category = st.selectbox("Category", ["Bug Report", "Feature Request", "General Feedback"])
250
+ message = st.text_area("Feedback Message")
251
+
252
+ if st.button("Submit Feedback"):
253
+ if not message:
254
+ st.error("Please enter your feedback message.")
255
+ else:
256
+ feedback_data = {
257
+ "name": name,
258
+ "email": email,
259
+ "category": category,
260
+ "message": message,
261
+ }
262
+ send_feedback(feedback_data)
263
+ st.success("Feedback submitted successfully! Thank you for your feedback.")
264
+
265
  def tour_guide_ui():
266
  st.title("Tour Guide")
267
  st.markdown("This tour will guide you through the application.")
 
371
  st.write(step['content'])
372
  st.markdown("---")
373
 
374
+ # Update the main function to include the feedback option
375
  def main():
376
  st.sidebar.title("Options")
377
+ option = st.sidebar.radio("Select Option", ["Add Person", "Recognize Face", "Delete Person", "Recognize Face (Optimal)", "Tour Guide", "Feedback"])
378
 
379
  if option == "Add Person":
380
  add_person_ui()
 
386
  recognize_face_optimal_ui()
387
  elif option == "Tour Guide":
388
  tour_guide_ui()
389
+ elif option == "Feedback":
390
+ feedback_ui()
391
 
392
  # Run the tour guide
393
  if __name__ == "__main__":