Update app.py
Browse files
app.py
CHANGED
|
@@ -352,7 +352,7 @@ for i, topic in enumerate(st.session_state.topics_list):
|
|
| 352 |
|
| 353 |
st.markdown('</div>', unsafe_allow_html=True)
|
| 354 |
|
| 355 |
-
# Add/Remove topic buttons
|
| 356 |
st.markdown('<div class="action-buttons">', unsafe_allow_html=True)
|
| 357 |
col1, col2, col3, col4 = st.columns([2, 2, 2, 4])
|
| 358 |
with col1:
|
|
@@ -479,22 +479,6 @@ with st.form("personalization_form", clear_on_submit=False):
|
|
| 479 |
with col2:
|
| 480 |
submitted = st.form_submit_button("π Generate Base Course", use_container_width=True)
|
| 481 |
|
| 482 |
-
# Add/Remove topic buttons outside the form
|
| 483 |
-
st.markdown('<div class="action-buttons">', unsafe_allow_html=True)
|
| 484 |
-
col1, col2, col3, col4 = st.columns([2, 2, 2, 4])
|
| 485 |
-
with col1:
|
| 486 |
-
if st.button("β Add Topic", key="add_topic", help="Add a new topic"):
|
| 487 |
-
st.session_state.topics_list.append({
|
| 488 |
-
"topic_title": f"Topic {len(st.session_state.topics_list) + 1}",
|
| 489 |
-
"chapter_title": f"Chapter {len(st.session_state.topics_list) + 1}"
|
| 490 |
-
})
|
| 491 |
-
st.rerun()
|
| 492 |
-
with col2:
|
| 493 |
-
if st.button("π Reset All", key="reset_topics", help="Reset to default topics"):
|
| 494 |
-
st.session_state.topics_list = [{"topic_title": "What is Flask", "chapter_title": "Introduction to Flask"}]
|
| 495 |
-
st.rerun()
|
| 496 |
-
st.markdown('</div>', unsafe_allow_html=True)
|
| 497 |
-
|
| 498 |
# Handle submission
|
| 499 |
if submitted:
|
| 500 |
# Use the topics from session state directly
|
|
|
|
| 352 |
|
| 353 |
st.markdown('</div>', unsafe_allow_html=True)
|
| 354 |
|
| 355 |
+
# Add/Remove topic buttons outside the form
|
| 356 |
st.markdown('<div class="action-buttons">', unsafe_allow_html=True)
|
| 357 |
col1, col2, col3, col4 = st.columns([2, 2, 2, 4])
|
| 358 |
with col1:
|
|
|
|
| 479 |
with col2:
|
| 480 |
submitted = st.form_submit_button("π Generate Base Course", use_container_width=True)
|
| 481 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 482 |
# Handle submission
|
| 483 |
if submitted:
|
| 484 |
# Use the topics from session state directly
|