Spaces:
Sleeping
Sleeping
Update src/streamlit_app.py
Browse files- 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 |
-
|
| 585 |
|
| 586 |
-
|
| 587 |
-
|
| 588 |
-
|
| 589 |
-
|
| 590 |
-
|
| 591 |
-
|
| 592 |
-
|
| 593 |
-
|
| 594 |
-
|
| 595 |
-
|
| 596 |
-
|
| 597 |
-
|
| 598 |
-
|
| 599 |
-
|
| 600 |
-
|
| 601 |
-
|
| 602 |
-
|
| 603 |
-
|
| 604 |
-
|
| 605 |
-
|
| 606 |
-
|
| 607 |
-
|
| 608 |
-
|
| 609 |
-
|
| 610 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
|