AIdeaText commited on
Commit
9eba840
·
verified ·
1 Parent(s): d90619a

Update modules/ui/ui.py

Browse files
Files changed (1) hide show
  1. modules/ui/ui.py +56 -21
modules/ui/ui.py CHANGED
@@ -81,35 +81,70 @@ def login_register_page(lang_code, t):
81
  # Language selection dropdown at the top
82
  languages = {'Español': 'es', 'English': 'en', 'Français': 'fr', 'Português': 'pt'}
83
 
84
- # Create a container for the language selector and logos
85
- with st.container():
86
- col1, col2, col3 = st.columns([2, 2, 1])
87
-
88
- with col3:
89
- # Selector de idioma
90
- selected_lang = st.selectbox(
91
- landing_t['select_language'],
92
- list(languages.keys()),
93
- index=list(languages.values()).index(lang_code),
94
- key=f"landing_language_selector_{lang_code}"
95
- )
96
- new_lang_code = languages[selected_lang]
97
- if lang_code != new_lang_code:
98
- st.session_state.lang_code = new_lang_code
99
- st.rerun()
100
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
101
  # Main content with columns
102
  left_column, right_column = st.columns([1, 3])
103
-
104
  with left_column:
105
  tab1, tab2 = st.tabs([landing_t['login'], landing_t['register']])
106
-
107
  with tab1:
108
  login_form(lang_code, landing_t)
109
-
110
  with tab2:
111
  register_form(lang_code, landing_t)
112
-
113
  with right_column:
114
  display_videos_and_info(lang_code, landing_t)
115
 
 
81
  # Language selection dropdown at the top
82
  languages = {'Español': 'es', 'English': 'en', 'Français': 'fr', 'Português': 'pt'}
83
 
84
+ # Contenedor para los logos y selector de idioma alineados
85
+ st.html("""
86
+ <style>
87
+ .header-flex-container {
88
+ display: flex;
89
+ justify-content: space-between;
90
+ align-items: center;
91
+ margin-bottom: 20px;
92
+ width: 100%;
93
+ }
94
+ .logos-container {
95
+ display: flex;
96
+ align-items: center;
97
+ }
98
+ .aideatext-logo {
99
+ height: 70px;
100
+ margin-right: 20px;
101
+ }
102
+ .websummit-logo {
103
+ height: 50px;
104
+ }
105
+ /* Esto crea espacio para el selector de idiomas que se agregará con Streamlit */
106
+ .language-space {
107
+ width: 200px;
108
+ }
109
+ </style>
110
+ <div class="header-flex-container">
111
+ <div class="logos-container">
112
+ <a href="https://aideatext-v3.hf.space" target="_blank">
113
+ <img src="./assets/img/logo_92x92.png" class="aideatext-logo" alt="AIdeaText Logo">
114
+ </a>
115
+ <img src="./assets/img/websummit_rio_2025.png" class="websummit-logo" alt="WebSummit Alpha Program">
116
+ </div>
117
+ <div class="language-space"></div>
118
+ </div>
119
+ """, unsafe_allow_html=True)
120
+
121
+ # Colocar el selector de idiomas en la posición correcta
122
+ # Usamos columns y posicionamos el selector en la última columna
123
+ col1, col2, col3 = st.columns([5, 3, 2])
124
+ with col3:
125
+ selected_lang = st.selectbox(
126
+ landing_t['select_language'],
127
+ list(languages.keys()),
128
+ index=list(languages.values()).index(lang_code),
129
+ key=f"landing_language_selector_{lang_code}"
130
+ )
131
+ new_lang_code = languages[selected_lang]
132
+ if lang_code != new_lang_code:
133
+ st.session_state.lang_code = new_lang_code
134
+ st.rerun()
135
+
136
  # Main content with columns
137
  left_column, right_column = st.columns([1, 3])
138
+
139
  with left_column:
140
  tab1, tab2 = st.tabs([landing_t['login'], landing_t['register']])
141
+
142
  with tab1:
143
  login_form(lang_code, landing_t)
144
+
145
  with tab2:
146
  register_form(lang_code, landing_t)
147
+
148
  with right_column:
149
  display_videos_and_info(lang_code, landing_t)
150