🏗️ Nuevo componente Html para simplificar L10n
This commit is contained in:
parent
a48c575198
commit
52baa4f671
8 changed files with 83 additions and 38 deletions
|
|
@ -1,4 +1,5 @@
|
|||
use super::LOCALE_ADMIN;
|
||||
use crate::LOCALE_ADMIN;
|
||||
|
||||
use pagetop::prelude::*;
|
||||
use pagetop_megamenu::component::{MegaMenu, MegaMenuItem};
|
||||
use pagetop_minimal::component::*;
|
||||
|
|
@ -7,62 +8,62 @@ pub async fn summary(request: server::HttpRequest) -> ResultPage<Markup, FatalEr
|
|||
let top_menu = MegaMenu::new()
|
||||
.with_item(MegaMenuItem::label(L10n::t("module_name", &LOCALE_ADMIN)))
|
||||
.with_item(MegaMenuItem::link(
|
||||
L10n::text("Opción 2"),
|
||||
L10n::n("Opción 2"),
|
||||
"https://www.google.es",
|
||||
))
|
||||
.with_item(MegaMenuItem::link_blank(
|
||||
L10n::text("Opción 3"),
|
||||
L10n::n("Opción 3"),
|
||||
"https://www.google.es",
|
||||
))
|
||||
.with_item(MegaMenuItem::submenu(
|
||||
L10n::text("Submenú 1"),
|
||||
L10n::n("Submenú 1"),
|
||||
MegaMenu::new()
|
||||
.with_item(MegaMenuItem::label(L10n::text("Opción 1")))
|
||||
.with_item(MegaMenuItem::label(L10n::text("Opción 2"))),
|
||||
.with_item(MegaMenuItem::label(L10n::n("Opción 1")))
|
||||
.with_item(MegaMenuItem::label(L10n::n("Opción 2"))),
|
||||
))
|
||||
.with_item(MegaMenuItem::separator())
|
||||
.with_item(MegaMenuItem::submenu(
|
||||
L10n::text("Submenú 2"),
|
||||
L10n::n("Submenú 2"),
|
||||
MegaMenu::new()
|
||||
.with_item(MegaMenuItem::label(L10n::text("Opción 1")))
|
||||
.with_item(MegaMenuItem::label(L10n::text("Opción 2"))),
|
||||
.with_item(MegaMenuItem::label(L10n::n("Opción 1")))
|
||||
.with_item(MegaMenuItem::label(L10n::n("Opción 2"))),
|
||||
))
|
||||
.with_item(MegaMenuItem::label(L10n::text("Opción 4")));
|
||||
.with_item(MegaMenuItem::label(L10n::n("Opción 4")));
|
||||
|
||||
let side_menu = MegaMenu::new()
|
||||
.with_item(MegaMenuItem::label(L10n::text("Opción 1")))
|
||||
.with_item(MegaMenuItem::label(L10n::n("Opción 1")))
|
||||
.with_item(MegaMenuItem::link(
|
||||
L10n::text("Opción 2"),
|
||||
L10n::n("Opción 2"),
|
||||
"https://www.google.es",
|
||||
))
|
||||
.with_item(MegaMenuItem::link_blank(
|
||||
L10n::text("Opción 3"),
|
||||
L10n::n("Opción 3"),
|
||||
"https://www.google.es",
|
||||
))
|
||||
.with_item(MegaMenuItem::submenu(
|
||||
L10n::text("Submenú 1"),
|
||||
L10n::n("Submenú 1"),
|
||||
MegaMenu::new()
|
||||
.with_item(MegaMenuItem::label(L10n::text("Opción 1")))
|
||||
.with_item(MegaMenuItem::label(L10n::text("Opción 2"))),
|
||||
.with_item(MegaMenuItem::label(L10n::n("Opción 1")))
|
||||
.with_item(MegaMenuItem::label(L10n::n("Opción 2"))),
|
||||
))
|
||||
.with_item(MegaMenuItem::separator())
|
||||
.with_item(MegaMenuItem::submenu(
|
||||
L10n::text("Submenú 2"),
|
||||
L10n::n("Submenú 2"),
|
||||
MegaMenu::new()
|
||||
.with_item(MegaMenuItem::label(L10n::text("Opción 1")))
|
||||
.with_item(MegaMenuItem::label(L10n::text("Opción 2"))),
|
||||
.with_item(MegaMenuItem::label(L10n::n("Opción 1")))
|
||||
.with_item(MegaMenuItem::label(L10n::n("Opción 2"))),
|
||||
))
|
||||
.with_item(MegaMenuItem::label(L10n::text("Opción 4")));
|
||||
.with_item(MegaMenuItem::label(L10n::n("Opción 4")));
|
||||
|
||||
Page::new(request)
|
||||
.with_context(ContextOp::Theme("Bootsier"))
|
||||
.with_title(L10n::text("Admin"))
|
||||
.with_title(L10n::n("Admin"))
|
||||
.with_in("top-menu", top_menu)
|
||||
.with_in(
|
||||
"content",
|
||||
grid::Row::new()
|
||||
.with_column(grid::Column::new().with_component(side_menu))
|
||||
.with_column(grid::Column::new().with_component(L10n::html(html! {
|
||||
.with_column(grid::Column::new().with_component(Html::with(html! {
|
||||
p { "Columna 2"}
|
||||
}))),
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue