Spaces:
Sleeping
Sleeping
Update app.py
Browse files165 unmodified lines16616716816917017117217324 unmodified lines19819920020120220320420520620720820921019 unmodified lines2302312322282332342352362372382392402412422432442452462472482496 unmodified lines256257258241259165 unmodified lines st.session_state.search_performed = False if 'filtered_jobs' not in st.session_state: st.session_state.filtered_jobs = pd.DataFrame() if 'expanded_descriptions' not in st.session_state: st.session_state.expanded_descriptions = set()
# Sidebar filters with st.sidebar:24 unmodified lines jobs_df, job_title, location, min_salary, keywords, debug=debug_mode ) st.session_state.search_performed = True # Reset expanded descriptions when new search is performed st.session_state.expanded_descriptions = set()
if st.button("Reset Filters", use_container_width=True): st.session_state.search_performed = False st.session_state.filtered_jobs = pd.DataFrame() st.session_state.expanded_descriptions = set() st.rerun()
# Display results19 unmodified lines pattern = re.compile(f'({re.escape(keyword)})', re.IGNORECASE) description = pattern.sub(r'**\1**', description)
st.write(description[:500] + "..." if len(description) > 500 else description) # Check if this description is expanded is_expanded = index in st.session_state.expanded_descriptions # Show full or truncated description based on state if len(description) > 500 and not is_expanded: st.write(description[:500] + "...") if st.button("See more", key=f"expand_{index}"): st.session_state.expanded_descriptions.add(index) st.rerun() else: st.write(description) if len(description) > 500 and st.button("See less", key=f"collapse_{index}"): st.session_state.expanded_descriptions.remove(index) st.rerun() else: st.warning(""" No matching jobs found. Try:6 unmodified lines st.info("Use the filters in the sidebar and click 'Search Jobs' to find matching positions.")
if __name__ == "__main__": main() main()app.py+20-2