Update modules/ui/ui.py
Browse files- modules/ui/ui.py +314 -310
modules/ui/ui.py
CHANGED
@@ -1,311 +1,315 @@
|
|
1 |
-
# modules/ui/ui.py
|
2 |
-
import streamlit as st
|
3 |
-
from streamlit_player import st_player
|
4 |
-
import logging
|
5 |
-
from datetime import datetime
|
6 |
-
from dateutil.parser import parse
|
7 |
-
|
8 |
-
# Importaciones locales
|
9 |
-
#
|
10 |
-
from session_state import initialize_session_state, logout
|
11 |
-
#
|
12 |
-
from translations import get_translations
|
13 |
-
#
|
14 |
-
from ..auth.auth import authenticate_user, authenticate_student, authenticate_admin
|
15 |
-
#
|
16 |
-
from ..database.sql_db import store_application_request
|
17 |
-
|
18 |
-
#from .user_page import user_page
|
19 |
-
try:
|
20 |
-
from .user_page import user_page
|
21 |
-
except ImportError:
|
22 |
-
logger.error("No se pudo importar user_page. Aseg煤rate de que el archivo existe.")
|
23 |
-
# Definir una funci贸n de respaldo
|
24 |
-
def user_page(lang_code, t):
|
25 |
-
st.error("La p谩gina de usuario no est谩 disponible. Por favor, contacta al administrador.")
|
26 |
-
|
27 |
-
from ..admin.admin_ui import admin_page
|
28 |
-
|
29 |
-
# Configuraci贸n del logger
|
30 |
-
logging.basicConfig(level=logging.INFO)
|
31 |
-
logger = logging.getLogger(__name__)
|
32 |
-
|
33 |
-
#############################################################
|
34 |
-
def main():
|
35 |
-
logger.info(f"Entrando en main() - P谩gina actual: {st.session_state.page}")
|
36 |
-
|
37 |
-
if 'nlp_models' not in st.session_state:
|
38 |
-
logger.error("Los modelos NLP no est谩n inicializados.")
|
39 |
-
st.error("Los modelos NLP no est谩n inicializados. Por favor, reinicie la aplicaci贸n.")
|
40 |
-
return
|
41 |
-
|
42 |
-
lang_code = st.session_state.get('lang_code', 'es')
|
43 |
-
t = get_translations(lang_code)
|
44 |
-
|
45 |
-
logger.info(f"P谩gina actual antes de la l贸gica de enrutamiento: {st.session_state.page}")
|
46 |
-
|
47 |
-
if st.session_state.get('logged_out', False):
|
48 |
-
st.session_state.logged_out = False
|
49 |
-
st.session_state.page = 'login'
|
50 |
-
st.rerun()
|
51 |
-
|
52 |
-
if not st.session_state.get('logged_in', False):
|
53 |
-
logger.info("Usuario no ha iniciado sesi贸n. Mostrando p谩gina de login/registro")
|
54 |
-
login_register_page(lang_code, t)
|
55 |
-
elif st.session_state.page == 'user':
|
56 |
-
if st.session_state.role == 'Administrador':
|
57 |
-
logger.info("Redirigiendo a la p谩gina de administrador")
|
58 |
-
st.session_state.page = 'Admin'
|
59 |
-
st.rerun()
|
60 |
-
else:
|
61 |
-
logger.info("Renderizando p谩gina de usuario")
|
62 |
-
user_page(lang_code, t)
|
63 |
-
elif st.session_state.page == "Admin":
|
64 |
-
logger.info("Renderizando p谩gina de administrador")
|
65 |
-
admin_page()
|
66 |
-
else:
|
67 |
-
logger.error(f"P谩gina no reconocida: {st.session_state.page}")
|
68 |
-
st.error(t.get('unrecognized_page', 'P谩gina no reconocida'))
|
69 |
-
# Redirigir a la p谩gina de usuario en caso de error
|
70 |
-
st.session_state.page = 'user'
|
71 |
-
st.rerun()
|
72 |
-
|
73 |
-
logger.info(f"Saliendo de main() - Estado final de la sesi贸n: {st.session_state}")
|
74 |
-
|
75 |
-
#############################################################
|
76 |
-
#############################################################
|
77 |
-
def login_register_page(lang_code, t):
|
78 |
-
# st.title("AIdeaText")
|
79 |
-
# st.write(t.get("welcome_message", "Bienvenido. Por favor, inicie sesi贸n o reg铆strese."))
|
80 |
-
|
81 |
-
left_column, right_column = st.columns([1, 3])
|
82 |
-
|
83 |
-
with left_column:
|
84 |
-
tab1, tab2 = st.tabs([t.get("login", "Iniciar Sesi贸n"),
|
85 |
-
t.get("register", "Registrarse")])
|
86 |
-
|
87 |
-
with tab1:
|
88 |
-
login_form(lang_code, t)
|
89 |
-
|
90 |
-
with tab2:
|
91 |
-
register_form(lang_code, t)
|
92 |
-
|
93 |
-
with right_column:
|
94 |
-
display_videos_and_info(lang_code, t)
|
95 |
-
|
96 |
-
#############################################################
|
97 |
-
#############################################################
|
98 |
-
def login_form(lang_code, t):
|
99 |
-
with st.form("login_form"):
|
100 |
-
username = st.text_input(t.get("email", "Correo electr贸nico"))
|
101 |
-
password = st.text_input(t.get("password", "Contrase帽a"), type="password")
|
102 |
-
submit_button = st.form_submit_button(t.get("login", "Iniciar Sesi贸n"))
|
103 |
-
|
104 |
-
if submit_button:
|
105 |
-
success, role = authenticate_user(username, password)
|
106 |
-
if success:
|
107 |
-
st.session_state.logged_in = True
|
108 |
-
st.session_state.username = username
|
109 |
-
st.session_state.role = role
|
110 |
-
if role == 'Administrador':
|
111 |
-
st.session_state.page = 'Admin'
|
112 |
-
else:
|
113 |
-
st.session_state.page = 'user'
|
114 |
-
logger.info(f"Usuario autenticado: {username}, Rol: {role}")
|
115 |
-
st.rerun()
|
116 |
-
else:
|
117 |
-
st.error(t.get("invalid_credentials", "Credenciales incorrectas"))
|
118 |
-
|
119 |
-
|
120 |
-
#############################################################
|
121 |
-
#############################################################
|
122 |
-
def register_form(lang_code, t):
|
123 |
-
# st.header(t.get("request_trial", "Solicitar prueba de la aplicaci贸n"))
|
124 |
-
name = st.text_input(t.get("name", "Nombre"))
|
125 |
-
lastname = st.text_input(t.get("lastname", "Apellidos"))
|
126 |
-
institution = st.text_input(t.get("institution", "Instituci贸n"))
|
127 |
-
current_role = st.selectbox(t.get("current_role", "Rol en la instituci贸n donde labora"),
|
128 |
-
[t.get("professor", "Profesor"), t.get("student", "Estudiante"), t.get("administrative", "Administrativo")])
|
129 |
-
|
130 |
-
# Definimos el rol por defecto como estudiante
|
131 |
-
desired_role = t.get("student", "Estudiante")
|
132 |
-
|
133 |
-
email = st.text_input(t.get("institutional_email", "Correo electr贸nico de su instituci贸n"))
|
134 |
-
reason = st.text_area(t.get("interest_reason", "驴Por qu茅 est谩s interesado en probar AIdeaText?"))
|
135 |
-
|
136 |
-
if st.button(t.get("submit_application", "Enviar solicitud")):
|
137 |
-
logger.info(f"Attempting to submit application for {email}")
|
138 |
-
logger.debug(f"Form data: name={name}, lastname={lastname}, email={email}, institution={institution}, current_role={current_role}, desired_role={desired_role}, reason={reason}")
|
139 |
-
|
140 |
-
if not name or not lastname or not email or not institution or not reason:
|
141 |
-
logger.warning("Incomplete form submission")
|
142 |
-
st.error(t.get("complete_all_fields", "Por favor, completa todos los campos."))
|
143 |
-
elif not is_institutional_email(email):
|
144 |
-
logger.warning(f"Non-institutional email used: {email}")
|
145 |
-
st.error(t.get("use_institutional_email", "Por favor, utiliza un correo electr贸nico institucional."))
|
146 |
-
else:
|
147 |
-
logger.info(f"Attempting to store application for {email}")
|
148 |
-
success = store_application_request(name, lastname, email, institution, current_role, desired_role, reason)
|
149 |
-
if success:
|
150 |
-
st.success(t.get("application_sent", "Tu solicitud ha sido enviada. Te contactaremos pronto."))
|
151 |
-
logger.info(f"Application request stored successfully for {email}")
|
152 |
-
else:
|
153 |
-
st.error(t.get("application_error", "Hubo un problema al enviar tu solicitud. Por favor, intenta de nuevo m谩s tarde."))
|
154 |
-
logger.error(f"Failed to store application request for {email}")
|
155 |
-
|
156 |
-
|
157 |
-
#############################################################
|
158 |
-
#############################################################
|
159 |
-
def is_institutional_email(email):
|
160 |
-
forbidden_domains = ['gmail.com', 'hotmail.com', 'yahoo.com', 'outlook.com']
|
161 |
-
return not any(domain in email.lower() for domain in forbidden_domains)
|
162 |
-
|
163 |
-
|
164 |
-
#############################################################
|
165 |
-
#############################################################
|
166 |
-
def display_videos_and_info(lang_code, t):
|
167 |
-
# Crear tabs para cada secci贸n
|
168 |
-
tab_use_case, tab_videos, tab_events, tab_gallery, tab_news = st.tabs([
|
169 |
-
"Casos de uso",
|
170 |
-
"Videos de presentaciones",
|
171 |
-
"Ponencias acad茅micas",
|
172 |
-
"Fotos de eventos",
|
173 |
-
"Control de versiones"
|
174 |
-
])
|
175 |
-
|
176 |
-
# Tab de Casos de uso
|
177 |
-
with tab_use_case:
|
178 |
-
use_case_videos = {
|
179 |
-
"English - Radar use chart": "https://youtu.be/fFbbtlIewgs",
|
180 |
-
"English - Use AI Bot and arcs charts fuctions": "https://youtu.be/XjM-1oOl-ao",
|
181 |
-
"English - Arcs use charts, example 1": "https://youtu.be/PdK_bgigVaM",
|
182 |
-
"English - Arcs use charts, excample 2": "https://youtu.be/7uaV1njPOng",
|
183 |
-
"Espa帽ol - Uso del diagrama radar para verificar redacci贸n": "https://www.youtube.com/watch?v=nJP6xscPLBU",
|
184 |
-
"Espa帽ol - Uso de los diagramas de arco, ejemplo 1": "https://www.youtube.com/watch?v=ApBIAr2S-bE",
|
185 |
-
"Espa帽ol - Uso de los diagramas de arco, ejemplo 2": "https://www.youtube.com/watch?v=JnP2U1Fm0rc",
|
186 |
-
"Espa帽ol - Uso de los diagramas de arco, ejemplo 3": "https://www.youtube.com/watch?v=waWWwPTaI-Y",
|
187 |
-
"Espa帽ol - Uso del bot para buscar respuestas" : "https://www.youtube.com/watch?v=GFKDS0K2s7E"
|
188 |
-
}
|
189 |
-
|
190 |
-
selected_title = st.selectbox("Selecciona un caso de uso en espa帽ol o en ingl茅s:", list(use_case_videos.keys()))
|
191 |
-
if selected_title in use_case_videos:
|
192 |
-
try:
|
193 |
-
st_player(use_case_videos[selected_title])
|
194 |
-
except Exception as e:
|
195 |
-
st.error(f"Error al cargar el video: {str(e)}")
|
196 |
-
|
197 |
-
# Tab de Videos
|
198 |
-
with tab_videos:
|
199 |
-
videos = {
|
200 |
-
"Reel AIdeaText": "https://youtu.be/hXnwUvN1Q9Q",
|
201 |
-
"Presentaci贸n en SENDA, UNAM. Ciudad de M茅xico, M茅xico" : "https://www.youtube.com/watch?v=XFLvjST2cE0",
|
202 |
-
"Presentaci贸n en PyCon 2024. Colombia, Medell铆n": "https://www.youtube.com/watch?v=Jn545-IKx5Q",
|
203 |
-
"Presentaci贸n en la Fundaci贸n Ser Maaestro. Lima, Per煤": "https://www.youtube.com/watch?v=imc4TI1q164",
|
204 |
-
"Presentaci贸n en el programa de incubaci贸n Explora del IFE, TEC de Monterrey, Nuevo Le贸n, M茅xico": "https://www.youtube.com/watch?v=Fqi4Di_Rj_s",
|
205 |
-
"Entrevista con el Dr. Guillermo Ru铆z. Lima, Per煤": "https://www.youtube.com/watch?v=_ch8cRja3oc",
|
206 |
-
"Demo de la versi贸n de escritorio.": "https://www.youtube.com/watch?v=nP6eXbog-ZY"
|
207 |
-
}
|
208 |
-
|
209 |
-
selected_title = st.selectbox("Selecciona una conferencia:", list(videos.keys()))
|
210 |
-
if selected_title in videos:
|
211 |
-
try:
|
212 |
-
st_player(videos[selected_title])
|
213 |
-
except Exception as e:
|
214 |
-
st.error(f"Error al cargar el video: {str(e)}")
|
215 |
-
|
216 |
-
# Tab de Eventos
|
217 |
-
with tab_events:
|
218 |
-
st.markdown("""
|
219 |
-
## 2025
|
220 |
-
|
221 |
-
**El Agente Cognitivo Vinculante como Innovaci贸n en el Aprendizaje Adaptativo: el caso de AIdeaText**
|
222 |
-
IFE CONFERENCE 2025. Organizado por el Instituto para el Futuro de la Educaci贸n del TEC de Monterrey.
|
223 |
-
Nuevo Le贸n, M茅xico. Del 28 al 30 enero 2025
|
224 |
-
|
225 |
-
## 2024
|
226 |
-
[1]
|
227 |
-
AIdeaText, AIdeaText, recurso digital que emplea la t茅cnica de An谩lisis de Resonancia Central para perfeccionar textos acad茅micos**
|
228 |
-
V Temporada SENDA - Organizado por el Seminario de Entornos y Narrativas Digitales en la Academia del
|
229 |
-
Instituto de Investigaciones Antropol贸gicas (IIA) de la Universidad Auton贸ma de M茅xico (UNAM). 22 noviembre 2024
|
230 |
-
|
231 |
-
[2]
|
232 |
-
Aproximaci贸n al Agente Cognitivo Vinculante (ACV) desde la Teor铆a del Actor Red (TAR)**
|
233 |
-
Congreso HeETI 2024: Horizontes Expandidos de la Educaci贸n, la Tecnolog铆a y la Innovaci贸n
|
234 |
-
Universidad el Claustro de Sor Juana. Del 25 al 27 septiembre 2024
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
|
|
|
|
|
|
|
|
311 |
main()
|
|
|
1 |
+
# modules/ui/ui.py
|
2 |
+
import streamlit as st
|
3 |
+
from streamlit_player import st_player
|
4 |
+
import logging
|
5 |
+
from datetime import datetime
|
6 |
+
from dateutil.parser import parse
|
7 |
+
|
8 |
+
# Importaciones locales
|
9 |
+
#
|
10 |
+
from session_state import initialize_session_state, logout
|
11 |
+
#
|
12 |
+
from translations import get_translations
|
13 |
+
#
|
14 |
+
from ..auth.auth import authenticate_user, authenticate_student, authenticate_admin
|
15 |
+
#
|
16 |
+
from ..database.sql_db import store_application_request
|
17 |
+
|
18 |
+
#from .user_page import user_page
|
19 |
+
try:
|
20 |
+
from .user_page import user_page
|
21 |
+
except ImportError:
|
22 |
+
logger.error("No se pudo importar user_page. Aseg煤rate de que el archivo existe.")
|
23 |
+
# Definir una funci贸n de respaldo
|
24 |
+
def user_page(lang_code, t):
|
25 |
+
st.error("La p谩gina de usuario no est谩 disponible. Por favor, contacta al administrador.")
|
26 |
+
|
27 |
+
from ..admin.admin_ui import admin_page
|
28 |
+
|
29 |
+
# Configuraci贸n del logger
|
30 |
+
logging.basicConfig(level=logging.INFO)
|
31 |
+
logger = logging.getLogger(__name__)
|
32 |
+
|
33 |
+
#############################################################
|
34 |
+
def main():
|
35 |
+
logger.info(f"Entrando en main() - P谩gina actual: {st.session_state.page}")
|
36 |
+
|
37 |
+
if 'nlp_models' not in st.session_state:
|
38 |
+
logger.error("Los modelos NLP no est谩n inicializados.")
|
39 |
+
st.error("Los modelos NLP no est谩n inicializados. Por favor, reinicie la aplicaci贸n.")
|
40 |
+
return
|
41 |
+
|
42 |
+
lang_code = st.session_state.get('lang_code', 'es')
|
43 |
+
t = get_translations(lang_code)
|
44 |
+
|
45 |
+
logger.info(f"P谩gina actual antes de la l贸gica de enrutamiento: {st.session_state.page}")
|
46 |
+
|
47 |
+
if st.session_state.get('logged_out', False):
|
48 |
+
st.session_state.logged_out = False
|
49 |
+
st.session_state.page = 'login'
|
50 |
+
st.rerun()
|
51 |
+
|
52 |
+
if not st.session_state.get('logged_in', False):
|
53 |
+
logger.info("Usuario no ha iniciado sesi贸n. Mostrando p谩gina de login/registro")
|
54 |
+
login_register_page(lang_code, t)
|
55 |
+
elif st.session_state.page == 'user':
|
56 |
+
if st.session_state.role == 'Administrador':
|
57 |
+
logger.info("Redirigiendo a la p谩gina de administrador")
|
58 |
+
st.session_state.page = 'Admin'
|
59 |
+
st.rerun()
|
60 |
+
else:
|
61 |
+
logger.info("Renderizando p谩gina de usuario")
|
62 |
+
user_page(lang_code, t)
|
63 |
+
elif st.session_state.page == "Admin":
|
64 |
+
logger.info("Renderizando p谩gina de administrador")
|
65 |
+
admin_page()
|
66 |
+
else:
|
67 |
+
logger.error(f"P谩gina no reconocida: {st.session_state.page}")
|
68 |
+
st.error(t.get('unrecognized_page', 'P谩gina no reconocida'))
|
69 |
+
# Redirigir a la p谩gina de usuario en caso de error
|
70 |
+
st.session_state.page = 'user'
|
71 |
+
st.rerun()
|
72 |
+
|
73 |
+
logger.info(f"Saliendo de main() - Estado final de la sesi贸n: {st.session_state}")
|
74 |
+
|
75 |
+
#############################################################
|
76 |
+
#############################################################
|
77 |
+
def login_register_page(lang_code, t):
|
78 |
+
# st.title("AIdeaText")
|
79 |
+
# st.write(t.get("welcome_message", "Bienvenido. Por favor, inicie sesi贸n o reg铆strese."))
|
80 |
+
|
81 |
+
left_column, right_column = st.columns([1, 3])
|
82 |
+
|
83 |
+
with left_column:
|
84 |
+
tab1, tab2 = st.tabs([t.get("login", "Iniciar Sesi贸n"),
|
85 |
+
t.get("register", "Registrarse")])
|
86 |
+
|
87 |
+
with tab1:
|
88 |
+
login_form(lang_code, t)
|
89 |
+
|
90 |
+
with tab2:
|
91 |
+
register_form(lang_code, t)
|
92 |
+
|
93 |
+
with right_column:
|
94 |
+
display_videos_and_info(lang_code, t)
|
95 |
+
|
96 |
+
#############################################################
|
97 |
+
#############################################################
|
98 |
+
def login_form(lang_code, t):
|
99 |
+
with st.form("login_form"):
|
100 |
+
username = st.text_input(t.get("email", "Correo electr贸nico"))
|
101 |
+
password = st.text_input(t.get("password", "Contrase帽a"), type="password")
|
102 |
+
submit_button = st.form_submit_button(t.get("login", "Iniciar Sesi贸n"))
|
103 |
+
|
104 |
+
if submit_button:
|
105 |
+
success, role = authenticate_user(username, password)
|
106 |
+
if success:
|
107 |
+
st.session_state.logged_in = True
|
108 |
+
st.session_state.username = username
|
109 |
+
st.session_state.role = role
|
110 |
+
if role == 'Administrador':
|
111 |
+
st.session_state.page = 'Admin'
|
112 |
+
else:
|
113 |
+
st.session_state.page = 'user'
|
114 |
+
logger.info(f"Usuario autenticado: {username}, Rol: {role}")
|
115 |
+
st.rerun()
|
116 |
+
else:
|
117 |
+
st.error(t.get("invalid_credentials", "Credenciales incorrectas"))
|
118 |
+
|
119 |
+
|
120 |
+
#############################################################
|
121 |
+
#############################################################
|
122 |
+
def register_form(lang_code, t):
|
123 |
+
# st.header(t.get("request_trial", "Solicitar prueba de la aplicaci贸n"))
|
124 |
+
name = st.text_input(t.get("name", "Nombre"))
|
125 |
+
lastname = st.text_input(t.get("lastname", "Apellidos"))
|
126 |
+
institution = st.text_input(t.get("institution", "Instituci贸n"))
|
127 |
+
current_role = st.selectbox(t.get("current_role", "Rol en la instituci贸n donde labora"),
|
128 |
+
[t.get("professor", "Profesor"), t.get("student", "Estudiante"), t.get("administrative", "Administrativo")])
|
129 |
+
|
130 |
+
# Definimos el rol por defecto como estudiante
|
131 |
+
desired_role = t.get("student", "Estudiante")
|
132 |
+
|
133 |
+
email = st.text_input(t.get("institutional_email", "Correo electr贸nico de su instituci贸n"))
|
134 |
+
reason = st.text_area(t.get("interest_reason", "驴Por qu茅 est谩s interesado en probar AIdeaText?"))
|
135 |
+
|
136 |
+
if st.button(t.get("submit_application", "Enviar solicitud")):
|
137 |
+
logger.info(f"Attempting to submit application for {email}")
|
138 |
+
logger.debug(f"Form data: name={name}, lastname={lastname}, email={email}, institution={institution}, current_role={current_role}, desired_role={desired_role}, reason={reason}")
|
139 |
+
|
140 |
+
if not name or not lastname or not email or not institution or not reason:
|
141 |
+
logger.warning("Incomplete form submission")
|
142 |
+
st.error(t.get("complete_all_fields", "Por favor, completa todos los campos."))
|
143 |
+
elif not is_institutional_email(email):
|
144 |
+
logger.warning(f"Non-institutional email used: {email}")
|
145 |
+
st.error(t.get("use_institutional_email", "Por favor, utiliza un correo electr贸nico institucional."))
|
146 |
+
else:
|
147 |
+
logger.info(f"Attempting to store application for {email}")
|
148 |
+
success = store_application_request(name, lastname, email, institution, current_role, desired_role, reason)
|
149 |
+
if success:
|
150 |
+
st.success(t.get("application_sent", "Tu solicitud ha sido enviada. Te contactaremos pronto."))
|
151 |
+
logger.info(f"Application request stored successfully for {email}")
|
152 |
+
else:
|
153 |
+
st.error(t.get("application_error", "Hubo un problema al enviar tu solicitud. Por favor, intenta de nuevo m谩s tarde."))
|
154 |
+
logger.error(f"Failed to store application request for {email}")
|
155 |
+
|
156 |
+
|
157 |
+
#############################################################
|
158 |
+
#############################################################
|
159 |
+
def is_institutional_email(email):
|
160 |
+
forbidden_domains = ['gmail.com', 'hotmail.com', 'yahoo.com', 'outlook.com']
|
161 |
+
return not any(domain in email.lower() for domain in forbidden_domains)
|
162 |
+
|
163 |
+
|
164 |
+
#############################################################
|
165 |
+
#############################################################
|
166 |
+
def display_videos_and_info(lang_code, t):
|
167 |
+
# Crear tabs para cada secci贸n
|
168 |
+
tab_use_case, tab_videos, tab_events, tab_gallery, tab_news = st.tabs([
|
169 |
+
"Casos de uso",
|
170 |
+
"Videos de presentaciones",
|
171 |
+
"Ponencias acad茅micas",
|
172 |
+
"Fotos de eventos",
|
173 |
+
"Control de versiones"
|
174 |
+
])
|
175 |
+
|
176 |
+
# Tab de Casos de uso
|
177 |
+
with tab_use_case:
|
178 |
+
use_case_videos = {
|
179 |
+
"English - Radar use chart": "https://youtu.be/fFbbtlIewgs",
|
180 |
+
"English - Use AI Bot and arcs charts fuctions": "https://youtu.be/XjM-1oOl-ao",
|
181 |
+
"English - Arcs use charts, example 1": "https://youtu.be/PdK_bgigVaM",
|
182 |
+
"English - Arcs use charts, excample 2": "https://youtu.be/7uaV1njPOng",
|
183 |
+
"Espa帽ol - Uso del diagrama radar para verificar redacci贸n": "https://www.youtube.com/watch?v=nJP6xscPLBU",
|
184 |
+
"Espa帽ol - Uso de los diagramas de arco, ejemplo 1": "https://www.youtube.com/watch?v=ApBIAr2S-bE",
|
185 |
+
"Espa帽ol - Uso de los diagramas de arco, ejemplo 2": "https://www.youtube.com/watch?v=JnP2U1Fm0rc",
|
186 |
+
"Espa帽ol - Uso de los diagramas de arco, ejemplo 3": "https://www.youtube.com/watch?v=waWWwPTaI-Y",
|
187 |
+
"Espa帽ol - Uso del bot para buscar respuestas" : "https://www.youtube.com/watch?v=GFKDS0K2s7E"
|
188 |
+
}
|
189 |
+
|
190 |
+
selected_title = st.selectbox("Selecciona un caso de uso en espa帽ol o en ingl茅s:", list(use_case_videos.keys()))
|
191 |
+
if selected_title in use_case_videos:
|
192 |
+
try:
|
193 |
+
st_player(use_case_videos[selected_title])
|
194 |
+
except Exception as e:
|
195 |
+
st.error(f"Error al cargar el video: {str(e)}")
|
196 |
+
|
197 |
+
# Tab de Videos
|
198 |
+
with tab_videos:
|
199 |
+
videos = {
|
200 |
+
"Reel AIdeaText": "https://youtu.be/hXnwUvN1Q9Q",
|
201 |
+
"Presentaci贸n en SENDA, UNAM. Ciudad de M茅xico, M茅xico" : "https://www.youtube.com/watch?v=XFLvjST2cE0",
|
202 |
+
"Presentaci贸n en PyCon 2024. Colombia, Medell铆n": "https://www.youtube.com/watch?v=Jn545-IKx5Q",
|
203 |
+
"Presentaci贸n en la Fundaci贸n Ser Maaestro. Lima, Per煤": "https://www.youtube.com/watch?v=imc4TI1q164",
|
204 |
+
"Presentaci贸n en el programa de incubaci贸n Explora del IFE, TEC de Monterrey, Nuevo Le贸n, M茅xico": "https://www.youtube.com/watch?v=Fqi4Di_Rj_s",
|
205 |
+
"Entrevista con el Dr. Guillermo Ru铆z. Lima, Per煤": "https://www.youtube.com/watch?v=_ch8cRja3oc",
|
206 |
+
"Demo de la versi贸n de escritorio.": "https://www.youtube.com/watch?v=nP6eXbog-ZY"
|
207 |
+
}
|
208 |
+
|
209 |
+
selected_title = st.selectbox("Selecciona una conferencia:", list(videos.keys()))
|
210 |
+
if selected_title in videos:
|
211 |
+
try:
|
212 |
+
st_player(videos[selected_title])
|
213 |
+
except Exception as e:
|
214 |
+
st.error(f"Error al cargar el video: {str(e)}")
|
215 |
+
|
216 |
+
# Tab de Eventos
|
217 |
+
with tab_events:
|
218 |
+
st.markdown("""
|
219 |
+
## 2025
|
220 |
+
|
221 |
+
**El Agente Cognitivo Vinculante como Innovaci贸n en el Aprendizaje Adaptativo: el caso de AIdeaText**
|
222 |
+
IFE CONFERENCE 2025. Organizado por el Instituto para el Futuro de la Educaci贸n del TEC de Monterrey.
|
223 |
+
Nuevo Le贸n, M茅xico. Del 28 al 30 enero 2025
|
224 |
+
|
225 |
+
## 2024
|
226 |
+
[1]
|
227 |
+
AIdeaText, AIdeaText, recurso digital que emplea la t茅cnica de An谩lisis de Resonancia Central para perfeccionar textos acad茅micos**
|
228 |
+
V Temporada SENDA - Organizado por el Seminario de Entornos y Narrativas Digitales en la Academia del
|
229 |
+
Instituto de Investigaciones Antropol贸gicas (IIA) de la Universidad Auton贸ma de M茅xico (UNAM). 22 noviembre 2024
|
230 |
+
|
231 |
+
[2]
|
232 |
+
Aproximaci贸n al Agente Cognitivo Vinculante (ACV) desde la Teor铆a del Actor Red (TAR)**
|
233 |
+
Congreso HeETI 2024: Horizontes Expandidos de la Educaci贸n, la Tecnolog铆a y la Innovaci贸n
|
234 |
+
Universidad el Claustro de Sor Juana. Del 25 al 27 septiembre 2024
|
235 |
+
|
236 |
+
[3]
|
237 |
+
AIdeaText, visualizaci贸n de mapas sem谩nticos**
|
238 |
+
PyCon 2024, Organizado por el grupo de desarrolladores independientes de Python.
|
239 |
+
Universidad EAFIT, Medell铆n, Colombia. Del 7 al 9 de junio de 2024.
|
240 |
+
|
241 |
+
## 2023
|
242 |
+
**Aproximaci贸n al Agente Cognitivo Vinculante (ACV) desde la Teor铆a del Actor Red (TAR)**
|
243 |
+
[1]
|
244 |
+
XVII Congreso Nacional de Investigaci贸n Educativa - VII Encuentro de Estudiantes de Posgrado Educaci贸n.
|
245 |
+
Consejo Mexicano de Investigaci贸n Educativa (COMIE)
|
246 |
+
Villahermosa, Tabasco, M茅xico.
|
247 |
+
Del 4 al 8 de diciembre 2023
|
248 |
+
|
249 |
+
[2]
|
250 |
+
XXXI Encuentro Internacional de Educaci贸n a Distancia
|
251 |
+
Universidad de Guadalajara. Jalisco, M茅xico.
|
252 |
+
Del 27 al 30 noviembre 2023
|
253 |
+
|
254 |
+
[3]
|
255 |
+
IV Temporada SENDA - Seminario de Entornos y Narrativas Digitales en la Academia
|
256 |
+
Instituto de Investigaciones Antropol贸gicas (IIA), UNAM.
|
257 |
+
22 noviembre 2023
|
258 |
+
|
259 |
+
[4]
|
260 |
+
1er Congreso Internacional de Educaci贸n Digital
|
261 |
+
Instituto Polit茅cnico Nacional, sede Zacatecas. M茅xico.
|
262 |
+
Del 23 al 24 de noviembre de 2023
|
263 |
+
|
264 |
+
[5]
|
265 |
+
La cuesti贸n de la centralidad del maestro frente a las tecnolog铆as digitales generativas**
|
266 |
+
Innova F贸rum: Ecosistemas de Aprendizaje
|
267 |
+
Universidad de Guadalajara. Jalisco, M茅xico.
|
268 |
+
Del 16 al 18 de mayo 2023
|
269 |
+
""")
|
270 |
+
|
271 |
+
# Tab de Galer铆a
|
272 |
+
with tab_gallery:
|
273 |
+
# Contenedor con ancho m谩ximo
|
274 |
+
with st.container():
|
275 |
+
# Dividimos en dos columnas principales
|
276 |
+
col_left, col_right = st.columns(2)
|
277 |
+
|
278 |
+
# Columna izquierda: Foto 1 grande
|
279 |
+
with col_left:
|
280 |
+
# Foto 2 arriba
|
281 |
+
st.image("assets/img/socialmedia/_MG_2845.JPG",
|
282 |
+
caption="MakerFaire CDMX 2024",
|
283 |
+
width=480) # Ajusta este valor seg煤n necesites
|
284 |
+
# use_column_width=True)
|
285 |
+
|
286 |
+
# Foto 3 abajo
|
287 |
+
st.image("assets/img/socialmedia/Facebook_CoverPhoto-1_820x312.jpg",
|
288 |
+
caption="MakerFaire CDMX 2024",
|
289 |
+
width=480) # Ajusta este valor seg煤n necesites
|
290 |
+
# use_column_width=True)
|
291 |
+
|
292 |
+
# Columna derecha: Fotos 2 y 3 una encima de otra
|
293 |
+
with col_right:
|
294 |
+
st.image("assets/img/socialmedia/_MG_2790.jpg",
|
295 |
+
caption="MakerFaire CDMX 2024",
|
296 |
+
width=540) # Ajusta este valor seg煤n necesites
|
297 |
+
|
298 |
+
|
299 |
+
# Tab de Novedades
|
300 |
+
with tab_news:
|
301 |
+
st.markdown("""
|
302 |
+
### Novedades de la versi贸n actual
|
303 |
+
- Interfaz mejorada para una mejor experiencia de usuario
|
304 |
+
- Optimizaci贸n del an谩lisis morfosint谩ctico
|
305 |
+
- Soporte para m煤ltiples idiomas
|
306 |
+
- Nuevo m贸dulo de an谩lisis del discurso
|
307 |
+
- Sistema de chat integrado para soporte
|
308 |
+
""")
|
309 |
+
|
310 |
+
# Definici贸n de __all__ para especificar qu茅 se exporta
|
311 |
+
__all__ = ['main', 'login_register_page', 'initialize_session_state']
|
312 |
+
|
313 |
+
# Bloque de ejecuci贸n condicional
|
314 |
+
if __name__ == "__main__":
|
315 |
main()
|