📝 Revisión de documentación y nomenclatura

This commit is contained in:
Manuel Cillero 2023-07-06 18:30:01 +02:00
parent f85a35b5f4
commit 4d305a7ca4
4 changed files with 64 additions and 67 deletions

View file

@ -1,9 +1,9 @@
use pagetop::prelude::*;
use pagetop_minimal::component::*;
use_handle!(MODULE_DEMOHOME);
use_handle!(MODULE_HOMEDEMO);
use_locale!(LOCALE_DEMOHOME);
use_locale!(LOCALE_HOMEDEMO);
use_static!(homedemo);
@ -11,15 +11,15 @@ pub struct HomeDemo;
impl ModuleTrait for HomeDemo {
fn handle(&self) -> Handle {
MODULE_DEMOHOME
MODULE_HOMEDEMO
}
fn name(&self) -> L10n {
L10n::t("module_name", &LOCALE_DEMOHOME)
L10n::t("module_name", &LOCALE_HOMEDEMO)
}
fn description(&self) -> L10n {
L10n::t("module_description", &LOCALE_DEMOHOME)
L10n::t("module_description", &LOCALE_HOMEDEMO)
}
fn dependencies(&self) -> Vec<ModuleStaticRef> {
@ -34,7 +34,7 @@ impl ModuleTrait for HomeDemo {
async fn demo(request: service::HttpRequest) -> ResultPage<Markup, FatalError> {
Page::new(request)
.with_title(L10n::t("page_title", &LOCALE_DEMOHOME))
.with_title(L10n::t("page_title", &LOCALE_HOMEDEMO))
.with_context(ContextOp::AddStyleSheet(StyleSheet::located(
"/homedemo/css/styles.css",
)))
@ -55,11 +55,11 @@ fn hello_world() -> Container {
.with_classes(ClassesOp::Add, "hello-col-text")
.with_size(grid::ColumnSize::Is5of12)
.with_component(
Heading::h1(L10n::t("page_title", &LOCALE_DEMOHOME))
Heading::h1(L10n::t("page_title", &LOCALE_HOMEDEMO))
.with_display(HeadingDisplay::Medium),
)
.with_component(
Paragraph::with(L10n::e("hello_intro", &LOCALE_DEMOHOME).with_arg(
Paragraph::with(L10n::e("hello_intro", &LOCALE_HOMEDEMO).with_arg(
"app",
format!(
"<span class=\"app-name\">{}</span>",
@ -69,7 +69,7 @@ fn hello_world() -> Container {
.with_display(ParagraphDisplay::Small),
)
.with_component(Paragraph::with(
L10n::e("hello_powered", &LOCALE_DEMOHOME).with_arg(
L10n::e("hello_powered", &LOCALE_HOMEDEMO).with_arg(
"pagetop",
format!(
"<a href=\"{}\" target=\"_blank\">{}</a>",
@ -80,14 +80,14 @@ fn hello_world() -> Container {
.with_component(
Anchor::button(
"https://github.com/manuelcillero/pagetop",
L10n::t("hello_code", &LOCALE_DEMOHOME),
L10n::t("hello_code", &LOCALE_HOMEDEMO),
)
.with_target(AnchorTarget::Blank)
.with_left_icon(Icon::with("git"))
.with_classes(ClassesOp::Add, "code-link"),
)
.with_component(
Anchor::link("#welcome", L10n::t("hello_welcome", &LOCALE_DEMOHOME))
Anchor::link("#welcome", L10n::t("hello_welcome", &LOCALE_HOMEDEMO))
.with_left_icon(Icon::with("arrow-down-circle-fill"))
.with_classes(ClassesOp::Add, "welcome-link"),
),
@ -104,9 +104,9 @@ fn welcome() -> Container {
Container::section()
.with_id("welcome")
.with_classes(ClassesOp::Add, "welcome-col-text")
.with_component(Heading::h2(L10n::t("welcome_page", &LOCALE_DEMOHOME)))
.with_component(Heading::h2(L10n::t("welcome_page", &LOCALE_HOMEDEMO)))
.with_component(
Heading::h3(L10n::e("welcome_subtitle", &LOCALE_DEMOHOME).with_arg(
Heading::h3(L10n::e("welcome_subtitle", &LOCALE_HOMEDEMO).with_arg(
"app",
format!(
"<span class=\"app-name\">{}</span>",
@ -116,10 +116,10 @@ fn welcome() -> Container {
.with_display(HeadingDisplay::Subtitle),
)
.with_component(
Paragraph::with(L10n::t("welcome_text1", &LOCALE_DEMOHOME))
Paragraph::with(L10n::t("welcome_text1", &LOCALE_HOMEDEMO))
.with_display(ParagraphDisplay::Small),
)
.with_component(Paragraph::with(L10n::t("welcome_text2", &LOCALE_DEMOHOME)))
.with_component(Paragraph::with(L10n::t("welcome_text2", &LOCALE_HOMEDEMO)))
}
fn about_pagetop() -> Container {
@ -134,14 +134,14 @@ fn about_pagetop() -> Container {
.with_column(
grid::Column::new()
.with_classes(ClassesOp::Add, "pagetop-col-text")
.with_component(Heading::h2(L10n::t("pagetop_title", &LOCALE_DEMOHOME)))
.with_component(Heading::h2(L10n::t("pagetop_title", &LOCALE_HOMEDEMO)))
.with_component(
Paragraph::with(L10n::t("pagetop_text1", &LOCALE_DEMOHOME))
Paragraph::with(L10n::t("pagetop_text1", &LOCALE_HOMEDEMO))
.with_display(ParagraphDisplay::Small),
)
.with_component(Paragraph::with(L10n::t("pagetop_text2", &LOCALE_DEMOHOME)))
.with_component(Paragraph::with(L10n::t("pagetop_text2", &LOCALE_HOMEDEMO)))
.with_component(Paragraph::with(
L10n::e("pagetop_text3", &LOCALE_DEMOHOME)
L10n::e("pagetop_text3", &LOCALE_HOMEDEMO)
.with_arg("href", "https://docs.rs/pagetop/latest/pagetop".to_string()),
)),
),
@ -156,10 +156,10 @@ fn promo_pagetop() -> Container {
.with_classes(ClassesOp::Add, "promo-col-text")
.with_component(Heading::h2(L10n::t(
"pagetop_promo_title",
&LOCALE_DEMOHOME,
&LOCALE_HOMEDEMO,
)))
.with_component(
Paragraph::with(L10n::e("pagetop_promo_text1", &LOCALE_DEMOHOME).with_arg(
Paragraph::with(L10n::e("pagetop_promo_text1", &LOCALE_HOMEDEMO).with_arg(
"pagetop",
format!(
"<a href=\"{}\" target=\"_blank\">{}</a>",
@ -192,15 +192,15 @@ fn reporting_issues() -> Container {
.with_size(grid::ColumnSize::Is6of12)
.with_component(Heading::h2(L10n::t(
"report_problems_title",
&LOCALE_DEMOHOME,
&LOCALE_HOMEDEMO,
)))
.with_component(
Paragraph::with(L10n::t("report_problems_text1", &LOCALE_DEMOHOME))
Paragraph::with(L10n::t("report_problems_text1", &LOCALE_HOMEDEMO))
.with_display(ParagraphDisplay::Small),
)
.with_component(Paragraph::with(L10n::t(
"report_problems_text2",
&LOCALE_DEMOHOME,
&LOCALE_HOMEDEMO,
))),
),
)