JoanGiner commited on
Commit
2ebedba
·
1 Parent(s): f2056f5
Files changed (1) hide show
  1. sdc_view.py +52 -53
sdc_view.py CHANGED
@@ -256,7 +256,7 @@ def render_sdc():
256
  st.rerun() # Rerun to update the interface
257
 
258
 
259
- unflattenedJson = unflatten(st.session_state["form_data"])
260
 
261
  ##
262
  ## Title
@@ -332,6 +332,7 @@ def render_sdc():
332
  with colt:
333
  if st.button("Load Besser's diversity card", type="secondary"):
334
  unflattenedJson = load_state()
 
335
  ##
336
  ## Master info
337
  ##
@@ -362,16 +363,15 @@ def render_sdc():
362
  if st.button("Add governament processes"):
363
  add_text_area(key)
364
  # Loop over the array and create a text area with a remove button for each element
365
- if 'governance' in unflattenedJson:
366
- if 'govProcesses' in unflattenedJson['governance']:
367
- for idx, processes in enumerate(unflattenedJson['governance']['govProcesses']):
368
- # Create two columns: one for the text area, one for the remove button
369
- col1, col2 = st.columns([6, 1])
370
- with col1:
371
- cached_text_area(f"Governament process {idx + 1}", f"governance_govProcesses_{idx}", "Specific the governance rules of the software project. For instance, the funders, or the role and the relation between the different bodies that governs the software.")
372
- with col2:
373
- if st.button("Remove", key=f"remove_{key}_{idx}"):
374
- remove_text_area(idx,key)
375
 
376
  # BODIES
377
  st.write("Add the different types of governament bodies of your software project (boards and funders)")
@@ -380,33 +380,32 @@ def render_sdc():
380
  if st.button("Add governament bodies"):
381
  add_text_area(key)
382
  # Loop over the array and create a text area with a remove button for each element
383
- if 'governance' in unflattenedJson:
384
- if 'bodies' in unflattenedJson['governance']:
385
- for idx, text in enumerate(unflattenedJson['governance']['bodies']):
386
- # Create two columns: one for the text area, one for the remove button
387
- with st.container(border=True):
388
- col1, col2 = st.columns([3, 2])
389
- with col1:
390
- cached_text_input("Body name", f"{key}_{idx}_name", "The name of id of the body")
391
- cached_text_area("Body description", f"{key}_{idx}_description", "A description of the body")
392
-
393
-
394
- with col2:
395
- cached_multiple_radio(f"{key}_{idx}_type", ['funders', 'directors', 'administrators', 'other'], f"Body role type" )
396
- if st.button("Remove", key=f"{key}_remove_{idx}"):
397
- remove_text_area(idx,f"{key}_remove_{idx}")
398
-
399
-
400
- with st.expander("If needed provide detailed information about the organizations or individuals involved in the governance", expanded=False):
401
- # Button to add a new text area
402
- org, individual = st.tabs([
403
- "Organization",
404
- "Individual",
405
- ])
406
- with individual:
407
- participant(f"{key}_{idx}_participant")
408
- with org:
409
- organization(f"{key}_{idx}_organization")
410
 
411
  with usageContext:
412
  colr, coll = st.columns([1, 1])
@@ -439,21 +438,21 @@ def render_sdc():
439
  if st.button("Add a team of participants"):
440
  add_text_area(key)
441
  # Loop over the array and create a text area with a remove button for each element
442
- if 'participants' in unflattenedJson:
443
- for idx, text in enumerate(unflattenedJson['participants']):
444
- # Create two columns: one for the text area, one for the remove button
445
- with st.container(border=True):
446
- col1, col2 = st.columns([2, 2])
447
- with col1:
448
- cached_text_input("Team name", f"{key}_{idx}_name", "The name of id of the team")
449
- cached_text_area("Team description", f"{key}_{idx}_description", "A description of the team")
450
-
451
-
452
- with col2:
453
- if st.button("Remove", key=f"{key}_remove_{idx}"):
454
- remove_text_area(idx,f"{key}_remove_{idx}")
455
- cached_multiple_radio(f"{key}_{idx}_type", ['Development Team', 'NonCoding Contributor', 'Tester Team', 'Public Reporter TEam'], f"Team role type" )
456
- team(f"{key}_{idx}")
457
 
