🚚 Renombra el tema predefinido Basic a Monster

This commit is contained in:
Manuel Cillero 2023-07-12 00:24:37 +02:00
parent 9a49186ed2
commit 58d6ea6719
11 changed files with 19 additions and 19 deletions

View file

@ -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),
));

View file

@ -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")

View file

@ -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")

View file

@ -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()
}

View file

@ -28,7 +28,7 @@ pub fn register_modules(app: ModuleStaticRef) {
let mut list: Vec<ModuleStaticRef> = 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);

View file

@ -7,4 +7,4 @@ pub(crate) use regions::ComponentsRegions;
pub(crate) mod all;
pub(crate) mod basic;
pub(crate) mod monster;

View file

@ -14,7 +14,7 @@ pub static THEMES: LazyStatic<RwLock<Vec<ThemeStaticRef>>> =
pub static THEME: LazyStatic<ThemeStaticRef> =
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 ***********************************************************************************

View file

@ -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")));
}
}

View file

@ -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<ThemeStaticRef> {
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"),
));
}
}

View file

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Before After
Before After