Update modules/ui/ui.py
Browse files- modules/ui/ui.py +49 -1
modules/ui/ui.py
CHANGED
|
@@ -8,6 +8,54 @@ import logging
|
|
| 8 |
logging.basicConfig(level=logging.INFO)
|
| 9 |
logger = logging.getLogger(__name__)
|
| 10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
def show_new_landing(lang_code, landing_t):
|
| 12 |
"""
|
| 13 |
Nueva landing page optimizada para conversi贸n
|
|
@@ -474,7 +522,7 @@ def main_new_landing():
|
|
| 474 |
show_new_landing(st.session_state.lang_code, landing_t)
|
| 475 |
|
| 476 |
# Exportar la funci贸n principal
|
| 477 |
-
__all__ = ['main_new_landing', 'show_new_landing']
|
| 478 |
|
| 479 |
if __name__ == "__main__":
|
| 480 |
main_new_landing()
|
|
|
|
| 8 |
logging.basicConfig(level=logging.INFO)
|
| 9 |
logger = logging.getLogger(__name__)
|
| 10 |
|
| 11 |
+
# Importaciones necesarias para mantener compatibilidad
|
| 12 |
+
try:
|
| 13 |
+
from session_state import initialize_session_state, logout
|
| 14 |
+
from translations import get_translations, get_landing_translations
|
| 15 |
+
from ..auth.auth import authenticate_user
|
| 16 |
+
from ..database.sql_db import store_application_request
|
| 17 |
+
except ImportError:
|
| 18 |
+
logger.warning("Algunas importaciones de compatibilidad fallaron"
|
| 19 |
+
|
| 20 |
+
# ============================================
|
| 21 |
+
# FUNCI脫N main() PARA MANTENER COMPATIBILIDAD
|
| 22 |
+
# ============================================
|
| 23 |
+
def main():
|
| 24 |
+
"""
|
| 25 |
+
Funci贸n main() de compatibilidad que redirige a la nueva landing
|
| 26 |
+
"""
|
| 27 |
+
logger.info("Entrando en main() - Nueva landing page")
|
| 28 |
+
|
| 29 |
+
# Inicializar estado b谩sico si no existe
|
| 30 |
+
if 'lang_code' not in st.session_state:
|
| 31 |
+
st.session_state.lang_code = 'es'
|
| 32 |
+
|
| 33 |
+
# Obtener traducciones
|
| 34 |
+
try:
|
| 35 |
+
from translations import get_landing_translations
|
| 36 |
+
landing_t = get_landing_translations(st.session_state.lang_code)
|
| 37 |
+
except:
|
| 38 |
+
# Traducciones por defecto si falla
|
| 39 |
+
landing_t = {
|
| 40 |
+
'login': 'Iniciar Sesi贸n',
|
| 41 |
+
'register': 'Registrarse',
|
| 42 |
+
'select_language': 'Idioma'
|
| 43 |
+
}
|
| 44 |
+
|
| 45 |
+
# Mostrar la nueva landing
|
| 46 |
+
show_new_landing(st.session_state.lang_code, landing_t)
|
| 47 |
+
|
| 48 |
+
# ============================================
|
| 49 |
+
# FUNCI脫N login_register_page PARA COMPATIBILIDAD
|
| 50 |
+
# ============================================
|
| 51 |
+
def login_register_page(lang_code, t):
|
| 52 |
+
"""
|
| 53 |
+
Funci贸n de compatibilidad que redirige a la nueva landing
|
| 54 |
+
"""
|
| 55 |
+
# Esta funci贸n ahora usa la nueva landing
|
| 56 |
+
show_new_landing(lang_code, t)
|
| 57 |
+
|
| 58 |
+
|
| 59 |
def show_new_landing(lang_code, landing_t):
|
| 60 |
"""
|
| 61 |
Nueva landing page optimizada para conversi贸n
|
|
|
|
| 522 |
show_new_landing(st.session_state.lang_code, landing_t)
|
| 523 |
|
| 524 |
# Exportar la funci贸n principal
|
| 525 |
+
__all__ = ['main', 'login_register_page', 'main_new_landing', 'show_new_landing']
|
| 526 |
|
| 527 |
if __name__ == "__main__":
|
| 528 |
main_new_landing()
|