458
 
459
 
 
256
  st.rerun() # Rerun to update the interface
257
 
258
 
259
+
260
 
261
  ##
262
  ## Title
 
332
  with colt:
333
  if st.button("Load Besser's diversity card", type="secondary"):
334
  unflattenedJson = load_state()
335
+
336
  ##
337
  ## Master info
338
  ##
 
363
  if st.button("Add governament processes"):
364
  add_text_area(key)
365
  # Loop over the array and create a text area with a remove button for each element
366
+
367
+ for idx, processes in enumerate(st.session_state[key]):
368
+ # Create two columns: one for the text area, one for the remove button
369
+ col1, col2 = st.columns([6, 1])
370
+ with col1:
371
+ cached_text_area(f"Governament process {idx + 1}", f"governance_govProcesses_{idx}", "Specific the governance rules of the software project. For instance, the funders, or the role and the relation between the different bodies that governs the software.")
372
+ with col2:
373
+ if st.button("Remove", key=f"remove_{key}_{idx}"):
374
+ remove_text_area(idx,key)
 
375
 
376
  # BODIES
377
  st.write("Add the different types of governament bodies of your software project (boards and funders)")
 
380
  if st.button("Add governament bodies"):
381
  add_text_area(key)
382
  # Loop over the array and create a text area with a remove button for each element
383
+
384
+ for idx, text in enumerate(st.session_state[key]):
385
+ # Create two columns: one for the text area, one for the remove button
386
+ with st.container(border=True):
387
+ col1, col2 = st.columns([3, 2])
388
+ with col1:
389
+ cached_text_input("Body name", f"{key}_{idx}_name", "The name of id of the body")
390
+ cached_text_area("Body description", f"{key}_{idx}_description", "A description of the body")
391
+
392
+
393
+ with col2:
394
+ cached_multiple_radio(f"{key}_{idx}_type", ['funders', 'directors', 'administrators', 'other'], f"Body role type" )
395
+ if st.button("Remove", key=f"{key}_remove_{idx}"):
396
+ remove_text_area(idx,f"{key}_remove_{idx}")
397
+
398
+
399
+ with st.expander("If needed provide detailed information about the organizations or individuals involved in the governance", expanded=False):
400
+ # Button to add a new text area
401
+ org, individual = st.tabs([
402
+ "Organization",
403
+ "Individual",
404
+ ])
405
+ with individual:
406
+ participant(f"{key}_{idx}_participant")
407
+ with org:
408
+ organization(f"{key}_{idx}_organization")
 
409
 
410
  with usageContext:
411
  colr, coll = st.columns([1, 1])
 
438
  if st.button("Add a team of participants"):
439
  add_text_area(key)
440
  # Loop over the array and create a text area with a remove button for each element
441
+
442
+ for idx, text in enumerate(st.session_state[key]):
443
+ # Create two columns: one for the text area, one for the remove button
444
+ with st.container(border=True):
445
+ col1, col2 = st.columns([2, 2])
446
+ with col1:
447
+ cached_text_input("Team name", f"{key}_{idx}_name", "The name of id of the team")
448
+ cached_text_area("Team description", f"{key}_{idx}_description", "A description of the team")
449
+
450
+
451
+ with col2:
452
+ if st.button("Remove", key=f"{key}_remove_{idx}"):
453
+ remove_text_area(idx,f"{key}_remove_{idx}")
454
+ cached_multiple_radio(f"{key}_{idx}_type", ['Development Team', 'NonCoding Contributor', 'Tester Team', 'Public Reporter TEam'], f"Team role type" )
455
+ team(f"{key}_{idx}")
456
 
457
 
458