Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -116,6 +116,7 @@ def reset_selections():
|
|
116 |
if menu == "Poll":
|
117 |
st.title("Breakfast Poll Application")
|
118 |
|
|
|
119 |
if st.session_state.step == 1:
|
120 |
st.header("Step 1: Enter your name")
|
121 |
name = st.text_input("Name:")
|
@@ -123,7 +124,8 @@ if menu == "Poll":
|
|
123 |
st.session_state.users.append(name)
|
124 |
st.session_state.step = 2
|
125 |
|
126 |
-
|
|
|
127 |
st.header("Step 2: Select your drink(s)")
|
128 |
drinks_options = [
|
129 |
"Café con leche", "Colacao", "Descafeinado con leche", "Cortado",
|
@@ -135,7 +137,8 @@ if menu == "Poll":
|
|
135 |
st.session_state.current_selections.append({"Name": st.session_state.users[-1], "Drinks": selected_drinks})
|
136 |
st.session_state.step = 3
|
137 |
|
138 |
-
|
|
|
139 |
st.header("Step 3: Select your food(s)")
|
140 |
food_options = [
|
141 |
"Barrita con aceite", "Barrita con tomate", "Palmera de chocolate",
|
@@ -149,6 +152,7 @@ if menu == "Poll":
|
|
149 |
upload_temp_file_to_repo()
|
150 |
st.success(f"Selections saved for {st.session_state.users[-1]}!")
|
151 |
st.session_state.step = 1
|
|
|
152 |
# "Current" view to display the current summary of all users' selections and submit to history
|
153 |
elif menu == "Current":
|
154 |
st.title("Current Selections of All Users")
|
|
|
116 |
if menu == "Poll":
|
117 |
st.title("Breakfast Poll Application")
|
118 |
|
119 |
+
# Step 1: Enter User's Name
|
120 |
if st.session_state.step == 1:
|
121 |
st.header("Step 1: Enter your name")
|
122 |
name = st.text_input("Name:")
|
|
|
124 |
st.session_state.users.append(name)
|
125 |
st.session_state.step = 2
|
126 |
|
127 |
+
# Step 2: Select Drinks
|
128 |
+
elif st.session_state.step == 2:
|
129 |
st.header("Step 2: Select your drink(s)")
|
130 |
drinks_options = [
|
131 |
"Café con leche", "Colacao", "Descafeinado con leche", "Cortado",
|
|
|
137 |
st.session_state.current_selections.append({"Name": st.session_state.users[-1], "Drinks": selected_drinks})
|
138 |
st.session_state.step = 3
|
139 |
|
140 |
+
# Step 3: Select Food
|
141 |
+
elif st.session_state.step == 3:
|
142 |
st.header("Step 3: Select your food(s)")
|
143 |
food_options = [
|
144 |
"Barrita con aceite", "Barrita con tomate", "Palmera de chocolate",
|
|
|
152 |
upload_temp_file_to_repo()
|
153 |
st.success(f"Selections saved for {st.session_state.users[-1]}!")
|
154 |
st.session_state.step = 1
|
155 |
+
|
156 |
# "Current" view to display the current summary of all users' selections and submit to history
|
157 |
elif menu == "Current":
|
158 |
st.title("Current Selections of All Users")
|