Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -113,13 +113,27 @@ def update_text():
|
|
| 113 |
text = st.text_area("Edit Text", st.session_state.current_text, height=200, key="text_area_value", on_change=update_text)
|
| 114 |
|
| 115 |
# Display page turner controls
|
| 116 |
-
|
| 117 |
with col1:
|
| 118 |
st.button("Previous", on_click=turn_page, args=("prev",))
|
| 119 |
-
|
| 120 |
-
|
| 121 |
with col2:
|
| 122 |
-
st.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 123 |
|
| 124 |
# Display HTML box
|
| 125 |
st.markdown(render_html(st.session_state.current_text), unsafe_allow_html=True)
|
|
|
|
| 113 |
text = st.text_area("Edit Text", st.session_state.current_text, height=200, key="text_area_value", on_change=update_text)
|
| 114 |
|
| 115 |
# Display page turner controls
|
| 116 |
+
# Previous button in col1
|
| 117 |
with col1:
|
| 118 |
st.button("Previous", on_click=turn_page, args=("prev",))
|
| 119 |
+
|
| 120 |
+
# Center aligned text in col2
|
| 121 |
with col2:
|
| 122 |
+
st.markdown(
|
| 123 |
+
f'<div style="display: flex; justify-content: center; align-items: center; height: 100%;">'
|
| 124 |
+
f'Page {st.session_state.page_index + 1} of {len(summ_text)}'
|
| 125 |
+
f'</div>',
|
| 126 |
+
unsafe_allow_html=True
|
| 127 |
+
)
|
| 128 |
+
|
| 129 |
+
# Next button in col3, right aligned
|
| 130 |
+
with col3:
|
| 131 |
+
st.markdown(
|
| 132 |
+
f'<div style="display: flex; justify-content: flex-end; align-items: center; height: 100%;">'
|
| 133 |
+
f'<button onclick="window.location.reload();">Next</button>'
|
| 134 |
+
f'</div>',
|
| 135 |
+
unsafe_allow_html=True
|
| 136 |
+
)
|
| 137 |
|
| 138 |
# Display HTML box
|
| 139 |
st.markdown(render_html(st.session_state.current_text), unsafe_allow_html=True)
|