mtoft20 commited on
Commit
933f085
·
verified ·
1 Parent(s): 3dc49fc

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +34 -26
src/streamlit_app.py CHANGED
@@ -581,33 +581,41 @@ def main():
581
 
582
  # Bottom pagination controls with better layout
583
  st.write("---")
584
- pagination_cols = st.columns([2, 3, 2])
585
 
586
- with pagination_cols[1]:
587
- page_cols = st.columns([1, 2, 1])
588
-
589
- with page_cols[0]:
590
- if st.button("← Previous", disabled=st.session_state.current_page == 1, use_container_width=True):
591
- st.session_state.current_page -= 1
592
- st.rerun()
593
-
594
- with page_cols[1]:
595
- page_input = st.number_input(
596
- f"Page (of {total_pages})",
597
- min_value=1,
598
- max_value=total_pages,
599
- value=st.session_state.current_page,
600
- key="page_number",
601
- help=f"Enter a page number between 1 and {total_pages}"
602
- )
603
- if page_input != st.session_state.current_page:
604
- st.session_state.current_page = page_input
605
- st.rerun()
606
-
607
- with page_cols[2]:
608
- if st.button("Next →", disabled=st.session_state.current_page == total_pages, use_container_width=True):
609
- st.session_state.current_page += 1
610
- st.rerun()
 
 
 
 
 
 
 
 
611
  else:
612
  st.info("No content matches your current filters. Try adjusting the criteria.")
613
 
 
581
 
582
  # Bottom pagination controls with better layout
583
  st.write("---")
584
+ page_cols = st.columns([1, 2, 1, 2, 1])
585
 
586
+ # Previous button
587
+ with page_cols[0]:
588
+ if st.button("← Previous", disabled=st.session_state.current_page == 1, use_container_width=True):
589
+ st.session_state.current_page -= 1
590
+ st.rerun()
591
+
592
+ # Spacer
593
+ with page_cols[1]:
594
+ st.write("")
595
+
596
+ # Page input
597
+ with page_cols[2]:
598
+ page_input = st.number_input(
599
+ f"Page (of {total_pages})",
600
+ min_value=1,
601
+ max_value=total_pages,
602
+ value=st.session_state.current_page,
603
+ key="page_number",
604
+ help=f"Enter a page number between 1 and {total_pages}"
605
+ )
606
+ if page_input != st.session_state.current_page:
607
+ st.session_state.current_page = page_input
608
+ st.rerun()
609
+
610
+ # Spacer
611
+ with page_cols[3]:
612
+ st.write("")
613
+
614
+ # Next button
615
+ with page_cols[4]:
616
+ if st.button("Next →", disabled=st.session_state.current_page == total_pages, use_container_width=True):
617
+ st.session_state.current_page += 1
618
+ st.rerun()
619
  else:
620
  st.info("No content matches your current filters. Try adjusting the criteria.")
621