Spaces:
Sleeping
Sleeping
Update app.py
Browse files165 unmodified lines16616716816917017124 unmodified lines19619719819920020120220320420519 unmodified lines2252262272282292302316 unmodified lines238239240241165 unmodified linesst.session_state.search_performed = Falseif 'filtered_jobs' not in st.session_state:st.session_state.filtered_jobs = pd.DataFrame()# Sidebar filterswith st.sidebar:24 unmodified linesjobs_df, job_title, location, min_salary, keywords, debug=debug_mode)st.session_state.search_performed = Trueif st.button("Reset Filters", use_container_width=True):st.session_state.search_performed = Falsest.session_state.filtered_jobs = pd.DataFrame()st.rerun()# Display results19 unmodified linespattern = re.compile(f'({re.escape(keyword)})', re.IGNORECASE)description = pattern.sub(r'**\1**', description)st.write(description[:500] + "..." if len(description) > 500 else description)else:st.warning("""No matching jobs found. Try:6 unmodified linesst.info("Use the filters in the sidebar and click 'Search Jobs' to find matching positions.")if __name__ == "__main__":main()165 unmodified lines16616716816917017117217324 unmodified lines19819920020120220320420520620720820921019 unmodified lines2302312322332342352362372382392402412422432442452462472482496 unmodified lines256257258259165 unmodified linesst.session_state.search_performed = Falseif '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 filterswith st.sidebar:24 unmodified linesjobs_df, job_title, location, min_salary, keywords, debug=debug_mode)st.session_state.search_performed = True# Reset expanded descriptions when new search is performedst.session_state.expanded_descriptions = set()if st.button("Reset Filters", use_container_width=True):st.session_state.search_performed = Falsest.session_state.filtered_jobs = pd.DataFrame()st.session_state.expanded_descriptions = set()st.rerun()# Display results19 unmodified linespattern = re.compile(f'({re.escape(keyword)})', re.IGNORECASE)description = pattern.sub(r'**\1**', description)# Check if this description is expandedis_expanded = index in st.session_state.expanded_descriptions# Show full or truncated description based on stateif 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 linesst.info("Use the filters in the sidebar and click 'Search Jobs' to find matching positions.")if __name__ == "__main__":main()
app.py+20-2