Jon Solow
commited on
Commit
·
07e3fbe
1
Parent(s):
17ffde3
Put previous week selections in an expander
Browse files- src/pages/10_Set_Your_Lineup.py +26 -18
src/pages/10_Set_Your_Lineup.py
CHANGED
|
@@ -100,6 +100,27 @@ def update_and_save_selection(pos_label: str, selection_id: str):
|
|
| 100 |
st.rerun()
|
| 101 |
|
| 102 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 103 |
def get_page():
|
| 104 |
page_title = "Select Your Team"
|
| 105 |
st.set_page_config(page_title=page_title, page_icon=DEFAULT_ICON, layout="wide")
|
|
@@ -118,24 +139,11 @@ def get_page():
|
|
| 118 |
|
| 119 |
for week in range(1, 5):
|
| 120 |
st.header(PLAYOFF_WEEK_TO_NAME[week])
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
position_cell(week, "RB", 1, player_options, existing_selections)
|
| 127 |
-
with selection_cols[2]:
|
| 128 |
-
position_cell(week, "RB", 2, player_options, existing_selections)
|
| 129 |
-
with selection_cols[3]:
|
| 130 |
-
position_cell(week, "WR", 1, player_options, existing_selections)
|
| 131 |
-
with selection_cols[4]:
|
| 132 |
-
position_cell(week, "WR", 2, player_options, existing_selections)
|
| 133 |
-
with selection_cols[5]:
|
| 134 |
-
position_cell(week, "TE", 1, player_options, existing_selections)
|
| 135 |
-
with selection_cols[6]:
|
| 136 |
-
position_cell(week, "K", 1, player_options, existing_selections)
|
| 137 |
-
with selection_cols[7]:
|
| 138 |
-
position_cell(week, "DEF", 1, player_options, existing_selections)
|
| 139 |
|
| 140 |
set_selectbox_readonly()
|
| 141 |
|
|
|
|
| 100 |
st.rerun()
|
| 101 |
|
| 102 |
|
| 103 |
+
def week_selections(week, player_options, existing_selections):
|
| 104 |
+
selection_cols = st.columns(8)
|
| 105 |
+
|
| 106 |
+
with selection_cols[0]:
|
| 107 |
+
position_cell(week, "QB", 1, player_options, existing_selections)
|
| 108 |
+
with selection_cols[1]:
|
| 109 |
+
position_cell(week, "RB", 1, player_options, existing_selections)
|
| 110 |
+
with selection_cols[2]:
|
| 111 |
+
position_cell(week, "RB", 2, player_options, existing_selections)
|
| 112 |
+
with selection_cols[3]:
|
| 113 |
+
position_cell(week, "WR", 1, player_options, existing_selections)
|
| 114 |
+
with selection_cols[4]:
|
| 115 |
+
position_cell(week, "WR", 2, player_options, existing_selections)
|
| 116 |
+
with selection_cols[5]:
|
| 117 |
+
position_cell(week, "TE", 1, player_options, existing_selections)
|
| 118 |
+
with selection_cols[6]:
|
| 119 |
+
position_cell(week, "K", 1, player_options, existing_selections)
|
| 120 |
+
with selection_cols[7]:
|
| 121 |
+
position_cell(week, "DEF", 1, player_options, existing_selections)
|
| 122 |
+
|
| 123 |
+
|
| 124 |
def get_page():
|
| 125 |
page_title = "Select Your Team"
|
| 126 |
st.set_page_config(page_title=page_title, page_icon=DEFAULT_ICON, layout="wide")
|
|
|
|
| 139 |
|
| 140 |
for week in range(1, 5):
|
| 141 |
st.header(PLAYOFF_WEEK_TO_NAME[week])
|
| 142 |
+
if week < CURRENT_PLAYOFF_WEEK:
|
| 143 |
+
with st.expander("Show Previous Week"):
|
| 144 |
+
week_selections(week, player_options, existing_selections)
|
| 145 |
+
else:
|
| 146 |
+
week_selections(week, player_options, existing_selections)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 147 |
|
| 148 |
set_selectbox_readonly()
|
| 149 |
|