From 58d6ea67192956588d51aa21201a7e2e2251e688 Mon Sep 17 00:00:00 2001 From: Manuel Cillero Date: Wed, 12 Jul 2023 00:24:37 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=9A=20Renombra=20el=20tema=20predefini?= =?UTF-8?q?do=20Basic=20a=20Monster?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pagetop-aliner/src/lib.rs | 2 +- pagetop-bootsier/src/lib.rs | 2 +- pagetop-bulmix/src/lib.rs | 2 +- pagetop/build.rs | 4 ++-- pagetop/src/core/module/all.rs | 2 +- pagetop/src/core/theme.rs | 2 +- pagetop/src/core/theme/all.rs | 2 +- pagetop/src/core/theme/definition.rs | 2 +- .../src/core/theme/{basic.rs => monster.rs} | 20 +++++++++--------- .../{theme => monster}/css/normalize.min.css | 0 pagetop/static/{theme => monster}/favicon.ico | Bin 11 files changed, 19 insertions(+), 19 deletions(-) rename pagetop/src/core/theme/{basic.rs => monster.rs} (59%) rename pagetop/static/{theme => monster}/css/normalize.min.css (100%) rename pagetop/static/{theme => monster}/favicon.ico (100%) diff --git a/pagetop-aliner/src/lib.rs b/pagetop-aliner/src/lib.rs index f532eef1..f5551088 100644 --- a/pagetop-aliner/src/lib.rs +++ b/pagetop-aliner/src/lib.rs @@ -22,7 +22,7 @@ impl ModuleTrait for Aliner { impl ThemeTrait for Aliner { fn before_prepare_body(&self, page: &mut Page) { - page.alter_favicon(Some(Favicon::new().with_icon("/theme/favicon.ico"))) + page.alter_favicon(Some(Favicon::new().with_icon("/monster/favicon.ico"))) .alter_context(ContextOp::AddStyleSheet( StyleSheet::at("/aliner/css/styles.css").with_weight(-99), )); diff --git a/pagetop-bootsier/src/lib.rs b/pagetop-bootsier/src/lib.rs index 338cc6cf..7f4abe0d 100644 --- a/pagetop-bootsier/src/lib.rs +++ b/pagetop-bootsier/src/lib.rs @@ -44,7 +44,7 @@ impl ThemeTrait for Bootsier { } fn before_prepare_body(&self, page: &mut Page) { - page.alter_favicon(Some(Favicon::new().with_icon("/theme/favicon.ico"))) + page.alter_favicon(Some(Favicon::new().with_icon("/monster/favicon.ico"))) .alter_context(ContextOp::AddStyleSheet( StyleSheet::at("/bootsier/css/bootstrap.min.css") .with_version("5.1.3") diff --git a/pagetop-bulmix/src/lib.rs b/pagetop-bulmix/src/lib.rs index 9059ed56..988d97f0 100644 --- a/pagetop-bulmix/src/lib.rs +++ b/pagetop-bulmix/src/lib.rs @@ -32,7 +32,7 @@ impl ModuleTrait for Bulmix { impl ThemeTrait for Bulmix { fn before_prepare_body(&self, page: &mut Page) { - page.alter_favicon(Some(Favicon::new().with_icon("/theme/favicon.ico"))) + page.alter_favicon(Some(Favicon::new().with_icon("/monster/favicon.ico"))) .alter_context(ContextOp::AddStyleSheet( StyleSheet::at("/bulmix/css/bulma.min.css") .with_version("0.9.4") diff --git a/pagetop/build.rs b/pagetop/build.rs index 3e2d9749..d1a5030f 100644 --- a/pagetop/build.rs +++ b/pagetop/build.rs @@ -1,7 +1,7 @@ use pagetop_build::StaticFilesBundle; fn main() -> std::io::Result<()> { - StaticFilesBundle::from_dir("./static/theme") - .with_name("theme") + StaticFilesBundle::from_dir("./static/monster") + .with_name("monster") .build() } diff --git a/pagetop/src/core/module/all.rs b/pagetop/src/core/module/all.rs index a98a1088..e3dfac8e 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::core::theme::basic::Basic); + add_to_enabled(&mut list, &crate::core::theme::monster::Monster); // Enable application modules. add_to_enabled(&mut list, app); diff --git a/pagetop/src/core/theme.rs b/pagetop/src/core/theme.rs index 608fe573..84bc68dc 100644 --- a/pagetop/src/core/theme.rs +++ b/pagetop/src/core/theme.rs @@ -7,4 +7,4 @@ pub(crate) use regions::ComponentsRegions; pub(crate) mod all; -pub(crate) mod basic; +pub(crate) mod monster; diff --git a/pagetop/src/core/theme/all.rs b/pagetop/src/core/theme/all.rs index d46d08c6..eabc66e3 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::core::theme::basic::Basic, + None => &crate::core::theme::monster::Monster, }); // THEME BY NAME *********************************************************************************** diff --git a/pagetop/src/core/theme/definition.rs b/pagetop/src/core/theme/definition.rs index cb347ef6..2a6c7d09 100644 --- a/pagetop/src/core/theme/definition.rs +++ b/pagetop/src/core/theme/definition.rs @@ -37,7 +37,7 @@ pub trait ThemeTrait: ModuleTrait + Send + Sync { fn after_prepare_body(&self, page: &mut Page) { if page.favicon().is_none() { - page.alter_favicon(Some(Favicon::new().with_icon("/theme/favicon.ico"))); + page.alter_favicon(Some(Favicon::new().with_icon("/monster/favicon.ico"))); } } diff --git a/pagetop/src/core/theme/basic.rs b/pagetop/src/core/theme/monster.rs similarity index 59% rename from pagetop/src/core/theme/basic.rs rename to pagetop/src/core/theme/monster.rs index 0a2091b6..c90471db 100644 --- a/pagetop/src/core/theme/basic.rs +++ b/pagetop/src/core/theme/monster.rs @@ -6,31 +6,31 @@ use crate::response::page::Page; use crate::service; use crate::{serve_static_files, use_handle, use_static, Handle}; -use_handle!(THEME_BASIC); +use_handle!(THEME_MONSTER); -use_static!(theme); +use_static!(monster); -pub struct Basic; +pub struct Monster; -impl ModuleTrait for Basic { +impl ModuleTrait for Monster { fn handle(&self) -> Handle { - THEME_BASIC + THEME_MONSTER } fn theme(&self) -> Option { - Some(&Basic) + Some(&Monster) } fn configure_service(&self, cfg: &mut service::web::ServiceConfig) { - serve_static_files!(cfg, "/theme", theme); + serve_static_files!(cfg, "/monster", monster); } } -impl ThemeTrait for Basic { +impl ThemeTrait for Monster { fn before_prepare_body(&self, page: &mut Page) { - page.alter_favicon(Some(Favicon::new().with_icon("/theme/favicon.ico"))) + page.alter_favicon(Some(Favicon::new().with_icon("/monster/favicon.ico"))) .alter_context(ContextOp::AddStyleSheet( - StyleSheet::at("/theme/css/normalize.min.css").with_version("8.0.1"), + StyleSheet::at("/monster/css/normalize.min.css").with_version("8.0.1"), )); } } diff --git a/pagetop/static/theme/css/normalize.min.css b/pagetop/static/monster/css/normalize.min.css similarity index 100% rename from pagetop/static/theme/css/normalize.min.css rename to pagetop/static/monster/css/normalize.min.css diff --git a/pagetop/static/theme/favicon.ico b/pagetop/static/monster/favicon.ico similarity index 100% rename from pagetop/static/theme/favicon.ico rename to pagetop/static/monster/favicon.ico