Skip to content

Commit 6a4211b

Browse files
committed
#454 Subscribe to updates field
#454 Subscribe to updates field
1 parent dde6995 commit 6a4211b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/penn_chime/presentation.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,8 @@ def display_sidebar(st, d: Parameters) -> Parameters:
177177
# it's kindof like ember or angular if you are familiar with those
178178

179179
st_obj = st.sidebar
180+
# used_widget_key = st.get_last_used_widget_key ( )
181+
180182
current_hospitalized_input = NumberInput(
181183
st_obj,
182184
"Currently hospitalized COVID-19 patients",
@@ -353,6 +355,13 @@ def display_sidebar(st, d: Parameters) -> Parameters:
353355
max_y_axis = max_y_axis_input()
354356

355357
current_date = current_date_input()
358+
#Subscribe implementation
359+
st_obj.subheader ("Subscribe")
360+
email = st_obj.text_input (label="Enter Email", value="", key="na_lower_1")
361+
name = st_obj.text_input (label="Enter Name", value="", key="na_upper_1")
362+
affiliation = st_obj.text_input (label="Enter Affiliation", value="", key="na_upper_2")
363+
if st_obj.button (label="Submit", key="ta_submit_1"):
364+
send_subscription_to_google_sheet (email, name, affiliation)
356365

357366
return Parameters(
358367
current_hospitalized=current_hospitalized,
@@ -371,6 +380,9 @@ def display_sidebar(st, d: Parameters) -> Parameters:
371380
population=population,
372381
)
373382

383+
def send_subscription_to_google_sheet(email, name, affiliation):
384+
print ("send email:" + email + " name:" + name + " affiliation:" + affiliation + " to google sheet")
385+
#implement sending the data to googlesheet
374386

375387
def write_definitions(st):
376388
st.subheader("Guidance on Selecting Inputs")

0 commit comments

Comments
 (0)