Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -546,17 +546,22 @@ with st.expander("COMUNIDAD ACADÉMICA QUE PARTICIPÓ EN LA ELABORACIÓN DEL MIC
|
|
546 |
|
547 |
|
548 |
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
|
|
|
|
|
|
554 |
doc_buffer = crear_documento(variables['nombre_curso'], variables)
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
|
|
|
|
561 |
|
562 |
|
|
|
546 |
|
547 |
|
548 |
|
549 |
+
|
550 |
+
# Suponiendo que st.session_state ya contiene las variables necesarias
|
551 |
+
variables = st.session_state.to_dict()
|
552 |
+
variables['estrategias_didacticas'] = ', '.join(variables.get('estrategias_didacticas', []))
|
553 |
+
if "Otra(s)" in variables.get('estrategias_didacticas', '') and variables.get('estrategias_otras', ''):
|
554 |
+
variables['estrategias_didacticas'] += f", {variables['estrategias_otras']}"
|
555 |
+
|
556 |
+
def generar_documento():
|
557 |
doc_buffer = crear_documento(variables['nombre_curso'], variables)
|
558 |
+
return doc_buffer.getvalue()
|
559 |
+
|
560 |
+
st.download_button(
|
561 |
+
label="Descargar Microcurriculum",
|
562 |
+
data=generar_documento(),
|
563 |
+
file_name=f"Microcurriculum_{variables['nombre_curso']}.docx",
|
564 |
+
mime="application/vnd.openxmlformats-officedocument.wordprocessingml.document"
|
565 |
+
)
|
566 |
|
567 |
|