♻️ Importa PageTop usando el prelude
This commit is contained in:
parent
8651b91ab2
commit
404739a3fd
31 changed files with 96 additions and 112 deletions
|
|
@ -1,6 +1,5 @@
|
|||
//! Handler HTTP para el perfil del propio usuario autenticado.
|
||||
|
||||
use pagetop::base::component::table::Row;
|
||||
use pagetop::prelude::*;
|
||||
|
||||
use crate::account::UserStatus;
|
||||
|
|
@ -47,32 +46,32 @@ async fn profile_details(user: &user::Model, status: UserStatus, cx: &mut Contex
|
|||
let mut table = Table::new()
|
||||
.with_prop(PropsOp::add_classes("user-admin-table"))
|
||||
.with_row(
|
||||
Row::new()
|
||||
table::Row::new()
|
||||
.with_cell(Lc::t("field-username-admin", &LOCALES_USER))
|
||||
.with_cell(user.username.as_str()),
|
||||
)
|
||||
.with_row(
|
||||
Row::new()
|
||||
table::Row::new()
|
||||
.with_cell(Lc::t("field-email", &LOCALES_USER))
|
||||
.with_cell(user.email.as_str()),
|
||||
)
|
||||
.with_row(
|
||||
Row::new()
|
||||
table::Row::new()
|
||||
.with_cell(Lc::t("field-display-name", &LOCALES_USER))
|
||||
.with_cell(user.display_name.as_deref().unwrap_or("-")),
|
||||
)
|
||||
.with_row(
|
||||
Row::new()
|
||||
table::Row::new()
|
||||
.with_cell(Lc::t("field-language", &LOCALES_USER))
|
||||
.with_cell(user.language.as_deref().unwrap_or("-")),
|
||||
)
|
||||
.with_row(
|
||||
Row::new()
|
||||
table::Row::new()
|
||||
.with_cell(Lc::t("field-timezone", &LOCALES_USER))
|
||||
.with_cell(user.timezone.as_deref().unwrap_or("-")),
|
||||
)
|
||||
.with_row(
|
||||
Row::new()
|
||||
table::Row::new()
|
||||
.with_cell(Lc::t("col-status", &LOCALES_USER))
|
||||
.with_cell(Lc::t(status_key(status), &LOCALES_USER)),
|
||||
);
|
||||
|
|
@ -83,7 +82,7 @@ async fn profile_details(user: &user::Model, status: UserStatus, cx: &mut Contex
|
|||
.render(cx)
|
||||
.await;
|
||||
table = table.with_row(
|
||||
Row::new()
|
||||
table::Row::new()
|
||||
.with_cell("")
|
||||
.with_cell(Html::with(move |_| badge.clone())),
|
||||
);
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
use serde::Deserialize;
|
||||
|
||||
use pagetop::base::component::table::Row;
|
||||
use pagetop::prelude::*;
|
||||
use pagetop_htmx::prelude::*;
|
||||
|
||||
|
|
@ -313,22 +312,22 @@ async fn role_view_details(role: &role::Model, cx: &mut Context) -> Block {
|
|||
let mut table = Table::new()
|
||||
.with_prop(PropsOp::add_classes("user-admin-table"))
|
||||
.with_row(
|
||||
Row::new()
|
||||
table::Row::new()
|
||||
.with_cell(Lc::t("field-machine-name", &LOCALES_USER))
|
||||
.with_cell(role.machine_name.as_str()),
|
||||
)
|
||||
.with_row(
|
||||
Row::new()
|
||||
table::Row::new()
|
||||
.with_cell(Lc::t("field-label", &LOCALES_USER))
|
||||
.with_cell(role.label.as_str()),
|
||||
)
|
||||
.with_row(
|
||||
Row::new()
|
||||
table::Row::new()
|
||||
.with_cell(Lc::t("field-description", &LOCALES_USER))
|
||||
.with_cell(role.description.as_deref().unwrap_or("-")),
|
||||
)
|
||||
.with_row(
|
||||
Row::new()
|
||||
table::Row::new()
|
||||
.with_cell(Lc::t("field-weight", &LOCALES_USER))
|
||||
.with_cell(role.weight.to_string()),
|
||||
);
|
||||
|
|
@ -339,7 +338,7 @@ async fn role_view_details(role: &role::Model, cx: &mut Context) -> Block {
|
|||
.render(cx)
|
||||
.await;
|
||||
table = table.with_row(
|
||||
Row::new()
|
||||
table::Row::new()
|
||||
.with_cell("")
|
||||
.with_cell(Html::with(move |_| badge.clone())),
|
||||
);
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
use serde::Deserialize;
|
||||
|
||||
use pagetop::base::component::table::Row;
|
||||
use pagetop::prelude::*;
|
||||
use pagetop_htmx::prelude::*;
|
||||
|
||||
|
|
@ -517,32 +516,32 @@ async fn user_view_details(user: &user::Model, status: UserStatus, cx: &mut Cont
|
|||
let mut table = Table::new()
|
||||
.with_prop(PropsOp::add_classes("user-admin-table"))
|
||||
.with_row(
|
||||
Row::new()
|
||||
table::Row::new()
|
||||
.with_cell(Lc::t("field-username-admin", &LOCALES_USER))
|
||||
.with_cell(user.username.as_str()),
|
||||
)
|
||||
.with_row(
|
||||
Row::new()
|
||||
table::Row::new()
|
||||
.with_cell(Lc::t("field-email", &LOCALES_USER))
|
||||
.with_cell(user.email.as_str()),
|
||||
)
|
||||
.with_row(
|
||||
Row::new()
|
||||
table::Row::new()
|
||||
.with_cell(Lc::t("field-display-name", &LOCALES_USER))
|
||||
.with_cell(user.display_name.as_deref().unwrap_or("-")),
|
||||
)
|
||||
.with_row(
|
||||
Row::new()
|
||||
table::Row::new()
|
||||
.with_cell(Lc::t("field-language", &LOCALES_USER))
|
||||
.with_cell(user.language.as_deref().unwrap_or("-")),
|
||||
)
|
||||
.with_row(
|
||||
Row::new()
|
||||
table::Row::new()
|
||||
.with_cell(Lc::t("field-timezone", &LOCALES_USER))
|
||||
.with_cell(user.timezone.as_deref().unwrap_or("-")),
|
||||
)
|
||||
.with_row(
|
||||
Row::new()
|
||||
table::Row::new()
|
||||
.with_cell(Lc::t("col-status", &LOCALES_USER))
|
||||
.with_cell(Lc::t(status_key(status), &LOCALES_USER)),
|
||||
);
|
||||
|
|
@ -553,7 +552,7 @@ async fn user_view_details(user: &user::Model, status: UserStatus, cx: &mut Cont
|
|||
.render(cx)
|
||||
.await;
|
||||
table = table.with_row(
|
||||
Row::new()
|
||||
table::Row::new()
|
||||
.with_cell("")
|
||||
.with_cell(Html::with(move |_| badge.clone())),
|
||||
);
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
use serde::Deserialize;
|
||||
|
||||
use pagetop::auth::CurrentUser;
|
||||
use pagetop::prelude::*;
|
||||
|
||||
use crate::auth;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue