diff --git a/Cargo.toml b/Cargo.toml index 8c54ccb0..fc0269e5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,12 +18,12 @@ keywords = [ "pagetop", "web", "framework", "frontend", "ssr" ] exclude = [ - "drust/", "examples/", "helpers/", "packages/", "tests/" + "examples/", "helpers/", "tests/" ] rust-version = "1.70.0" [workspace] -members = ["drust", "helpers/*", "packages/*"] +members = ["helpers/*"] [lib] name = "pagetop" @@ -72,9 +72,6 @@ serde = { version = "1.0", features = ["derive"] } version = "0.3.30" optional = true -[dependencies.heck] -version = "0.4.1" - [dependencies.sea-orm] version = "0.12.15" features = ["debug-print", "macros", "runtime-async-std-native-tls"] diff --git a/README.md b/README.md index 14523297..1dba1342 100644 --- a/README.md +++ b/README.md @@ -57,19 +57,7 @@ This program features a `HelloWorld` package, providing a service that serves a accessible via `http://localhost:8088` under default settings. -# 📂 Repository Structure - -This repository is organized into a workspace that includes several subprojects, each serving a -distinct role within the PageTop ecosystem: - -## Application - -* [drust](https://github.com/manuelcillero/pagetop/tree/latest/drust): - A simple Content Management System (CMS) built on PageTop, which enables the creation, editing, - and maintenance of dynamic, fast, and modular websites. It uses the following essential packages - to provide standard CMS functionalities. - -## Helpers +# 📂 Helpers * [pagetop-macros](https://github.com/manuelcillero/pagetop/tree/latest/helpers/pagetop-macros): A collection of procedural macros that enhance the development experience within PageTop. @@ -77,27 +65,6 @@ distinct role within the PageTop ecosystem: * [pagetop-build](https://github.com/manuelcillero/pagetop/tree/latest/helpers/pagetop-build): Simplifies the process of embedding resources directly into binary files for PageTop applications. -## Packages - -* [pagetop-user](https://github.com/manuelcillero/pagetop/tree/latest/packages/pagetop-user): - Facilitates user management, including roles, permissions, and session handling, for applications - built on PageTop. - -* [pagetop-admin](https://github.com/manuelcillero/pagetop/tree/latest/packages/pagetop-admin): - Provides a unified interface for administrators to configure and manage package settings. - -* [pagetop-node](https://github.com/manuelcillero/pagetop/tree/latest/packages/pagetop-node): - Enables the creation and customization of content types, enhancing website content management. - -## Themes - -* [pagetop-bootsier](https://github.com/manuelcillero/pagetop/tree/latest/packages/pagetop-bootsier): - Utilizes the *[Bootstrap](https://getbootstrap.com/)* framework to offer versatile page layouts - and component stylings. - -* [pagetop-bulmix](https://github.com/manuelcillero/pagetop/tree/latest/packages/pagetop-bulmix): - Utilizes the *[Bulma](https://bulma.io/)* framework for sleek, responsive design elements. - # 🚧 Warning diff --git a/drust/Cargo.toml b/drust/Cargo.toml deleted file mode 100644 index 68baf623..00000000 --- a/drust/Cargo.toml +++ /dev/null @@ -1,23 +0,0 @@ -[package] -name = "drust" -version = "0.0.3" -edition = "2021" - -description = "A modern web Content Management System to share your world." -homepage = "https://pagetop.cillero.es" -repository = "https://github.com/manuelcillero/pagetop" -license = "MIT OR Apache-2.0" - -authors = [ - "Manuel Cillero " -] - -[dependencies] -pagetop = { version = "0.0", path = "../", features = ["mysql"], default-features = false } -# Packages. -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" } -# Themes. -pagetop-bootsier = { version = "0.0", path = "../packages/pagetop-bootsier" } -pagetop-bulmix = { version = "0.0", path = "../packages/pagetop-bulmix" } diff --git a/drust/README.md b/drust/README.md deleted file mode 100644 index 0901a3da..00000000 --- a/drust/README.md +++ /dev/null @@ -1,37 +0,0 @@ -
-

Drust

-

A Content Management System built on PageTop.

-
- -## Overview - -Modestly inspired by [Drupal](https://www.drupal.org), **Drust** utilizes **PageTop** to develop a -CMS (*Content Management System*). It enables the creation of dynamic, manageable, and customizable -websites, allowing users to effortlessly create, manage, and organize a wide variety of content on a -website. - - -# 📦 About PageTop - -[PageTop](https://docs.rs/pagetop) is an opinionated web framework to build modular *Server-Side -Rendering* 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 project 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/drust/config/common.toml b/drust/config/common.toml deleted file mode 100644 index 1562e469..00000000 --- a/drust/config/common.toml +++ /dev/null @@ -1,8 +0,0 @@ -[app] -name = "Drust" -description = """\ - A modern web Content Management System to share your world.\ -""" - -[database] -db_type = "mysql" diff --git a/drust/config/default.toml b/drust/config/default.toml deleted file mode 100644 index 6f119629..00000000 --- a/drust/config/default.toml +++ /dev/null @@ -1,10 +0,0 @@ -[app] -#theme = "Basic" -#theme = "Chassis" -theme = "Inception" -#theme = "Bootsier" -#theme = "Bulmix" -language = "es-ES" - -[log] -tracing = "Info,pagetop=Debug,sqlx::query=Warn" diff --git a/drust/src/main.rs b/drust/src/main.rs deleted file mode 100644 index c87aae7f..00000000 --- a/drust/src/main.rs +++ /dev/null @@ -1,28 +0,0 @@ -use pagetop::prelude::*; - -struct Drust; - -impl PackageTrait for Drust { - fn dependencies(&self) -> Vec { - vec![ - // Packages. - &pagetop_admin::Admin, - &pagetop_user::User, - &pagetop_node::Node, - // Themes. - &pagetop_bootsier::Bootsier, - &pagetop_bulmix::Bulmix, - ] - } - - fn drop_packages(&self) -> Vec { - vec![ - // &pagetop_node::Node - ] - } -} - -#[pagetop::main] -async fn main() -> std::io::Result<()> { - Application::prepare(&Drust).run()?.await -} diff --git a/packages/pagetop-admin/Cargo.toml b/packages/pagetop-admin/Cargo.toml deleted file mode 100644 index 76ee9450..00000000 --- a/packages/pagetop-admin/Cargo.toml +++ /dev/null @@ -1,22 +0,0 @@ -[package] -name = "pagetop-admin" -version = "0.0.21" -edition = "2021" - -description = "PageTop package that provides a unified settings interface to other packages." -homepage = "https://pagetop.cillero.es" -repository = "https://github.com/manuelcillero/pagetop" -license = "MIT OR Apache-2.0" - -authors = [ - "Manuel Cillero " -] -categories = [ - "web-programming", "gui" -] -keywords = [ - "pagetop", "admin", "config", "settings", "packages" -] - -[dependencies] -pagetop = { version = "0.0", path = "../../" } diff --git a/packages/pagetop-admin/README.md b/packages/pagetop-admin/README.md deleted file mode 100644 index d6bf416b..00000000 --- a/packages/pagetop-admin/README.md +++ /dev/null @@ -1,37 +0,0 @@ -
- -

PageTop Admin

- -

PageTop package that provides a unified settings interface to other packages.

