Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -210,25 +210,24 @@ else:
|
|
210 |
|
211 |
# convert pandas df into list of dicts
|
212 |
shelters = shelters.to_dict(orient='records')
|
213 |
-
print(shelters)
|
214 |
-
print(type(shelters))
|
215 |
|
216 |
-
#
|
217 |
-
|
218 |
-
# st.write(shelter["description"])
|
219 |
|
220 |
-
|
221 |
-
# col1, col2 = st.columns([1,1])
|
222 |
|
223 |
-
#
|
224 |
-
|
225 |
-
# if st.button("Previous"):
|
226 |
-
# if st.session_state.shelter_index > 0:
|
227 |
-
# st.session_state.shelter_index -= 1
|
228 |
-
# st.experimental_rerun()
|
229 |
|
230 |
-
#
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
210 |
|
211 |
# convert pandas df into list of dicts
|
212 |
shelters = shelters.to_dict(orient='records')
|
|
|
|
|
213 |
|
214 |
+
# Display the current shelter information
|
215 |
+
shelter = shelters[st.session_state.shelter_index]
|
|
|
216 |
|
217 |
+
st.header(f"{shelter['Organization Name']}: {shelter['Program Name']}")
|
|
|
218 |
|
219 |
+
# Create two columns
|
220 |
+
col1, col2 = st.columns([1,1])
|
|
|
|
|
|
|
|
|
221 |
|
222 |
+
# Add buttons to each column
|
223 |
+
with col1:
|
224 |
+
if st.button("Previous"):
|
225 |
+
if st.session_state.shelter_index > 0:
|
226 |
+
st.session_state.shelter_index -= 1
|
227 |
+
st.experimental_rerun()
|
228 |
+
|
229 |
+
with col2:
|
230 |
+
if st.button("Next"):
|
231 |
+
if st.session_state.shelter_index < len(shelters) - 1:
|
232 |
+
st.session_state.shelter_index += 1
|
233 |
+
st.experimental_rerun()
|