From ab795d17ff992bbd577e03bcc268967edeb4faca Mon Sep 17 00:00:00 2001 From: Manuel Cillero Date: Mon, 10 Jul 2023 18:46:14 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=A5=20Integra=20el=20tema=20Basic=20en?= =?UTF-8?q?=20core?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pagetop/src/base.rs | 1 - pagetop/src/base/theme.rs | 2 -- pagetop/src/core/module/all.rs | 2 +- pagetop/src/core/theme.rs | 3 +++ pagetop/src/core/theme/all.rs | 2 +- pagetop/src/{base => core}/theme/basic.rs | 8 +++++++- pagetop/src/lib.rs | 3 --- pagetop/src/prelude.rs | 2 -- 8 files changed, 12 insertions(+), 11 deletions(-) delete mode 100644 pagetop/src/base.rs delete mode 100644 pagetop/src/base/theme.rs rename pagetop/src/{base => core}/theme/basic.rs (70%) diff --git a/pagetop/src/base.rs b/pagetop/src/base.rs deleted file mode 100644 index 9757ba5f..00000000 --- a/pagetop/src/base.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod theme; diff --git a/pagetop/src/base/theme.rs b/pagetop/src/base/theme.rs deleted file mode 100644 index 3a192746..00000000 --- a/pagetop/src/base/theme.rs +++ /dev/null @@ -1,2 +0,0 @@ -mod basic; -pub use basic::Basic; diff --git a/pagetop/src/core/module/all.rs b/pagetop/src/core/module/all.rs index 428fbfc4..6575b3a9 100644 --- a/pagetop/src/core/module/all.rs +++ b/pagetop/src/core/module/all.rs @@ -28,7 +28,7 @@ pub fn register_modules(app: ModuleStaticRef) { let mut list: Vec = Vec::new(); // Enable basic theme. - add_to_enabled(&mut list, &crate::base::theme::Basic); + add_to_enabled(&mut list, &crate::core::theme::Basic); // Enable application modules. add_to_enabled(&mut list, app); diff --git a/pagetop/src/core/theme.rs b/pagetop/src/core/theme.rs index 696e2407..97430df2 100644 --- a/pagetop/src/core/theme.rs +++ b/pagetop/src/core/theme.rs @@ -6,3 +6,6 @@ pub use regions::add_component_to; pub(crate) use regions::ComponentsRegions; pub(crate) mod all; + +mod basic; +pub(crate) use basic::Basic; diff --git a/pagetop/src/core/theme/all.rs b/pagetop/src/core/theme/all.rs index 8c7dbc01..fcc09467 100644 --- a/pagetop/src/core/theme/all.rs +++ b/pagetop/src/core/theme/all.rs @@ -14,7 +14,7 @@ pub static THEMES: LazyStatic>> = pub static THEME: LazyStatic = LazyStatic::new(|| match theme_by_single_name(&config::SETTINGS.app.theme) { Some(theme) => theme, - None => &crate::base::theme::Basic, + None => &crate::core::theme::Basic, }); // THEME BY NAME *********************************************************************************** diff --git a/pagetop/src/base/theme/basic.rs b/pagetop/src/core/theme/basic.rs similarity index 70% rename from pagetop/src/base/theme/basic.rs rename to pagetop/src/core/theme/basic.rs index daed3205..7eb22e5c 100644 --- a/pagetop/src/base/theme/basic.rs +++ b/pagetop/src/core/theme/basic.rs @@ -1,4 +1,10 @@ -use crate::prelude::*; +use crate::core::component::ContextOp; +use crate::core::module::ModuleTrait; +use crate::core::theme::{ThemeStaticRef, ThemeTrait}; +use crate::html::{Favicon, StyleSheet}; +use crate::response::page::Page; +use crate::service; +use crate::{serve_static_files, use_handle, use_static, Handle}; use_handle!(THEME_BASIC); diff --git a/pagetop/src/lib.rs b/pagetop/src/lib.rs index 76a8134a..2fd99261 100644 --- a/pagetop/src/lib.rs +++ b/pagetop/src/lib.rs @@ -138,9 +138,6 @@ pub mod db; // APIs esenciales para crear acciones, componentes, módulos y temas. pub mod core; -// Acciones, componentes, módulos y temas integrados en PageTop. -pub mod base; - // API para operar con los servicios web. pub mod service; diff --git a/pagetop/src/prelude.rs b/pagetop/src/prelude.rs index 6dc2c069..b6bd2924 100644 --- a/pagetop/src/prelude.rs +++ b/pagetop/src/prelude.rs @@ -30,8 +30,6 @@ pub use crate::core::component::*; pub use crate::core::module::*; pub use crate::core::theme::*; -pub use crate::base::theme; - pub use crate::service; pub use crate::service::HttpMessage;