- -[![License](https://img.shields.io/badge/license-MIT%2FApache-blue.svg?style=for-the-badge)](#-license) -[![API Docs](https://img.shields.io/docsrs/pagetop-admin?label=API%20Docs&style=for-the-badge&logo=Docs.rs)](https://docs.rs/pagetop-admin) -[![Crates.io](https://img.shields.io/crates/v/pagetop-admin.svg?style=for-the-badge&logo=ipfs)](https://crates.io/crates/pagetop-admin) -[![Downloads](https://img.shields.io/crates/d/pagetop-admin.svg?style=for-the-badge&logo=transmission)](https://crates.io/crates/pagetop-admin) - -
- -# 📦 About PageTop - -[PageTop](https://docs.rs/pagetop) is an opinionated web framework to build modular *Server-Side -Rendering* 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-admin/src/lib.rs b/packages/pagetop-admin/src/lib.rs deleted file mode 100644 index 18e4095c..00000000 --- a/packages/pagetop-admin/src/lib.rs +++ /dev/null @@ -1,39 +0,0 @@ -use pagetop::prelude::*; - -static_locales!(LOCALES_ADMIN); - -mod summary; - -pub struct Admin; - -impl PackageTrait for Admin { - fn name(&self) -> L10n { - L10n::t("package_name", &LOCALES_ADMIN) - } - - fn description(&self) -> L10n { - L10n::t("package_description", &LOCALES_ADMIN) - } - - fn actions(&self) -> Vec { - actions![ - action::page::BeforePrepareBody::new(before_prepare_body), - action::component::BeforePrepare::::new(before_prepare_menu) - .filter_by_referer_id("admin-menu-test"), - ] - } - - fn configure_service(&self, scfg: &mut service::web::ServiceConfig) { - scfg.service( - service::web::scope("/admin").route("", service::web::get().to(summary::summary)), - ); - } -} - -fn before_prepare_body(page: &mut Page) { - page.alter_body_classes(ClassesOp::Add, "test-admin"); -} - -fn before_prepare_menu(component: &mut Menu, _cx: &mut Context) { - component.alter_id("admin-menu-test-altered"); -} diff --git a/packages/pagetop-admin/src/locale/en-US/admin.ftl b/packages/pagetop-admin/src/locale/en-US/admin.ftl deleted file mode 100644 index 2c54d29d..00000000 --- a/packages/pagetop-admin/src/locale/en-US/admin.ftl +++ /dev/null @@ -1,2 +0,0 @@ -package_name = Admin module -package_description = Administration module. diff --git a/packages/pagetop-admin/src/locale/es-ES/admin.ftl b/packages/pagetop-admin/src/locale/es-ES/admin.ftl deleted file mode 100644 index 6f933fcd..00000000 --- a/packages/pagetop-admin/src/locale/es-ES/admin.ftl +++ /dev/null @@ -1,2 +0,0 @@ -package_name = Admin module -package_description = Módulo de administración. diff --git a/packages/pagetop-admin/src/summary.rs b/packages/pagetop-admin/src/summary.rs deleted file mode 100644 index 6abebc9a..00000000 --- a/packages/pagetop-admin/src/summary.rs +++ /dev/null @@ -1,163 +0,0 @@ -use crate::LOCALES_ADMIN; - -use pagetop::prelude::*; - -pub async fn summary(request: HttpRequest) -> ResultPage { - let top_menu = Menu::new() - .with_id("admin-menu-test") - .add_item(menu::Item::label(L10n::t("package_name", &LOCALES_ADMIN))) - .add_item(menu::Item::label(L10n::n("Ejemplo \"Label\""))) - .add_item(menu::Item::link(L10n::n("Ejemplo \"Link\""), |_| { - "https://www.google.es" - })) - .add_item(menu::Item::link_blank( - L10n::n("Ejemplo \"LinkBlank\""), - |_| "https://www.google.es", - )) - .add_item(menu::Item::submenu( - L10n::n("Ejemplo Submenú"), - menu::Submenu::new() - .with_title(L10n::n("Título submenú")) - .add_item(menu::Item::link(L10n::n("Opción \"Link\""), |_| { - "https://www.google.es" - })) - .add_item(menu::Item::link_blank( - L10n::n("Opción \"LinkBlank\""), - |_| "https://www.google.es", - )) - .add_item(menu::Item::submenu( - L10n::n("Otro submenú con un texto muy, pero que muy largo"), - menu::Submenu::new() - .add_item(menu::Item::label(L10n::n("Opción \"Label\""))) - .add_item(menu::Item::link(L10n::n("Opción \"Link\""), |_| { - "https://www.google.es" - })) - .add_item(menu::Item::link_blank( - L10n::n("Opción \"LinkBlank\""), - |_| "https://www.google.es", - )) - .add_item(menu::Item::label(L10n::n("Opción \"Label\""))), - )) - .add_item(menu::Item::label(L10n::n("Opción \"Label\""))), - )) - .add_item(menu::Item::megamenu( - L10n::n("Ejemplo Megamenú 1"), - menu::Megamenu::new() - .add_group( - menu::Group::new() - .add_element(menu::Element::submenu( - menu::Submenu::new() - .with_title(L10n::n("Título submenú")) - .add_item(menu::Item::label(L10n::n("Opción \"Label\""))) - .add_item(menu::Item::link(L10n::n("Opción \"Link\""), |_| { - "https://www.google.es" - })) - .add_item(menu::Item::link_blank( - L10n::n("Opción \"LinkBlank\""), - |_| "https://www.google.es", - )), - )) - .add_element(menu::Element::submenu( - menu::Submenu::new() - .with_title(L10n::n("Título submenú")) - .add_item(menu::Item::label(L10n::n("Opción \"Label\""))) - .add_item(menu::Item::link(L10n::n("Opción \"Link\""), |_| { - "https://www.google.es" - })) - .add_item(menu::Item::link_blank( - L10n::n("Opción \"LinkBlank\""), - |_| "https://www.google.es", - )), - )), - ) - .add_group( - menu::Group::new().add_element(menu::Element::submenu( - menu::Submenu::new() - .add_item(menu::Item::label(L10n::n("Opción \"Label\""))) - .add_item(menu::Item::link(L10n::n("Opción \"Link\""), |_| { - "https://www.google.es" - })) - .add_item(menu::Item::link_blank( - L10n::n("Opción \"LinkBlank\""), - |_| "https://www.google.es", - )) - .add_item(menu::Item::label(L10n::n("Opción \"Label\""))), - )), - ) - .add_group( - menu::Group::new() - .add_element(menu::Element::submenu( - menu::Submenu::new() - .with_title(L10n::n("Título submenú")) - .add_item(menu::Item::label(L10n::n("Opción \"Label\""))) - .add_item(menu::Item::link(L10n::n("Opción \"Link\""), |_| { - "https://www.google.es" - })) - .add_item(menu::Item::link_blank( - L10n::n("Opción \"LinkBlank\""), - |_| "https://www.google.es", - )), - )) - .add_element(menu::Element::submenu( - menu::Submenu::new() - .with_title(L10n::n("Título submenú")) - .add_item(menu::Item::label(L10n::n("Opción \"Label\""))) - .add_item(menu::Item::link(L10n::n("Opción \"Link\""), |_| { - "https://www.google.es" - })) - .add_item(menu::Item::link_blank( - L10n::n("Opción \"LinkBlank\""), - |_| "https://www.google.es", - )), - )), - ) - .add_group( - menu::Group::new().add_element(menu::Element::submenu( - menu::Submenu::new() - .add_item(menu::Item::label(L10n::n("Opción \"Label\""))) - .add_item(menu::Item::link(L10n::n("Opción \"Link\""), |_| { - "https://www.google.es" - })) - .add_item(menu::Item::link_blank( - L10n::n("Opción \"LinkBlank\""), - |_| "https://www.google.es", - )) - .add_item(menu::Item::label(L10n::n("Opción \"Label\""))), - )), - ), - )); - - let side_menu = Menu::new() - .add_item(menu::Item::label(L10n::n("Opción 1"))) - .add_item(menu::Item::link(L10n::n("Opción 2"), |_| { - "https://www.google.es" - })) - .add_item(menu::Item::link_blank(L10n::n("Opción 3"), |_| { - "https://www.google.es" - })) - .add_item(menu::Item::submenu( - L10n::n("Submenú 1"), - menu::Submenu::new() - .add_item(menu::Item::label(L10n::n("Opción 1"))) - .add_item(menu::Item::label(L10n::n("Opción 2"))), - )) /* - .add_item(menu::Item::separator()) */ - .add_item(menu::Item::submenu( - L10n::n("Submenú 2"), - menu::Submenu::new() - .add_item(menu::Item::label(L10n::n("Opción 1"))) - .add_item(menu::Item::label(L10n::n("Opción 2"))), - )) - .add_item(menu::Item::label(L10n::n("Opción 4"))); - - Page::new(request) - .with_title(L10n::n("Admin")) - .with_component_in("top-menu", side_menu) - .with_component( - flex::Container::new() - .add_item(flex::Item::with(Html::with(html! { p { "Columna 1"} }))) - .add_item(flex::Item::with(top_menu)) - .add_item(flex::Item::with(Html::with(html! { p { "Columna 3"} }))), - ) - .render() -} diff --git a/packages/pagetop-bootsier/Cargo.toml b/packages/pagetop-bootsier/Cargo.toml deleted file mode 100644 index 3d69a591..00000000 --- a/packages/pagetop-bootsier/Cargo.toml +++ /dev/null @@ -1,26 +0,0 @@ -[package] -name = "pagetop-bootsier" -version = "0.0.18" -edition = "2021" - -description = "PageTop theme that uses Bootstrap framework for versatile styles and components." -homepage = "https://pagetop.cillero.es" -repository = "https://github.com/manuelcillero/pagetop" -license = "MIT OR Apache-2.0" - -authors = [ - "Manuel Cillero " -] -categories = [ - "web-programming", "gui" -] -keywords = [ - "pagetop", "theme", "bootstrap", "css", "js" -] - -[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-bootsier/README.md b/packages/pagetop-bootsier/README.md deleted file mode 100644 index 724f70eb..00000000 --- a/packages/pagetop-bootsier/README.md +++ /dev/null @@ -1,37 +0,0 @@ -
- -

PageTop Bootsier

- -

PageTop theme that uses Bootstrap framework for versatile styles and components.

- -[![License](https://img.shields.io/badge/license-MIT%2FApache-blue.svg?style=for-the-badge)](#-license) -[![API Docs](https://img.shields.io/docsrs/pagetop-bootsier?label=API%20Docs&style=for-the-badge&logo=Docs.rs)](https://docs.rs/pagetop-bootsier) -[![Crates.io](https://img.shields.io/crates/v/pagetop-bootsier.svg?style=for-the-badge&logo=ipfs)](https://crates.io/crates/pagetop-bootsier) -[![Downloads](https://img.shields.io/crates/d/pagetop-bootsier.svg?style=for-the-badge&logo=transmission)](https://crates.io/crates/pagetop-bootsier) - -
- -# 📦 About PageTop - -[PageTop](https://docs.rs/pagetop) is an opinionated web framework to build modular *Server-Side -Rendering* 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-bootsier/build.rs b/packages/pagetop-bootsier/build.rs deleted file mode 100644 index 05b11b3c..00000000 --- a/packages/pagetop-bootsier/build.rs +++ /dev/null @@ -1,7 +0,0 @@ -use pagetop_build::StaticFilesBundle; - -fn main() -> std::io::Result<()> { - StaticFilesBundle::from_dir("./static") - .with_name("bootsier") - .build() -} diff --git a/packages/pagetop-bootsier/src/lib.rs b/packages/pagetop-bootsier/src/lib.rs deleted file mode 100644 index 60efa329..00000000 --- a/packages/pagetop-bootsier/src/lib.rs +++ /dev/null @@ -1,179 +0,0 @@ -use pagetop::prelude::*; - -static_locales!(LOCALES_BOOTSIER); - -static_files!(bootsier); - -pub struct Bootsier; - -impl PackageTrait for Bootsier { - fn theme(&self) -> Option { - Some(&Bootsier) - } - - fn actions(&self) -> Vec { - actions![ - action::theme::BeforePrepare::::new(&Self, before_prepare_icon), - action::theme::BeforePrepare::