AIdeaText commited on
Commit
a8c36ca
verified
1 Parent(s): 97ebc0f

Update modules/ui/ui.py

Browse files
Files changed (1) hide show
  1. modules/ui/ui.py +49 -13
modules/ui/ui.py CHANGED
@@ -9,7 +9,7 @@ from dateutil.parser import parse
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
  #
@@ -75,23 +75,59 @@ def main():
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
  #############################################################
 
9
  #
10
  from session_state import initialize_session_state, logout
11
  #
12
+ from translations import get_translations, get_landing_translations
13
  #
14
  from ..auth.auth import authenticate_user, authenticate_student, authenticate_admin
15
  #
 
75
  #############################################################
76
  #############################################################
77
  def login_register_page(lang_code, t):
78
+ # Obtener traducciones espec铆ficas para landing page
79
+ landing_t = get_landing_translations(lang_code)
80
+
81
+ # Language selection dropdown at the top
82
+ languages = {'Espa帽ol': 'es', 'English': 'en', 'Fran莽ais': 'fr', 'Portugu锚s': 'pt'}
83
+
84
+ # Estilo personalizado para mejorar el espaciado y alineaci贸n
85
+ st.markdown("""
86
+ <style>
87
+ div.row-widget.stHorizontalBlock {
88
+ align-items: center;
89
+ }
90
+ </style>
91
+ """, unsafe_allow_html=True)
92
+
93
+ # Crear contenedor para logos y selector de idioma usando columnas de Streamlit
94
+ col1, col2, col3, col4, col5 = st.columns([0.25, 0.25, 1, 1, 1])
95
+
96
+ with col1:
97
+ # Logo de ALPHA
98
+ st.image("https://huggingface.co/spaces/AIdeaText/v3/resolve/main/assets/img/ALPHA_Startup%20Badges.png", width=100)
99
+
100
+ with col2:
101
+ # Logo de AIdeaText
102
+ st.image("https://huggingface.co/spaces/AIdeaText/v3/resolve/main/assets/img/AIdeaText_Logo_vectores.png", width=100)
103
+
104
+ with col5:
105
+ # Selector de idioma
106
+ selected_lang = st.selectbox(
107
+ landing_t['select_language'],
108
+ list(languages.keys()),
109
+ index=list(languages.values()).index(lang_code),
110
+ key=f"landing_language_selector_{lang_code}"
111
+ )
112
+ new_lang_code = languages[selected_lang]
113
+ if lang_code != new_lang_code:
114
+ st.session_state.lang_code = new_lang_code
115
+ st.rerun()
116
+
117
+ # Main content with columns
118
  left_column, right_column = st.columns([1, 3])
119
+
120
  with left_column:
121
+ tab1, tab2 = st.tabs([landing_t['login'], landing_t['register']])
122
+
 
123
  with tab1:
124
+ login_form(lang_code, landing_t)
125
+
126
  with tab2:
127
+ register_form(lang_code, landing_t)
128
+
129
  with right_column:
130
+ display_videos_and_info(lang_code, landing_t)
131
 
132
  #############################################################
133
  #############################################################