Spaces:
Running
Running
MarcosRodrigo
commited on
Commit
•
2f85f59
1
Parent(s):
0b20ff8
Update app.py
Browse files
app.py
CHANGED
@@ -156,30 +156,6 @@ if menu == "Poll":
|
|
156 |
st.success(f"Selections saved for {st.session_state.users[-1]}!")
|
157 |
st.session_state.step = 1 # Reset to step 1 for the next user
|
158 |
|
159 |
-
# "Current" view to display the current summary of all users' selections and submit to history
|
160 |
-
elif menu == "Current":
|
161 |
-
st.title("Current Selections of All Users")
|
162 |
-
if st.button("Reload Selections"):
|
163 |
-
download_temp_file_from_repo()
|
164 |
-
current_df = load_current_selections()
|
165 |
-
st.table(current_df)
|
166 |
-
|
167 |
-
if st.button("Submit Summary to History"):
|
168 |
-
timestamp = save_summary_to_history()
|
169 |
-
st.success(f"Summary saved to history at {timestamp}")
|
170 |
-
st.session_state.history = load_history()
|
171 |
-
|
172 |
-
# Clear local and remote current selections
|
173 |
-
if os.path.exists(TEMP_FILE):
|
174 |
-
os.remove(TEMP_FILE)
|
175 |
-
delete_file_from_repo(TEMP_FILE) # Delete the file from the remote repo
|
176 |
-
|
177 |
-
# Create an empty CSV to replace the deleted one
|
178 |
-
pd.DataFrame(columns=["Name", "Drinks", "Food"]).to_csv(TEMP_FILE, index=False)
|
179 |
-
upload_temp_file_to_repo()
|
180 |
-
|
181 |
-
# st.experimental_set_query_params(step="reset")
|
182 |
-
|
183 |
# History view to check past summaries
|
184 |
elif menu == "History":
|
185 |
st.title("Breakfast Poll History")
|
@@ -218,6 +194,28 @@ elif menu == "History":
|
|
218 |
# pd.DataFrame(columns=["Name", "Drinks", "Food"]).to_csv(TEMP_FILE, index=False)
|
219 |
# upload_temp_file_to_repo()
|
220 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
221 |
# "Current" view to display the current summary of all users' selections and generate ticket
|
222 |
elif menu == "Current":
|
223 |
st.title("Current Selections of All Users")
|
|
|
156 |
st.success(f"Selections saved for {st.session_state.users[-1]}!")
|
157 |
st.session_state.step = 1 # Reset to step 1 for the next user
|
158 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
159 |
# History view to check past summaries
|
160 |
elif menu == "History":
|
161 |
st.title("Breakfast Poll History")
|
|
|
194 |
# pd.DataFrame(columns=["Name", "Drinks", "Food"]).to_csv(TEMP_FILE, index=False)
|
195 |
# upload_temp_file_to_repo()
|
196 |
|
197 |
+
# # "Current" view to display the current summary of all users' selections and submit to history
|
198 |
+
# elif menu == "Current":
|
199 |
+
# st.title("Current Selections of All Users")
|
200 |
+
# if st.button("Reload Selections"):
|
201 |
+
# download_temp_file_from_repo()
|
202 |
+
# current_df = load_current_selections()
|
203 |
+
# st.table(current_df)
|
204 |
+
|
205 |
+
# if st.button("Submit Summary to History"):
|
206 |
+
# timestamp = save_summary_to_history()
|
207 |
+
# st.success(f"Summary saved to history at {timestamp}")
|
208 |
+
# st.session_state.history = load_history()
|
209 |
+
|
210 |
+
# # Clear local and remote current selections
|
211 |
+
# if os.path.exists(TEMP_FILE):
|
212 |
+
# os.remove(TEMP_FILE)
|
213 |
+
# delete_file_from_repo(TEMP_FILE) # Delete the file from the remote repo
|
214 |
+
|
215 |
+
# # Create an empty CSV to replace the deleted one
|
216 |
+
# pd.DataFrame(columns=["Name", "Drinks", "Food"]).to_csv(TEMP_FILE, index=False)
|
217 |
+
# upload_temp_file_to_repo()
|
218 |
+
|
219 |
# "Current" view to display the current summary of all users' selections and generate ticket
|
220 |
elif menu == "Current":
|
221 |
st.title("Current Selections of All Users")
|