🚚 Renombra el tema predefinido Basic a Monster
This commit is contained in:
parent
9a49186ed2
commit
58d6ea6719
11 changed files with 19 additions and 19 deletions
|
|
@ -22,7 +22,7 @@ impl ModuleTrait for Aliner {
|
||||||
|
|
||||||
impl ThemeTrait for Aliner {
|
impl ThemeTrait for Aliner {
|
||||||
fn before_prepare_body(&self, page: &mut Page) {
|
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(
|
.alter_context(ContextOp::AddStyleSheet(
|
||||||
StyleSheet::at("/aliner/css/styles.css").with_weight(-99),
|
StyleSheet::at("/aliner/css/styles.css").with_weight(-99),
|
||||||
));
|
));
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ impl ThemeTrait for Bootsier {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn before_prepare_body(&self, page: &mut Page) {
|
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(
|
.alter_context(ContextOp::AddStyleSheet(
|
||||||
StyleSheet::at("/bootsier/css/bootstrap.min.css")
|
StyleSheet::at("/bootsier/css/bootstrap.min.css")
|
||||||
.with_version("5.1.3")
|
.with_version("5.1.3")
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ impl ModuleTrait for Bulmix {
|
||||||
|
|
||||||
impl ThemeTrait for Bulmix {
|
impl ThemeTrait for Bulmix {
|
||||||
fn before_prepare_body(&self, page: &mut Page) {
|
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(
|
.alter_context(ContextOp::AddStyleSheet(
|
||||||
StyleSheet::at("/bulmix/css/bulma.min.css")
|
StyleSheet::at("/bulmix/css/bulma.min.css")
|
||||||
.with_version("0.9.4")
|
.with_version("0.9.4")
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
use pagetop_build::StaticFilesBundle;
|
use pagetop_build::StaticFilesBundle;
|
||||||
|
|
||||||
fn main() -> std::io::Result<()> {
|
fn main() -> std::io::Result<()> {
|
||||||
StaticFilesBundle::from_dir("./static/theme")
|
StaticFilesBundle::from_dir("./static/monster")
|
||||||
.with_name("theme")
|
.with_name("monster")
|
||||||
.build()
|
.build()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ pub fn register_modules(app: ModuleStaticRef) {
|
||||||
let mut list: Vec<ModuleStaticRef> = Vec::new();
|
let mut list: Vec<ModuleStaticRef> = Vec::new();
|
||||||
|
|
||||||
// Enable basic theme.
|
// 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.
|
// Enable application modules.
|
||||||
add_to_enabled(&mut list, app);
|
add_to_enabled(&mut list, app);
|
||||||
|
|
|
||||||
|
|
@ -7,4 +7,4 @@ pub(crate) use regions::ComponentsRegions;
|
||||||
|
|
||||||
pub(crate) mod all;
|
pub(crate) mod all;
|
||||||
|
|
||||||
pub(crate) mod basic;
|
pub(crate) mod monster;
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ pub static THEMES: LazyStatic<RwLock<Vec<ThemeStaticRef>>> =
|
||||||
pub static THEME: LazyStatic<ThemeStaticRef> =
|
pub static THEME: LazyStatic<ThemeStaticRef> =
|
||||||
LazyStatic::new(|| match theme_by_single_name(&config::SETTINGS.app.theme) {
|
LazyStatic::new(|| match theme_by_single_name(&config::SETTINGS.app.theme) {
|
||||||
Some(theme) => theme,
|
Some(theme) => theme,
|
||||||
None => &crate::core::theme::basic::Basic,
|
None => &crate::core::theme::monster::Monster,
|
||||||
});
|
});
|
||||||
|
|
||||||
// THEME BY NAME ***********************************************************************************
|
// THEME BY NAME ***********************************************************************************
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ pub trait ThemeTrait: ModuleTrait + Send + Sync {
|
||||||
|
|
||||||
fn after_prepare_body(&self, page: &mut Page) {
|
fn after_prepare_body(&self, page: &mut Page) {
|
||||||
if page.favicon().is_none() {
|
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")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,31 +6,31 @@ use crate::response::page::Page;
|
||||||
use crate::service;
|
use crate::service;
|
||||||
use crate::{serve_static_files, use_handle, use_static, Handle};
|
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 {
|
fn handle(&self) -> Handle {
|
||||||
THEME_BASIC
|
THEME_MONSTER
|
||||||
}
|
}
|
||||||
|
|
||||||
fn theme(&self) -> Option<ThemeStaticRef> {
|
fn theme(&self) -> Option<ThemeStaticRef> {
|
||||||
Some(&Basic)
|
Some(&Monster)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn configure_service(&self, cfg: &mut service::web::ServiceConfig) {
|
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) {
|
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(
|
.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"),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
Loading…
Add table
Add a link
Reference in a new issue