✨ (auth): Añade idioma y tema preferidos al usuario

- CurrentUser pasa de enum a struct con `id` opcional (anónimo = None) y
  preferencias de idioma, zona horaria y tema validadas en `with_*()`.
- `RequestLocale` tiene en cuenta el idioma preferido del usuario, y
  Context usa su tema si lo tiene (`default_theme()` en otro caso).
- Nuevos componentes `form::SelectLanguage`, `form::SelectTheme` y
  `form::SelectTimezone`, con `Timezone::supported_by_region()` para
  listar y validar las zonas IANA ofrecidas.
This commit is contained in:
Manuel Cillero 2026-10-04 23:09:07 +02:00
parent 35f2b66161
commit 70744a51a5
25 changed files with 1162 additions and 190 deletions

View file

@ -286,13 +286,13 @@ impl Contextual for Page {
self
}
fn with_template(mut self, template: TemplateRef) -> Self {
self.context.alter_template(template);
fn with_theme(mut self, theme: ThemeRef) -> Self {
self.context.alter_theme(theme);
self
}
fn with_theme(mut self, theme: ThemeRef) -> Self {
self.context.alter_theme(theme);
fn with_template(mut self, template: TemplateRef) -> Self {
self.context.alter_template(template);
self
}
@ -336,14 +336,14 @@ impl Contextual for Page {
self.context.timezone()
}
fn template(&self) -> TemplateRef {
self.context.template()
}
fn theme(&self) -> ThemeRef {
self.context.theme()
}
fn template(&self) -> TemplateRef {
self.context.template()
}
fn param<T: 'static>(&self, key: &'static str) -> Result<&T, ContextError> {
self.context.param(key)
}