Actualiza y concentra APIs que extienden PageTop
This commit is contained in:
parent
a8cb7f0d29
commit
21b004fc1e
16 changed files with 17 additions and 14 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
use crate::{Lazy, app, base, module, theme, trace};
|
use crate::{Lazy, app, base, trace};
|
||||||
use crate::config::SETTINGS;
|
use crate::config::SETTINGS;
|
||||||
|
use crate::core::{module, theme};
|
||||||
|
|
||||||
use std::io::Error;
|
use std::io::Error;
|
||||||
use actix_web::middleware::normalize::{NormalizePath, TrailingSlash};
|
use actix_web::middleware::normalize::{NormalizePath, TrailingSlash};
|
||||||
|
|
|
||||||
3
pagetop/src/core/mod.rs
Normal file
3
pagetop/src/core/mod.rs
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
pub mod module; // API para añadir módulos con nuevas funcionalidades.
|
||||||
|
pub mod response; // Tipos de respuestas web.
|
||||||
|
pub mod theme; // Temas predefinidos y API para crear temas.
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
use crate::{Lazy, base, concat_string};
|
use crate::{Lazy, base, concat_string};
|
||||||
use crate::config::SETTINGS;
|
use crate::config::SETTINGS;
|
||||||
use crate::html::{Markup, PreEscaped, html};
|
use crate::html::{Markup, PreEscaped, html};
|
||||||
use crate::theme::*;
|
use crate::core::theme::*;
|
||||||
|
|
||||||
static DEFAULT_THEME: Lazy<&dyn ThemeTrait> = Lazy::new(|| {
|
static DEFAULT_THEME: Lazy<&dyn ThemeTrait> = Lazy::new(|| {
|
||||||
match theme_by_name(&SETTINGS.app.theme) {
|
match theme_by_name(&SETTINGS.app.theme) {
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
use crate::html::{Markup, html};
|
use crate::html::{Markup, html};
|
||||||
use crate::response::page::PageAssets;
|
use crate::core::response::page::PageAssets;
|
||||||
use crate::util::partial_type_name;
|
use crate::util::partial_type_name;
|
||||||
|
|
||||||
pub use std::any::Any as AnyComponent;
|
pub use std::any::Any as AnyComponent;
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
use crate::html::{Markup, html};
|
use crate::html::{Markup, html};
|
||||||
use crate::response::page::{PageAssets, ComponentTrait, render_component};
|
use crate::core::response::page::{PageAssets, ComponentTrait, render_component};
|
||||||
|
|
||||||
use std::sync::{Arc, RwLock};
|
use std::sync::{Arc, RwLock};
|
||||||
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
use crate::{Lazy, app, trace};
|
use crate::{Lazy, app, trace};
|
||||||
use crate::config::SETTINGS;
|
use crate::config::SETTINGS;
|
||||||
use crate::html::*;
|
use crate::html::*;
|
||||||
use crate::response::page::*;
|
use crate::core::response::page::*;
|
||||||
|
|
||||||
use std::sync::RwLock;
|
use std::sync::RwLock;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
use crate::{app, concat_string};
|
use crate::{app, concat_string};
|
||||||
use crate::config::SETTINGS;
|
use crate::config::SETTINGS;
|
||||||
use crate::html::{Markup, html};
|
use crate::html::{Markup, html};
|
||||||
use crate::response::page::{ComponentTrait, Favicon, Page, PageAssets};
|
use crate::core::response::page::{ComponentTrait, Favicon, Page, PageAssets};
|
||||||
use crate::base::component::Chunck;
|
use crate::base::component::Chunck;
|
||||||
use crate::util::partial_type_name;
|
use crate::util::partial_type_name;
|
||||||
|
|
||||||
|
|
@ -18,12 +18,9 @@ pub mod html; // HTML en código.
|
||||||
#[cfg(any(feature = "mysql", feature = "postgres", feature = "sqlite"))]
|
#[cfg(any(feature = "mysql", feature = "postgres", feature = "sqlite"))]
|
||||||
pub mod db; // Acceso a base de datos.
|
pub mod db; // Acceso a base de datos.
|
||||||
|
|
||||||
pub mod theme; // Temas predefinidos y API para crear temas.
|
pub mod core; // APIs para módulos, respuestas web y temas.
|
||||||
pub mod module; // API para añadir módulos con nuevas funcionalidades.
|
|
||||||
pub mod response; // Tipos de respuestas web.
|
|
||||||
|
|
||||||
pub mod app; // Aplicación y servidor web.
|
pub mod app; // Aplicación y servidor web.
|
||||||
pub mod base; // Componentes, Módulos y Temas base.
|
pub mod base; // Base de componentes, módulos y temas.
|
||||||
pub mod util; // Macros y funciones útiles.
|
pub mod util; // Macros y funciones útiles.
|
||||||
|
|
||||||
// Re-exports.
|
// Re-exports.
|
||||||
|
|
|
||||||
|
|
@ -16,9 +16,11 @@ pub use crate::html::*;
|
||||||
#[cfg(any(feature = "mysql", feature = "postgres", feature = "sqlite"))]
|
#[cfg(any(feature = "mysql", feature = "postgres", feature = "sqlite"))]
|
||||||
pub use crate::{db, db::*, boxed_migration};
|
pub use crate::{db, db::*, boxed_migration};
|
||||||
|
|
||||||
pub use crate::theme::*;
|
pub use crate::core::{
|
||||||
pub use crate::module::*;
|
module::*,
|
||||||
pub use crate::response::page::*;
|
response::page::*,
|
||||||
|
theme::*,
|
||||||
|
};
|
||||||
|
|
||||||
pub use crate::app;
|
pub use crate::app;
|
||||||
pub use crate::app::application::{Application, essence};
|
pub use crate::app::application::{Application, essence};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue