diff --git a/README.md b/README.md index a872008d..6d3b4e52 100644 --- a/README.md +++ b/README.md @@ -37,9 +37,6 @@ distinct role within the PageTop ecosystem: ## Packages -* [pagetop-homedemo](https://github.com/manuelcillero/pagetop/tree/main/packages/pagetop-homedemo): - Showcases a demo homepage, offering a glimpse into PageTop's capabilities. - * [pagetop-user](https://github.com/manuelcillero/pagetop/tree/main/packages/pagetop-user): Facilitates user management, including roles, permissions, and session handling, for applications built on PageTop. diff --git a/drust/Cargo.toml b/drust/Cargo.toml index 4669ccd1..9d3c48e1 100644 --- a/drust/Cargo.toml +++ b/drust/Cargo.toml @@ -16,7 +16,6 @@ license = "MIT OR Apache-2.0" [dependencies] pagetop = { version = "0.0", path = "../", features = ["mysql"], default-features = false } # Packages. -pagetop-homedemo = { version = "0.0", path = "../packages/pagetop-homedemo" } pagetop-admin = { version = "0.0", path = "../packages/pagetop-admin" } pagetop-user = { version = "0.0", path = "../packages/pagetop-user" } pagetop-node = { version = "0.0", path = "../packages/pagetop-node" } diff --git a/drust/src/main.rs b/drust/src/main.rs index a1e831f2..c87aae7f 100644 --- a/drust/src/main.rs +++ b/drust/src/main.rs @@ -5,14 +5,13 @@ struct Drust; impl PackageTrait for Drust { fn dependencies(&self) -> Vec { vec![ - // Themes. - &pagetop_bootsier::Bootsier, - &pagetop_bulmix::Bulmix, // Packages. - &pagetop_homedemo::HomeDemo, &pagetop_admin::Admin, &pagetop_user::User, &pagetop_node::Node, + // Themes. + &pagetop_bootsier::Bootsier, + &pagetop_bulmix::Bulmix, ] } diff --git a/packages/pagetop-homedemo/Cargo.toml b/packages/pagetop-homedemo/Cargo.toml deleted file mode 100644 index 9ff4128a..00000000 --- a/packages/pagetop-homedemo/Cargo.toml +++ /dev/null @@ -1,21 +0,0 @@ -[package] -name = "pagetop-homedemo" -version = "0.0.13" -edition = "2021" - -authors = [ - "Manuel Cillero " -] -description = """\ - Showcases a demo homepage, offering a glimpse into PageTop's capabilities.\ -""" -homepage = "https://pagetop.cillero.es" -repository = "https://github.com/manuelcillero/pagetop" -license = "MIT OR Apache-2.0" - -[dependencies] -pagetop = { version = "0.0", path = "../../" } -static-files = "0.2.3" - -[build-dependencies] -pagetop-build = { version = "0.0", path = "../../helpers/pagetop-build" } diff --git a/packages/pagetop-homedemo/README.md b/packages/pagetop-homedemo/README.md deleted file mode 100644 index 4bfeca59..00000000 --- a/packages/pagetop-homedemo/README.md +++ /dev/null @@ -1,27 +0,0 @@ -Showcases a demo homepage, offering a glimpse into **PageTop's** capabilities. - - -# 📦 About PageTop - -[PageTop](https://docs.rs/pagetop) is an opinionated [Rust](https://www.rust-lang.org) web -development framework to build secure and modular Server-Side Rendering (SSR) web solutions. - - -# 🚧 Warning - -**PageTop** framework is currently in active development. The API is unstable and subject to -frequent changes. Production use is not recommended until version **0.1.0**. - - -# 📜 License - -All code in this crate is dual-licensed under either: - - * MIT License - ([LICENSE-MIT](LICENSE-MIT) or https://opensource.org/licenses/MIT) - - * Apache License, Version 2.0, - ([LICENSE-APACHE](LICENSE-APACHE) or https://www.apache.org/licenses/LICENSE-2.0) - -at your option. This means you can select the license you prefer! This dual-licensing approach is -the de-facto standard in the Rust ecosystem. diff --git a/packages/pagetop-homedemo/build.rs b/packages/pagetop-homedemo/build.rs deleted file mode 100644 index caa0fdf2..00000000 --- a/packages/pagetop-homedemo/build.rs +++ /dev/null @@ -1,7 +0,0 @@ -use pagetop_build::StaticFilesBundle; - -fn main() -> std::io::Result<()> { - StaticFilesBundle::from_dir("./static") - .with_name("homedemo") - .build() -} diff --git a/packages/pagetop-homedemo/src/lib.rs b/packages/pagetop-homedemo/src/lib.rs deleted file mode 100644 index 40e4750f..00000000 --- a/packages/pagetop-homedemo/src/lib.rs +++ /dev/null @@ -1,213 +0,0 @@ -use pagetop::prelude::*; - -static_locales!(LOCALES_HOMEDEMO); - -static_files!(homedemo); - -pub struct HomeDemo; - -impl PackageTrait for HomeDemo { - fn name(&self) -> L10n { - L10n::t("package_name", &LOCALES_HOMEDEMO) - } - - fn description(&self) -> L10n { - L10n::t("package_description", &LOCALES_HOMEDEMO) - } - - fn configure_service(&self, scfg: &mut service::web::ServiceConfig) { - service_for_static_files!(scfg, homedemo => "/homedemo"); - scfg.route("/", service::web::get().to(demo)); - } -} - -async fn demo(request: service::HttpRequest) -> ResultPage { - Page::new(request) - .with_title(L10n::t("page_title", &LOCALES_HOMEDEMO)) - .with_context(ContextOp::AddStyleSheet(StyleSheet::at( - "/homedemo/css/styles.css", - ))) - .with_body_classes(ClassesOp::Add, "default-homepage") - .with_component_in("content", hello_world()) - .with_component_in("content", welcome()) - .with_component_in("content", about_pagetop()) - .with_component_in("content", promo_pagetop()) - .with_component_in("content", reporting_issues()) - .render() -} - -fn hello_world() -> Wrapper { - Wrapper::header().with_id("hello-world").add_component( - flex::Container::new() - .with_direction(flex::Direction::Column(BreakPoint::MD)) - .add_item( - flex::Item::new() - .with_inner_classes(ClassesOp::Add, "hello-col-text") - .with_size(flex::ItemSize::Percent40) - .add_component( - Heading::h1(L10n::t("page_title", &LOCALES_HOMEDEMO)) - .with_size(HeadingSize::Medium), - ) - .add_component( - Paragraph::translated(L10n::t("hello_intro", &LOCALES_HOMEDEMO).with_arg( - "app", - format!( - "{}", - &config::SETTINGS.app.name, - ), - )) - .with_font_size(FontSize::Medium), - ) - .add_component(Paragraph::translated( - L10n::t("hello_powered", &LOCALES_HOMEDEMO).with_arg( - "pagetop", - format!( - "{}", - "https://pagetop.cillero.es", "PageTop", - ), - ), - )) - .add_component( - Button::anchor( - "https://github.com/manuelcillero/pagetop", - L10n::t("hello_code", &LOCALES_HOMEDEMO), - ) - .with_target(ButtonTarget::Blank) - .with_left_icon(Some(Icon::with("git"))) - .with_classes(ClassesOp::Add, "code-link") - .with_font_size(FontSize::Medium), - ) - .add_component( - Button::anchor("#welcome", L10n::t("hello_welcome", &LOCALES_HOMEDEMO)) - .with_style(ButtonStyle::Link) - .with_left_icon(Some(Icon::with("arrow-down-circle-fill"))) - .with_classes(ClassesOp::Add, "welcome-link") - .with_font_size(FontSize::Medium), - ), - ) - .add_item( - flex::Item::new() - .with_inner_classes(ClassesOp::Add, "hello-col-image") - .with_size(flex::ItemSize::Percent60) - .add_component(Image::with("/homedemo/images/header.svg")), - ), - ) -} - -fn welcome() -> Wrapper { - Wrapper::section() - .with_id("welcome") - .with_classes(ClassesOp::Add, "welcome-col-text") - .add_component(Heading::h2(L10n::t("welcome_page", &LOCALES_HOMEDEMO))) - .add_component( - Heading::h3(L10n::t("welcome_subtitle", &LOCALES_HOMEDEMO).with_arg( - "app", - format!( - "{}", - &config::SETTINGS.app.name - ), - )) - .with_size(HeadingSize::Subtitle), - ) - .add_component( - Paragraph::translated(L10n::t("welcome_text1", &LOCALES_HOMEDEMO)) - .with_font_size(FontSize::Medium), - ) - .add_component(Paragraph::translated(L10n::t( - "welcome_text2", - &LOCALES_HOMEDEMO, - ))) -} - -fn about_pagetop() -> Wrapper { - Wrapper::new().with_id("pagetop").add_component( - flex::Container::new() - .with_direction(flex::Direction::Column(BreakPoint::SM)) - .add_item( - flex::Item::new() - .with_inner_classes(ClassesOp::Add, "pagetop-col-image") - .with_size(flex::ItemSize::Percent40) - .add_component(Image::with("/homedemo/images/about.svg")), - ) - .add_item( - flex::Item::new() - .with_inner_classes(ClassesOp::Add, "pagetop-col-text") - .add_component(Heading::h2(L10n::t("pagetop_title", &LOCALES_HOMEDEMO))) - .add_component( - Paragraph::translated(L10n::t("pagetop_text1", &LOCALES_HOMEDEMO)) - .with_font_size(FontSize::Medium), - ) - .add_component(Paragraph::translated(L10n::t( - "pagetop_text2", - &LOCALES_HOMEDEMO, - ))) - .add_component(Paragraph::translated( - L10n::t("pagetop_text3", &LOCALES_HOMEDEMO) - .with_arg("href", "https://docs.rs/pagetop/latest/pagetop"), - )), - ), - ) -} - -fn promo_pagetop() -> Wrapper { - Wrapper::new().with_id("promo").add_component( - flex::Container::new() - .with_direction(flex::Direction::Column(BreakPoint::MD)) - .add_item( - flex::Item::new() - .with_inner_classes(ClassesOp::Add, "promo-col-text") - .with_size(flex::ItemSize::Percent60) - .add_component(Heading::h2(L10n::t( - "pagetop_promo_title", - &LOCALES_HOMEDEMO, - ))) - .add_component( - Paragraph::translated( - L10n::t("pagetop_promo_text1", &LOCALES_HOMEDEMO).with_arg( - "pagetop", - format!( - "{}", - "https://crates.io/crates/pagetop", "PageTop", - ), - ), - ) - .with_font_size(FontSize::Medium), - ), - ) - .add_item( - flex::Item::new() - .with_inner_classes(ClassesOp::Add, "promo-col-image") - .with_size(flex::ItemSize::Percent40) - .add_component(Image::with("/homedemo/images/pagetop.png")), - ), - ) -} - -fn reporting_issues() -> Wrapper { - Wrapper::new().with_id("reporting").add_component( - flex::Container::new() - .with_direction(flex::Direction::Column(BreakPoint::MD)) - .add_item( - flex::Item::new() - .with_inner_classes(ClassesOp::Add, "reporting-col-image") - .add_component(Image::with("/homedemo/images/support.jpg")), - ) - .add_item( - flex::Item::new() - .with_inner_classes(ClassesOp::Add, "reporting-col-text") - .with_size(flex::ItemSize::Percent50) - .add_component(Heading::h2(L10n::t( - "report_problems_title", - &LOCALES_HOMEDEMO, - ))) - .add_component( - Paragraph::translated(L10n::t("report_problems_text1", &LOCALES_HOMEDEMO)) - .with_font_size(FontSize::Medium), - ) - .add_component(Paragraph::translated(L10n::t( - "report_problems_text2", - &LOCALES_HOMEDEMO, - ))), - ), - ) -} diff --git a/packages/pagetop-homedemo/src/locale/en-US/homepage.ftl b/packages/pagetop-homedemo/src/locale/en-US/homepage.ftl deleted file mode 100644 index e72ea499..00000000 --- a/packages/pagetop-homedemo/src/locale/en-US/homepage.ftl +++ /dev/null @@ -1,26 +0,0 @@ -package_name = Default homepage -package_description = Displays a demo homepage when none is configured. - -page_title = Hello world! - -hello_intro = This page is used to test the proper operation of { $app } after installation. -hello_powered = This web solution is powered by { $pagetop }. -hello_code = Code -hello_welcome = Welcome - -welcome_page = Welcome page -welcome_subtitle = Are you user of { $app }? -welcome_text1 = If you don't know what this page is about, this probably means that the site is either experiencing problems or is undergoing routine maintenance. -welcome_text2 = If the problem persists, please contact your system administrator. - -pagetop_title = About PageTop -pagetop_text1 = If you can read this page, it means that the PageTop server is working properly, but has not yet been configured. -pagetop_text2 = PageTop defines an interface for the most stable and popular Rust packages to build modular, extensible and configurable web solutions. -pagetop_text3 = For more information on PageTop please visit the technical documentation. - -pagetop_promo_title = Promoting PageTop -pagetop_promo_text1 = You are free to use the image below on applications powered by { $pagetop }. Thanks for using PageTop! - -report_problems_title = Reporting problems -report_problems_text1 = Please use the GitHub tool to report bugs in PageTop. However, check "existing bug reports" before reporting a new bug. -report_problems_text2 = Please report bugs specific to modules (such as admin, and others) to respective repositories, not to PageTop itself. diff --git a/packages/pagetop-homedemo/src/locale/es-ES/homepage.ftl b/packages/pagetop-homedemo/src/locale/es-ES/homepage.ftl deleted file mode 100644 index f1558d2c..00000000 --- a/packages/pagetop-homedemo/src/locale/es-ES/homepage.ftl +++ /dev/null @@ -1,26 +0,0 @@ -package_name = Página de inicio predeterminada -package_description = Muestra una página de demostración predeterminada cuando no hay ninguna configurada. - -page_title = ¡Hola mundo! - -hello_intro = Esta página se utiliza para comprobar el correcto funcionamiento de { $app } después de la instalación. -hello_powered = Esta solución web funciona con { $pagetop }. -hello_code = Código -hello_welcome = Bienvenida - -welcome_page = Página de bienvenida -welcome_subtitle = ¿Eres usuario de { $app }? -welcome_text1 = Si no sabes de qué trata esta página, probablemente significa que el sitio está experimentando problemas o está pasando por un mantenimiento de rutina. -welcome_text2 = Si el problema persiste, póngase en contacto con el administrador del sistema. - -pagetop_title = Sobre PageTop -pagetop_text1 = Si puedes leer esta página, significa que el servidor PageTop funciona correctamente, pero aún no se ha configurado. -pagetop_text2 = PageTop define una interfaz para los paquetes Rust más estables y populares para crear soluciones web modulares, extensibles y configurables. -pagetop_text3 = Para más información sobre PageTop, por favor visita la documentación técnica. - -pagetop_promo_title = Promociona PageTop -pagetop_promo_text1 = Eres libre de usar la siguiente imagen en aplicaciones desarrolladas con { $pagetop }. ¡Gracias por usar PageTop! - -report_problems_title = Informando problemas -report_problems_text1 = Utiliza la herramienta GitHub para informar errores en PageTop. Sin embargo, comprueba los "informes de errores existentes" antes de informar de un nuevo error. -report_problems_text2 = Informa de errores específicos de los módulos (como admin y otros) en sus repositorios respectivos, no a PageTop en sí. diff --git a/packages/pagetop-homedemo/static/css/styles.css b/packages/pagetop-homedemo/static/css/styles.css deleted file mode 100644 index c06673be..00000000 --- a/packages/pagetop-homedemo/static/css/styles.css +++ /dev/null @@ -1,109 +0,0 @@ -body.default-homepage span.app-name { - font-weight: 400; - color: inherit; -} - -#hello-world, -#welcome, -#pagetop, -#promo, -#reporting { - padding: 2rem 5%; -} - -body.default-homepage [class$="-col-text"] { - padding: 0 5%; - text-align: center; -} -body.default-homepage [class$="-col-image"] { - padding: 1rem 5%; -} -/* -#hello-world a { - margin: .25rem; -} -#hello-world a.code-link { - padding-left: 2rem; - padding-right: 2rem; - border-radius: 1.5rem; - font-size: 1.125rem; -} -#hello-world a.welcome-link { - text-decoration: none; - display: inline-block; - vertical-align: middle; -} -#hello-world .hello-col-image { - padding-top: 3em; -} -*/ -#welcome > div.container { - padding: 2rem 1rem; - border-radius: 28px; - background: url("/homedemo/images/welcome.jpg") center center no-repeat; - background-size: auto; - background-size: cover; - color: #fff; -} -#welcome > div.container > h2 { - color: #fff; -} -#welcome > div.container > h3 { - color: #ccc; -} - -#reporting .reporting-col-image img { - border-radius: 40px; -} - -/* BREAKPOINTS */ - -/* MD - Applies <= 768px */ -@media screen and (min-width: 48em) { - body.default-homepage [class$="-col-image"] { - padding-top: 5%; - } - - #reporting .reporting-col-text { - padding-left: 1rem; - text-align: left; - } -} -/* LG - Applies >= 992px */ -@media screen and (min-width: 62em) { - #hello-world .hello-col-text { - padding-top: 2rem; - padding-left: 10%; - text-align: left; - } - - #welcome { - padding-left: 10%; - padding-right: 10%; - } - #welcome > div.container { - padding: 2rem 8rem; - } - - #promo .promo-col-text { - padding-top: 1rem; - padding-right: 0; - text-align: right; - } -} -/* XL - Applies >= 1280px */ -@media screen and (min-width: 80em) { - body.default-homepage [class$="-col-image"] { - padding-top: 1rem; - } - - #hello-world .hello-col-text { - padding-top: 4rem; - } - - #pagetop .pagetop-col-text { - padding-top: 3rem; - padding-left: 3rem; - text-align: left; - } -} diff --git a/packages/pagetop-homedemo/static/images/support.jpg b/packages/pagetop-homedemo/static/images/support.jpg deleted file mode 100644 index f7b79a93..00000000 Binary files a/packages/pagetop-homedemo/static/images/support.jpg and /dev/null differ diff --git a/packages/pagetop-homedemo/static/images/welcome.jpg b/packages/pagetop-homedemo/static/images/welcome.jpg deleted file mode 100644 index 612bba08..00000000 Binary files a/packages/pagetop-homedemo/static/images/welcome.jpg and /dev/null differ diff --git a/src/base.rs b/src/base.rs index c0ebafad..196f119c 100644 --- a/src/base.rs +++ b/src/base.rs @@ -4,4 +4,6 @@ pub mod action; pub mod component; +pub mod package; + pub mod theme; diff --git a/src/base/package.rs b/src/base/package.rs new file mode 100644 index 00000000..1b0fa82b --- /dev/null +++ b/src/base/package.rs @@ -0,0 +1,2 @@ +mod welcome; +pub use welcome::Welcome; diff --git a/src/base/package/welcome.rs b/src/base/package/welcome.rs new file mode 100644 index 00000000..4cb9e99f --- /dev/null +++ b/src/base/package/welcome.rs @@ -0,0 +1,200 @@ +use crate::prelude::*; + +pub struct Welcome; + +impl PackageTrait for Welcome { + fn name(&self) -> L10n { + L10n::l("welcome_package_name") + } + + fn description(&self) -> L10n { + L10n::l("welcome_package_description") + } + + fn configure_service(&self, scfg: &mut service::web::ServiceConfig) { + scfg.route("/", service::web::get().to(demo)); + } +} + +async fn demo(request: service::HttpRequest) -> ResultPage { + Page::new(request) + .with_title(L10n::l("welcome_title")) + .with_context(ContextOp::AddStyleSheet(StyleSheet::at( + "/base/css/welcome.css", + ))) + .with_body_id("welcome") + .with_component_in("content", hello_world()) + .with_component_in("content", welcome()) + .with_component_in("content", about_pagetop()) + .with_component_in("content", promo_pagetop()) + .with_component_in("content", reporting_issues()) + .render() +} + +fn hello_world() -> Wrapper { + Wrapper::header() + .with_classes(ClassesOp::Add, "hello-world") + .add_component( + flex::Container::new() + .with_direction(flex::Direction::Column(BreakPoint::MD)) + .add_item( + flex::Item::new() + .with_inner_classes(ClassesOp::Add, "hello-col-text") + .with_size(flex::ItemSize::Percent40) + .add_component( + Heading::h1(L10n::l("welcome_title")).with_size(HeadingSize::Medium), + ) + .add_component( + Paragraph::translated(L10n::l("welcome_intro").with_arg( + "app", + format!( + "{}", + &config::SETTINGS.app.name, + ), + )) + .with_font_size(FontSize::Medium), + ) + .add_component(Paragraph::translated(L10n::l("welcome_powered").with_arg( + "pagetop", + format!( + "{}", + "https://pagetop.cillero.es", "PageTop", + ), + ))) + .add_component( + Button::anchor( + "https://github.com/manuelcillero/pagetop", + L10n::l("welcome_code"), + ) + .with_target(ButtonTarget::Blank) + .with_left_icon(Some(Icon::with("git"))) + .with_classes(ClassesOp::Add, "code-link") + .with_font_size(FontSize::Medium), + ) + .add_component( + Button::anchor("#welcome-page", L10n::l("welcome")) + .with_style(ButtonStyle::Link) + .with_left_icon(Some(Icon::with("arrow-down-circle-fill"))) + .with_classes(ClassesOp::Add, "welcome-link") + .with_font_size(FontSize::Medium), + ), + ) + .add_item( + flex::Item::new() + .with_inner_classes(ClassesOp::Add, "hello-col-image") + .with_size(flex::ItemSize::Percent60) + .add_component(Image::with("/base/images/header.svg")), + ), + ) +} + +fn welcome() -> Wrapper { + Wrapper::section() + .with_id("welcome-page") + .with_classes(ClassesOp::Add, "welcome") + .add_component(Heading::h2(L10n::l("welcome_page"))) + .add_component( + Heading::h3(L10n::l("welcome_subtitle").with_arg( + "app", + format!( + "{}", + &config::SETTINGS.app.name + ), + )) + .with_size(HeadingSize::Subtitle), + ) + .add_component( + Paragraph::translated(L10n::l("welcome_text1")).with_font_size(FontSize::Medium), + ) + .add_component(Paragraph::translated(L10n::l("welcome_text2"))) +} + +fn about_pagetop() -> Wrapper { + Wrapper::new() + .with_classes(ClassesOp::Add, "pagetop") + .add_component( + flex::Container::new() + .with_direction(flex::Direction::Column(BreakPoint::SM)) + .add_item( + flex::Item::new() + .with_inner_classes(ClassesOp::Add, "pagetop-col-image") + .with_size(flex::ItemSize::Percent40) + .add_component(Image::with("/base/images/about.svg")), + ) + .add_item( + flex::Item::new() + .with_inner_classes(ClassesOp::Add, "pagetop-col-text") + .add_component(Heading::h2(L10n::l("welcome_pagetop_title"))) + .add_component( + Paragraph::translated(L10n::l("welcome_pagetop_text1")) + .with_font_size(FontSize::Medium), + ) + .add_component(Paragraph::translated(L10n::l("welcome_pagetop_text2"))) + .add_component(Paragraph::translated(L10n::l("welcome_pagetop_text3"))), + ), + ) +} + +fn promo_pagetop() -> Wrapper { + Wrapper::new() + .with_classes(ClassesOp::Add, "promo") + .add_component( + flex::Container::new() + .with_direction(flex::Direction::Column(BreakPoint::MD)) + .add_item( + flex::Item::new() + .with_inner_classes(ClassesOp::Add, "promo-col-text") + .with_size(flex::ItemSize::Percent50) + .add_component(Heading::h2(L10n::l("welcome_promo_title"))) + .add_component( + Paragraph::translated(L10n::l("welcome_promo_text1").with_arg( + "pagetop", + format!( + "{}", + "https://crates.io/crates/pagetop", "PageTop", + ), + )) + .with_font_size(FontSize::Medium), + ), + ) + .add_item( + flex::Item::new() + .with_inner_classes(ClassesOp::Add, "promo-col-image") + .with_size(flex::ItemSize::Percent50) + .add_component(Image::with("/base/images/pagetop.png")), + ), + ) +} + +fn reporting_issues() -> Wrapper { + Wrapper::new() + .with_classes(ClassesOp::Add, "issues") + .add_component( + flex::Container::new() + .with_direction(flex::Direction::Column(BreakPoint::MD)) + .add_item( + flex::Item::new() + .with_inner_classes(ClassesOp::Add, "issues-col-image") + .add_component(Image::with("/base/images/issues.jpg")), + ) + .add_item( + flex::Item::new() + .with_inner_classes(ClassesOp::Add, "issues-col-text") + .with_size(flex::ItemSize::Percent50) + .add_component(Heading::h2(L10n::l("welcome_issues_title"))) + .add_component( + Paragraph::translated(L10n::l("welcome_issues_text1")) + .with_font_size(FontSize::Medium), + ) + .add_component(Paragraph::translated( + L10n::l("welcome_issues_text2").with_arg( + "app", + format!( + "{}", + &config::SETTINGS.app.name, + ), + ), + )), + ), + ) +} diff --git a/src/core/package/all.rs b/src/core/package/all.rs index 8c6b8a07..ee7388ab 100644 --- a/src/core/package/all.rs +++ b/src/core/package/all.rs @@ -37,6 +37,9 @@ pub fn register_packages(app: PackageRef) { // Enable application packages. add_to_enabled(&mut list, app); + // Enable default welcome page. + add_to_enabled(&mut list, &crate::base::package::Welcome); + list.reverse(); ENABLED_PACKAGES.write().unwrap().append(&mut list); } diff --git a/src/locale/en-US/welcome.ftl b/src/locale/en-US/welcome.ftl new file mode 100644 index 00000000..566691e4 --- /dev/null +++ b/src/locale/en-US/welcome.ftl @@ -0,0 +1,26 @@ +welcome_package_name = Default homepage +welcome_package_description = Displays a demo homepage when none is configured. + +welcome_title = Hello world! + +welcome_intro = This page is used to check the proper operation of the { $app } installation. +welcome_powered = This web solution is powered by { $pagetop }. +welcome_code = Code +welcome = Welcome + +welcome_page = Welcome page +welcome_subtitle = Are you user of { $app }? +welcome_text1 = If you don't know what this page is about, this probably means that the site is either experiencing problems or is undergoing routine maintenance. +welcome_text2 = If the problem persists, please contact your system administrator. + +welcome_pagetop_title = About PageTop +welcome_pagetop_text1 = If you can read this page, it means that the PageTop server is working properly, but has not yet been configured. +welcome_pagetop_text2 = PageTop is a Rust-based web development framework to build modular, extensible, and configurable web solutions. +welcome_pagetop_text3 = For more information on PageTop please visit the technical documentation. + +welcome_promo_title = Promoting PageTop +welcome_promo_text1 = You are free to use the image below on applications powered by { $pagetop }. Thanks for using PageTop! + +welcome_issues_title = Reporting problems +welcome_issues_text1 = Please use GitHub to report any issues with PageTop. However, check the existing error reports before submitting a new issue. +welcome_issues_text2 = If the issues are specific to { $app }, please refer to its official repository or support channel, rather than directly to PageTop. diff --git a/src/locale/es-ES/welcome.ftl b/src/locale/es-ES/welcome.ftl new file mode 100644 index 00000000..5034f155 --- /dev/null +++ b/src/locale/es-ES/welcome.ftl @@ -0,0 +1,26 @@ +welcome_package_name = Página de inicio predeterminada +welcome_package_description = Muestra una página de demostración predeterminada cuando no hay ninguna configurada. + +welcome_title = ¡Hola mundo! + +welcome_intro = Esta página se utiliza para verificar el correcto funcionamiento de la instalación de { $app }. +welcome_powered = Esta solución web funciona con { $pagetop }. +welcome_code = Código +welcome = Bienvenida + +welcome_page = Página de bienvenida +welcome_subtitle = ¿Eres usuario de { $app }? +welcome_text1 = Si no sabes de qué trata esta página, probablemente significa que el sitio está experimentando problemas o está pasando por un mantenimiento de rutina. +welcome_text2 = Si el problema persiste, póngase en contacto con el administrador del sistema. + +welcome_pagetop_title = Sobre PageTop +welcome_pagetop_text1 = Si puedes leer esta página, significa que el servidor PageTop funciona correctamente, pero aún no se ha configurado. +welcome_pagetop_text2 = PageTop es un entorno de desarrollo web basado en Rust para construir soluciones web modulares, extensibles y configurables. +welcome_pagetop_text3 = Para más información sobre PageTop, por favor visita la documentación técnica. + +welcome_promo_title = Promociona PageTop +welcome_promo_text1 = Eres libre de usar la siguiente imagen en aplicaciones desarrolladas con { $pagetop }. ¡Gracias por usar PageTop! + +welcome_issues_title = Informando problemas +welcome_issues_text1 = Por favor, utiliza GitHub para reportar cualquier problema con PageTop. No obstante, comprueba los informes de errores existentes antes de enviar uno nuevo. +welcome_issues_text2 = Si son fallos específicos de { $app }, por favor acude a su repositorio o canal de soporte oficial y no al de PageTop directamente. diff --git a/static/base/css/welcome.css b/static/base/css/welcome.css new file mode 100644 index 00000000..4bca64c3 --- /dev/null +++ b/static/base/css/welcome.css @@ -0,0 +1,95 @@ +#welcome span.app-name { + font-weight: 500; + color: inherit; +} + +#welcome .hello-world, +#welcome .welcome, +#welcome .pagetop, +#welcome .issues { + padding: 1.6rem 5%; +} +#welcome .promo { + padding: 0 5% 2rem; +} +#welcome .issues { + padding-top: 0; +} + +#welcome [class$="-col-text"] { + margin: 5% 5% 0; + text-align: center; +} +#welcome [class$="-col-image"] { + margin: 1rem 5%; +} + +#welcome .welcome { + text-align: center; + margin: 0 5%; +} +#welcome .welcome > div.container { + padding: 2rem 1rem; + border-radius: 28px; + background: url("/base/images/welcome.jpg") center center no-repeat; + background-size: auto; + background-size: cover; + color: #fff; +} +#welcome .welcome > div.container > h2 { + color: #fff; +} +#welcome .welcome > div.container > h3 { + color: #ccc; +} + +#welcome .promo-col-image { + padding: 0 5%; +} + +#welcome .issues-col-image img { + border-radius: 40px; +} + +/* BREAKPOINTS */ + +/* MD - Applies >= 768px */ +@media screen and (min-width: 48em) { + #welcome .promo-col-image { + padding: 0; + } + + #welcome .issues { + padding-top: 1.6rem; + } + #welcome .issues-col-text { + text-align: left; + } +} +/* LG - Applies >= 992px */ +@media screen and (min-width: 62em) { + #welcome .hello-col-text { + margin-top: 2rem; + text-align: left; + } + + #welcome .promo { + padding: 0 15% 2rem; + } + + #welcome .promo-col-text { + margin-right: 0; + text-align: right; + } +} +/* XL - Applies >= 1280px */ +@media screen and (min-width: 80em) { + #welcome .hello-col-text { + margin-top: 4rem; + margin-left: 20%; + } + + #welcome .pagetop-col-text { + text-align: left; + } +} \ No newline at end of file diff --git a/packages/pagetop-homedemo/static/images/about.svg b/static/base/images/about.svg similarity index 100% rename from packages/pagetop-homedemo/static/images/about.svg rename to static/base/images/about.svg diff --git a/packages/pagetop-homedemo/static/images/header.svg b/static/base/images/header.svg similarity index 100% rename from packages/pagetop-homedemo/static/images/header.svg rename to static/base/images/header.svg diff --git a/static/base/images/issues.jpg b/static/base/images/issues.jpg new file mode 100644 index 00000000..ab0ee60a Binary files /dev/null and b/static/base/images/issues.jpg differ diff --git a/packages/pagetop-homedemo/static/images/pagetop.png b/static/base/images/pagetop.png similarity index 100% rename from packages/pagetop-homedemo/static/images/pagetop.png rename to static/base/images/pagetop.png diff --git a/static/base/images/welcome.jpg b/static/base/images/welcome.jpg new file mode 100644 index 00000000..05d89e33 Binary files /dev/null and b/static/base/images/welcome.jpg differ diff --git a/tools/publish.sh b/tools/publish.sh index 2262df82..317aa9f4 100755 --- a/tools/publish.sh +++ b/tools/publish.sh @@ -26,7 +26,6 @@ helpers=( pagetop-build ) packages=( - pagetop-homedemo pagetop-user pagetop-admin pagetop-node