CCockrum commited on
Commit
203c6be
·
verified ·
1 Parent(s): c5b7979

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +44 -13
app.py CHANGED
@@ -424,19 +424,50 @@ def main():
424
  gender = st.selectbox("Gender", gender_options)
425
 
426
  # Advanced options
427
- with st.expander("Advanced Options"):
428
- col1, col2 = st.columns(2)
429
-
430
- with col1:
431
- good_with_children = st.checkbox("Good with children")
432
- good_with_dogs = st.checkbox("Good with dogs")
433
- good_with_cats = st.checkbox("Good with cats")
434
-
435
- with col2:
436
- house_trained = st.checkbox("House-trained")
437
- special_needs = st.checkbox("Special needs")
438
-
439
- submitted = st.form_submit_button("Search")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
440
 
441
  if submitted:
442
  # Build search parameters
 
424
  gender = st.selectbox("Gender", gender_options)
425
 
426
  # Advanced options
427
+ # Replace this section in your main() function:
428
+
429
+ # Search form
430
+ with st.expander("Search Options", expanded=True):
431
+ with st.form("pet_search_form"):
432
+ col1, col2 = st.columns(2)
433
+
434
+ with col1:
435
+ animal_type = st.selectbox(
436
+ "Animal Type",
437
+ ["Dog", "Cat", "Rabbit", "Small & Furry", "Horse", "Bird", "Scales, Fins & Other", "Barnyard"]
438
+ )
439
+
440
+ location = st.text_input("Location (ZIP code or City, State)", "")
441
+
442
+ distance = st.slider("Distance (miles)", min_value=10, max_value=500, value=50, step=10)
443
+
444
+ with col2:
445
+ age_options = ["", "Baby", "Young", "Adult", "Senior"]
446
+ age = st.selectbox("Age", age_options)
447
+
448
+ size_options = ["", "Small", "Medium", "Large", "XLarge"]
449
+ size = st.selectbox("Size", size_options)
450
+
451
+ gender_options = ["", "Male", "Female"]
452
+ gender = st.selectbox("Gender", gender_options)
453
+
454
+ # Advanced options - use a checkbox to expand/collapse instead of an expander
455
+ show_advanced = st.checkbox("Show Advanced Options")
456
+
457
+ if show_advanced:
458
+ st.markdown("### Advanced Options")
459
+ col1, col2 = st.columns(2)
460
+
461
+ with col1:
462
+ good_with_children = st.checkbox("Good with children")
463
+ good_with_dogs = st.checkbox("Good with dogs")
464
+ good_with_cats = st.checkbox("Good with cats")
465
+
466
+ with col2:
467
+ house_trained = st.checkbox("House-trained")
468
+ special_needs = st.checkbox("Special needs")
469
+
470
+ submitted = st.form_submit_button("Search")
471
 
472
  if submitted:
473
  # Build search parameters