✨ Integrate aliner theme with name Chassis
This commit is contained in:
parent
7df917e11a
commit
4472f2ef52
18 changed files with 94 additions and 151 deletions
|
|
@ -11,7 +11,6 @@ members = [
|
||||||
"pagetop-user",
|
"pagetop-user",
|
||||||
"pagetop-node",
|
"pagetop-node",
|
||||||
# Themes.
|
# Themes.
|
||||||
"pagetop-aliner",
|
|
||||||
"pagetop-bootsier",
|
"pagetop-bootsier",
|
||||||
"pagetop-bulmix",
|
"pagetop-bulmix",
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -59,9 +59,6 @@ El repositorio se organiza en un *workspace* con los siguientes subproyectos:
|
||||||
|
|
||||||
## Temas
|
## Temas
|
||||||
|
|
||||||
* **[pagetop-aliner](https://github.com/manuelcillero/pagetop/tree/main/pagetop-aliner)**, tema que
|
|
||||||
delimita con cajas los elementos HTML para mostrar esquemáticamente la composición de las páginas.
|
|
||||||
|
|
||||||
* **[pagetop-bootsier](https://github.com/manuelcillero/pagetop/tree/main/pagetop-bootsier)**, tema
|
* **[pagetop-bootsier](https://github.com/manuelcillero/pagetop/tree/main/pagetop-bootsier)**, tema
|
||||||
que utiliza el *framework* [Bootstrap](https://getbootstrap.com/) para la composición de páginas y
|
que utiliza el *framework* [Bootstrap](https://getbootstrap.com/) para la composición de páginas y
|
||||||
visualización de componentes.
|
visualización de componentes.
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,6 @@ license = "Apache-2.0 OR MIT"
|
||||||
[dependencies]
|
[dependencies]
|
||||||
pagetop = { version = "0.0", path = "../pagetop", features = ["mysql"], default-features = false }
|
pagetop = { version = "0.0", path = "../pagetop", features = ["mysql"], default-features = false }
|
||||||
# Themes.
|
# Themes.
|
||||||
pagetop-aliner = { version = "0.0", path = "../pagetop-aliner" }
|
|
||||||
pagetop-bootsier = { version = "0.0", path = "../pagetop-bootsier" }
|
pagetop-bootsier = { version = "0.0", path = "../pagetop-bootsier" }
|
||||||
pagetop-bulmix = { version = "0.0", path = "../pagetop-bulmix" }
|
pagetop-bulmix = { version = "0.0", path = "../pagetop-bulmix" }
|
||||||
# Modules.
|
# Modules.
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,8 @@
|
||||||
[app]
|
[app]
|
||||||
#theme = "Default"
|
#theme = "Basic"
|
||||||
#theme = "Aliner"
|
#theme = "Chassis"
|
||||||
theme = "Bootsier"
|
theme = "Inception"
|
||||||
|
#theme = "Bootsier"
|
||||||
#theme = "Bulmix"
|
#theme = "Bulmix"
|
||||||
language = "es-ES"
|
language = "es-ES"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,6 @@ impl ModuleTrait for Drust {
|
||||||
fn dependencies(&self) -> Vec<ModuleRef> {
|
fn dependencies(&self) -> Vec<ModuleRef> {
|
||||||
vec![
|
vec![
|
||||||
// Themes.
|
// Themes.
|
||||||
&pagetop_aliner::Aliner,
|
|
||||||
&pagetop_bootsier::Bootsier,
|
&pagetop_bootsier::Bootsier,
|
||||||
&pagetop_bulmix::Bulmix,
|
&pagetop_bulmix::Bulmix,
|
||||||
// Modules.
|
// Modules.
|
||||||
|
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
[package]
|
|
||||||
name = "pagetop-aliner"
|
|
||||||
version = "0.0.9"
|
|
||||||
edition = "2021"
|
|
||||||
|
|
||||||
authors = [
|
|
||||||
"Manuel Cillero <manuel@cillero.es>"
|
|
||||||
]
|
|
||||||
description = """\
|
|
||||||
Theme for PageTop with a basic set of styles that encloses HTML elements with boxes to show an \
|
|
||||||
outline of the page layout and components display.\
|
|
||||||
"""
|
|
||||||
homepage = "https://pagetop.cillero.es"
|
|
||||||
repository = "https://github.com/manuelcillero/pagetop"
|
|
||||||
license = "Apache-2.0 OR MIT"
|
|
||||||
|
|
||||||
[dependencies]
|
|
||||||
pagetop = { version = "0.0", path = "../pagetop" }
|
|
||||||
static-files = "0.2.3"
|
|
||||||
|
|
||||||
[build-dependencies]
|
|
||||||
pagetop-build = { version = "0.0", path = "../pagetop-build" }
|
|
||||||
|
|
@ -1,27 +0,0 @@
|
||||||
Tema para **PageTop** que delimita con cajas los elementos HTML para mostrar esquemáticamente la
|
|
||||||
composición de las páginas.
|
|
||||||
|
|
||||||
[PageTop](https://github.com/manuelcillero/pagetop/tree/main/pagetop), es un entorno de desarrollo
|
|
||||||
basado en algunos de los *crates* más estables y populares del ecosistema Rust para proporcionar
|
|
||||||
APIs, patrones de desarrollo y buenas prácticas para la creación de soluciones web SSR (*Server-Side
|
|
||||||
Rendering*).
|
|
||||||
|
|
||||||
|
|
||||||
# 🚧 Advertencia
|
|
||||||
|
|
||||||
**PageTop** sólo libera actualmente versiones de desarrollo. La API no es estable y los cambios son
|
|
||||||
constantes. No puede considerarse preparado hasta que se libere la versión **0.1.0**.
|
|
||||||
|
|
||||||
|
|
||||||
# 📜 Licencia
|
|
||||||
|
|
||||||
Este proyecto tiene licencia, de hecho tiene dos, puedes aplicar cualquiera de las siguientes a tu
|
|
||||||
elección:
|
|
||||||
|
|
||||||
* Licencia Apache versión 2.0
|
|
||||||
([LICENSE-APACHE](https://github.com/manuelcillero/pagetop/blob/main/LICENSE-APACHE) o
|
|
||||||
[http://www.apache.org/licenses/LICENSE-2.0]).
|
|
||||||
|
|
||||||
* Licencia MIT
|
|
||||||
([LICENSE-MIT](https://github.com/manuelcillero/pagetop/blob/main/LICENSE-MIT) o
|
|
||||||
[http://opensource.org/licenses/MIT]).
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
use pagetop_build::StaticFilesBundle;
|
|
||||||
|
|
||||||
fn main() -> std::io::Result<()> {
|
|
||||||
StaticFilesBundle::from_dir("./static")
|
|
||||||
.with_name("aliner")
|
|
||||||
.build()
|
|
||||||
}
|
|
||||||
|
|
@ -1,30 +0,0 @@
|
||||||
use pagetop::prelude::*;
|
|
||||||
|
|
||||||
new_handle!(THEME_ALINER);
|
|
||||||
|
|
||||||
new_static_files!(aliner);
|
|
||||||
|
|
||||||
pub struct Aliner;
|
|
||||||
|
|
||||||
impl ModuleTrait for Aliner {
|
|
||||||
fn handle(&self) -> Handle {
|
|
||||||
THEME_ALINER
|
|
||||||
}
|
|
||||||
|
|
||||||
fn theme(&self) -> Option<ThemeRef> {
|
|
||||||
Some(&Aliner)
|
|
||||||
}
|
|
||||||
|
|
||||||
fn configure_service(&self, scfg: &mut service::web::ServiceConfig) {
|
|
||||||
service_for_static_files!(scfg, "/aliner", aliner);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl ThemeTrait for Aliner {
|
|
||||||
fn before_prepare_body(&self, page: &mut Page) {
|
|
||||||
page.alter_favicon(Some(Favicon::new().with_icon("/base/favicon.ico")))
|
|
||||||
.alter_context(ContextOp::AddStyleSheet(
|
|
||||||
StyleSheet::at("/aliner/css/styles.css").with_weight(-99),
|
|
||||||
));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,2 +1,8 @@
|
||||||
|
mod basic;
|
||||||
|
pub use basic::{Basic, THEME_BASIC};
|
||||||
|
|
||||||
|
mod chassis;
|
||||||
|
pub use chassis::{Chassis, THEME_CHASSIS};
|
||||||
|
|
||||||
mod inception;
|
mod inception;
|
||||||
pub use inception::{Inception, THEME_INCEPTION};
|
pub use inception::{Inception, THEME_INCEPTION};
|
||||||
|
|
|
||||||
36
pagetop/src/base/theme/basic.rs
Normal file
36
pagetop/src/base/theme/basic.rs
Normal file
|
|
@ -0,0 +1,36 @@
|
||||||
|
use crate::prelude::*;
|
||||||
|
|
||||||
|
new_handle!(THEME_BASIC);
|
||||||
|
|
||||||
|
pub struct Basic;
|
||||||
|
|
||||||
|
impl ModuleTrait for Basic {
|
||||||
|
fn handle(&self) -> Handle {
|
||||||
|
THEME_BASIC
|
||||||
|
}
|
||||||
|
|
||||||
|
fn name(&self) -> L10n {
|
||||||
|
L10n::n("Basic")
|
||||||
|
}
|
||||||
|
|
||||||
|
fn theme(&self) -> Option<ThemeRef> {
|
||||||
|
Some(&Basic)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl ThemeTrait for Basic {
|
||||||
|
fn after_prepare_body(&self, page: &mut Page) {
|
||||||
|
page.alter_favicon(Some(Favicon::new().with_icon("/base/favicon.ico")))
|
||||||
|
.alter_context(ContextOp::AddStyleSheet(
|
||||||
|
StyleSheet::at("/base/css/normalize.min.css")
|
||||||
|
.with_version("8.0.1")
|
||||||
|
.with_weight(-90),
|
||||||
|
))
|
||||||
|
.alter_context(ContextOp::AddBaseAssets)
|
||||||
|
.alter_context(ContextOp::AddStyleSheet(
|
||||||
|
StyleSheet::at("/base/css/basic.css")
|
||||||
|
.with_version("0.0.1")
|
||||||
|
.with_weight(-90),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
36
pagetop/src/base/theme/chassis.rs
Normal file
36
pagetop/src/base/theme/chassis.rs
Normal file
|
|
@ -0,0 +1,36 @@
|
||||||
|
use crate::prelude::*;
|
||||||
|
|
||||||
|
new_handle!(THEME_CHASSIS);
|
||||||
|
|
||||||
|
pub struct Chassis;
|
||||||
|
|
||||||
|
impl ModuleTrait for Chassis {
|
||||||
|
fn handle(&self) -> Handle {
|
||||||
|
THEME_CHASSIS
|
||||||
|
}
|
||||||
|
|
||||||
|
fn name(&self) -> L10n {
|
||||||
|
L10n::n("Chassis")
|
||||||
|
}
|
||||||
|
|
||||||
|
fn theme(&self) -> Option<ThemeRef> {
|
||||||
|
Some(&Chassis)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl ThemeTrait for Chassis {
|
||||||
|
fn after_prepare_body(&self, page: &mut Page) {
|
||||||
|
page.alter_favicon(Some(Favicon::new().with_icon("/base/favicon.ico")))
|
||||||
|
.alter_context(ContextOp::AddStyleSheet(
|
||||||
|
StyleSheet::at("/base/css/normalize.min.css")
|
||||||
|
.with_version("8.0.1")
|
||||||
|
.with_weight(-90),
|
||||||
|
))
|
||||||
|
.alter_context(ContextOp::AddBaseAssets)
|
||||||
|
.alter_context(ContextOp::AddStyleSheet(
|
||||||
|
StyleSheet::at("/base/css/chassis.css")
|
||||||
|
.with_version("0.0.1")
|
||||||
|
.with_weight(-90),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -2,8 +2,6 @@ use crate::prelude::*;
|
||||||
|
|
||||||
new_handle!(THEME_INCEPTION);
|
new_handle!(THEME_INCEPTION);
|
||||||
|
|
||||||
new_static_files!(base);
|
|
||||||
|
|
||||||
pub struct Inception;
|
pub struct Inception;
|
||||||
|
|
||||||
impl ModuleTrait for Inception {
|
impl ModuleTrait for Inception {
|
||||||
|
|
@ -12,16 +10,12 @@ impl ModuleTrait for Inception {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn name(&self) -> L10n {
|
fn name(&self) -> L10n {
|
||||||
L10n::n("Default")
|
L10n::n("Inception")
|
||||||
}
|
}
|
||||||
|
|
||||||
fn theme(&self) -> Option<ThemeRef> {
|
fn theme(&self) -> Option<ThemeRef> {
|
||||||
Some(&Inception)
|
Some(&Inception)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn configure_service(&self, scfg: &mut service::web::ServiceConfig) {
|
|
||||||
service_for_static_files!(scfg, "/base", base);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ThemeTrait for Inception {
|
impl ThemeTrait for Inception {
|
||||||
|
|
@ -34,7 +28,7 @@ impl ThemeTrait for Inception {
|
||||||
))
|
))
|
||||||
.alter_context(ContextOp::AddBaseAssets)
|
.alter_context(ContextOp::AddBaseAssets)
|
||||||
.alter_context(ContextOp::AddStyleSheet(
|
.alter_context(ContextOp::AddStyleSheet(
|
||||||
StyleSheet::at("/base/css/styles.css")
|
StyleSheet::at("/base/css/inception.css")
|
||||||
.with_version("0.0.1")
|
.with_version("0.0.1")
|
||||||
.with_weight(-90),
|
.with_weight(-90),
|
||||||
));
|
));
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,15 @@
|
||||||
use crate::core::action::add_action;
|
use crate::core::action::add_action;
|
||||||
use crate::core::module::ModuleRef;
|
use crate::core::module::ModuleRef;
|
||||||
use crate::core::theme::all::THEMES;
|
use crate::core::theme::all::THEMES;
|
||||||
use crate::{service, trace, LazyStatic};
|
use crate::{new_static_files, service, service_for_static_files, trace, LazyStatic};
|
||||||
|
|
||||||
#[cfg(feature = "database")]
|
#[cfg(feature = "database")]
|
||||||
use crate::db::*;
|
use crate::db::*;
|
||||||
|
|
||||||
use std::sync::RwLock;
|
use std::sync::RwLock;
|
||||||
|
|
||||||
|
new_static_files!(base);
|
||||||
|
|
||||||
// MODULES *****************************************************************************************
|
// MODULES *****************************************************************************************
|
||||||
|
|
||||||
static ENABLED_MODULES: LazyStatic<RwLock<Vec<ModuleRef>>> =
|
static ENABLED_MODULES: LazyStatic<RwLock<Vec<ModuleRef>>> =
|
||||||
|
|
@ -27,7 +29,9 @@ pub fn register_modules(app: ModuleRef) {
|
||||||
// List of modules to enable.
|
// List of modules to enable.
|
||||||
let mut list: Vec<ModuleRef> = Vec::new();
|
let mut list: Vec<ModuleRef> = Vec::new();
|
||||||
|
|
||||||
// Enable default theme.
|
// Enable default themes.
|
||||||
|
add_to_enabled(&mut list, &crate::base::theme::Basic);
|
||||||
|
add_to_enabled(&mut list, &crate::base::theme::Chassis);
|
||||||
add_to_enabled(&mut list, &crate::base::theme::Inception);
|
add_to_enabled(&mut list, &crate::base::theme::Inception);
|
||||||
|
|
||||||
// Enable application modules.
|
// Enable application modules.
|
||||||
|
|
@ -153,6 +157,7 @@ pub fn run_migrations() {
|
||||||
// CONFIGURE SERVICES ******************************************************************************
|
// CONFIGURE SERVICES ******************************************************************************
|
||||||
|
|
||||||
pub fn configure_services(scfg: &mut service::web::ServiceConfig) {
|
pub fn configure_services(scfg: &mut service::web::ServiceConfig) {
|
||||||
|
service_for_static_files!(scfg, "/base", base);
|
||||||
for m in ENABLED_MODULES.read().unwrap().iter() {
|
for m in ENABLED_MODULES.read().unwrap().iter() {
|
||||||
m.configure_service(scfg);
|
m.configure_service(scfg);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
3
pagetop/static/base/css/basic.css
Normal file
3
pagetop/static/base/css/basic.css
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
.pt-body__skip {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
@ -1,46 +0,0 @@
|
||||||
/* Image component */
|
|
||||||
|
|
||||||
.pt-img__fluid {
|
|
||||||
max-width: 100%;
|
|
||||||
height: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Branding component */
|
|
||||||
|
|
||||||
.pt-branding__wrapper {
|
|
||||||
display: flex;
|
|
||||||
align-items: flex-end;
|
|
||||||
column-gap: var(--pt-gap-0-75);
|
|
||||||
}
|
|
||||||
.pt-branding__name {
|
|
||||||
letter-spacing: 0.02em;
|
|
||||||
font-size: var(--pt-font-size-xl);
|
|
||||||
}
|
|
||||||
.pt-branding__slogan {
|
|
||||||
font-size: var(--pt-font-size-l);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* SM - Applies <= 568px */
|
|
||||||
@media (max-width: 35.5em) {
|
|
||||||
.pt-branding__logo {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/* LG - Applies <= 992px */
|
|
||||||
@media (max-width: 62em) {
|
|
||||||
.pt-branding__slogan {
|
|
||||||
font-size: var(--pt-font-size-l);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* PoweredBy component */
|
|
||||||
|
|
||||||
#pt-powered-by {
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
#pt-powered-by .pt-pagetop__logo img,
|
|
||||||
#pt-powered-by .pt-pagetop__logo svg {
|
|
||||||
margin-left: .275em;
|
|
||||||
height: 1.275em;
|
|
||||||
vertical-align: middle;
|
|
||||||
}
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue