@@ -355,16 +355,9 @@ def display_sidebar(st, d: Parameters) -> Parameters:
355
355
max_y_axis = max_y_axis_input ()
356
356
357
357
current_date = current_date_input ()
358
- ####ToDo
359
358
#Subscribe implementation
360
- st_obj .subheader ("Subscribe" )
361
- email = st_obj .text_input (label = "Enter Email" , value = "" , key = "na_lower_1" )
362
- name = st_obj .text_input (label = "Enter Name" , value = "" , key = "na_upper_1" )
363
- affiliation = st_obj .text_input (label = "Enter Affiliation" , value = "" , key = "na_upper_2" )
364
- if st_obj .button (label = "Submit" , key = "ta_submit_1" ):
365
- send_subscription_to_google_sheet (st_obj , email , name , affiliation )
359
+ subscribe (st_obj )
366
360
367
- #####ToDo
368
361
return Parameters (
369
362
current_hospitalized = current_hospitalized ,
370
363
hospitalized = Disposition (hospitalized_rate , hospitalized_days ),
@@ -382,14 +375,18 @@ def display_sidebar(st, d: Parameters) -> Parameters:
382
375
population = population ,
383
376
)
384
377
385
- #ToDo
386
- def send_subscription_to_google_sheet (st_obj ,email , name , affiliation ):
387
- print ("send email:" + email + " name:" + name + " affiliation:" + affiliation + " to google sheet" )
388
- spr = sp .spreadsheet (st_obj , 'penn_chime/client_secret.json' )
389
- header = ["ContactEmail" ,"Name" ,"Affiliation" ]
390
- sheet = spr .createsheet ("SheetnameToDo" , header )
391
- row = [email ,name ,affiliation ]
392
- spr .writeToSheet (sheet , row )
378
+ def subscribe (st_obj ):
379
+ st_obj .subheader ("Subscribe" )
380
+ email = st_obj .text_input (label = "Enter Email" , value = "" , key = "na_lower_1" )
381
+ name = st_obj .text_input (label = "Enter Name" , value = "" , key = "na_upper_1" )
382
+ affiliation = st_obj .text_input (label = "Enter Affiliation" , value = "" , key = "na_upper_2" )
383
+ if st_obj .button (label = "Submit" , key = "ta_submit_1" ):
384
+ row = [email , name , affiliation ]
385
+ send_subscription_to_google_sheet (st_obj , row )
386
+
387
+ def send_subscription_to_google_sheet (st_obj , row ):
388
+ spr = sp .spreadsheet (st_obj , 'client_secret.json' )
389
+ spr .writeToSheet ("CHIME Form Submissions" , row )
393
390
394
391
def write_definitions (st ):
395
392
st .subheader ("Guidance on Selecting Inputs" )
@@ -400,7 +397,6 @@ def write_definitions(st):
400
397
)
401
398
)
402
399
403
-
404
400
def write_footer (st ):
405
401
st .subheader ("References & Acknowledgements" )
406
402
st .markdown (
0 commit comments