James McCool
commited on
Commit
·
a11ceac
1
Parent(s):
35472d1
Enhance contest file upload interface in app.py
Browse files- Updated the layout of the contest file upload section to improve user feedback, including a new warning message prompting users to confirm data accuracy before sending to the database.
- Adjusted column widths for better visual organization and ensured that return messages are only displayed when applicable, enhancing overall user experience.
app.py
CHANGED
|
@@ -173,14 +173,17 @@ with tab1:
|
|
| 173 |
st.session_state['Contest'] = st.session_state['Contest'].dropna(how='all')
|
| 174 |
st.session_state['Contest'] = st.session_state['Contest'].reset_index(drop=True)
|
| 175 |
if st.session_state['Contest'] is not None:
|
| 176 |
-
success_col,
|
| 177 |
with success_col:
|
| 178 |
st.success('Contest file loaded successfully!')
|
|
|
|
|
|
|
| 179 |
with upload_col:
|
| 180 |
if st.button('Send file to Database?', key='export_contest_file'):
|
| 181 |
return_message = export_contest_file(db, sport_select, type_var, date_select, contest_id_map[contest_name_var], st.session_state['Contest_file'])
|
| 182 |
with message_col:
|
| 183 |
-
|
|
|
|
| 184 |
st.dataframe(st.session_state['Contest'].head(100))
|
| 185 |
|
| 186 |
if 'Contest_file' in st.session_state:
|
|
|
|
| 173 |
st.session_state['Contest'] = st.session_state['Contest'].dropna(how='all')
|
| 174 |
st.session_state['Contest'] = st.session_state['Contest'].reset_index(drop=True)
|
| 175 |
if st.session_state['Contest'] is not None:
|
| 176 |
+
success_col, info_col, upload_col, message_col = st.columns([1, 3, 1, 2])
|
| 177 |
with success_col:
|
| 178 |
st.success('Contest file loaded successfully!')
|
| 179 |
+
with info_col:
|
| 180 |
+
st.warning("If you have confirmed that the data is correct, you can send the CSV to the database to enrich Paydirt's sources and help us create actionable tools and algorithms >>")
|
| 181 |
with upload_col:
|
| 182 |
if st.button('Send file to Database?', key='export_contest_file'):
|
| 183 |
return_message = export_contest_file(db, sport_select, type_var, date_select, contest_id_map[contest_name_var], st.session_state['Contest_file'])
|
| 184 |
with message_col:
|
| 185 |
+
if return_message is not None:
|
| 186 |
+
st.info(return_message)
|
| 187 |
st.dataframe(st.session_state['Contest'].head(100))
|
| 188 |
|
| 189 |
if 'Contest_file' in st.session_state:
|