Actualiza el componente Chunck para llamarse Html
This commit is contained in:
parent
bd5ccdef8a
commit
280fa4cac1
5 changed files with 17 additions and 17 deletions
|
|
@ -48,7 +48,7 @@ pub async fn summary() -> ResultPage<Markup, FatalError> {
|
|||
"content",
|
||||
grid::Row::new()
|
||||
.with_column(grid::Column::new().with_component(side_menu))
|
||||
.with_column(grid::Column::new().with_component(Chunck::with(html! {
|
||||
.with_column(grid::Column::new().with_component(Html::with(html! {
|
||||
p { "Columna 2"}
|
||||
}))),
|
||||
)
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ pub use container::{Container, ContainerType, COMPONENT_CONTAINER};
|
|||
|
||||
pub mod grid;
|
||||
|
||||
mod chunck;
|
||||
pub use chunck::{Chunck, COMPONENT_CHUNCK};
|
||||
mod html;
|
||||
pub use html::{Html, COMPONENT_HTML};
|
||||
mod icon;
|
||||
pub use icon::{Icon, COMPONENT_ICON};
|
||||
mod heading;
|
||||
|
|
|
|||
|
|
@ -1,17 +1,17 @@
|
|||
use crate::prelude::*;
|
||||
|
||||
pub const COMPONENT_CHUNCK: &str = "pagetop::component::chunck";
|
||||
pub const COMPONENT_HTML: &str = "pagetop::component::html";
|
||||
|
||||
pub struct Chunck {
|
||||
pub struct Html {
|
||||
weight : isize,
|
||||
renderable: Renderable,
|
||||
html : Markup,
|
||||
template : String,
|
||||
}
|
||||
|
||||
impl ComponentTrait for Chunck {
|
||||
impl ComponentTrait for Html {
|
||||
fn new() -> Self {
|
||||
Chunck {
|
||||
Html {
|
||||
weight : 0,
|
||||
renderable: render_always,
|
||||
html : html! {},
|
||||
|
|
@ -20,7 +20,7 @@ impl ComponentTrait for Chunck {
|
|||
}
|
||||
|
||||
fn handler(&self) -> &'static str {
|
||||
COMPONENT_CHUNCK
|
||||
COMPONENT_HTML
|
||||
}
|
||||
|
||||
fn weight(&self) -> isize {
|
||||
|
|
@ -44,12 +44,12 @@ impl ComponentTrait for Chunck {
|
|||
}
|
||||
}
|
||||
|
||||
impl Chunck {
|
||||
impl Html {
|
||||
pub fn with(html: Markup) -> Self {
|
||||
Chunck::new().with_html(html)
|
||||
Html::new().with_html(html)
|
||||
}
|
||||
|
||||
// Chunck BUILDER.
|
||||
// Html BUILDER.
|
||||
|
||||
pub fn with_weight(mut self, weight: isize) -> Self {
|
||||
self.alter_weight(weight);
|
||||
|
|
@ -71,7 +71,7 @@ impl Chunck {
|
|||
self
|
||||
}
|
||||
|
||||
// Chunck ALTER.
|
||||
// Html ALTER.
|
||||
|
||||
pub fn alter_weight(&mut self, weight: isize) -> &mut Self {
|
||||
self.weight = weight;
|
||||
|
|
@ -93,7 +93,7 @@ impl Chunck {
|
|||
self
|
||||
}
|
||||
|
||||
// Chunck GETTERS.
|
||||
// Html GETTERS.
|
||||
|
||||
pub fn html(&self) -> &Markup {
|
||||
&self.html
|
||||
|
|
@ -37,7 +37,7 @@ impl ThemeTrait for Bootsier {
|
|||
fn error_404_not_found(&self) -> Container {
|
||||
Container::new()
|
||||
.with_component(
|
||||
Chunck::with(html! {
|
||||
Html::with(html! {
|
||||
div class="jumbotron" {
|
||||
div class="media" {
|
||||
img
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
use crate::app;
|
||||
use crate::base::component::{Chunck, Container};
|
||||
use crate::base::component::{Container, Html};
|
||||
use crate::config::SETTINGS;
|
||||
use crate::core::component::{ComponentTrait, InContext, InContextOp};
|
||||
use crate::html::{html, Favicon, Markup};
|
||||
|
|
@ -120,7 +120,7 @@ pub trait ThemeTrait: BaseTheme + Send + Sync {
|
|||
fn error_404_not_found(&self) -> Container {
|
||||
Container::new()
|
||||
.with_component(
|
||||
Chunck::with(html! {
|
||||
Html::with(html! {
|
||||
div {
|
||||
h1 { ("RESOURCE NOT FOUND") }
|
||||
}
|
||||
|
|
@ -131,7 +131,7 @@ pub trait ThemeTrait: BaseTheme + Send + Sync {
|
|||
fn error_403_access_denied(&self) -> Container {
|
||||
Container::new()
|
||||
.with_component(
|
||||
Chunck::with(html! {
|
||||
Html::with(html! {
|
||||
div {
|
||||
h1 { ("FORBIDDEN ACCESS") }
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue