🚚 Errors 403 and 404 are base components
This commit is contained in:
parent
e25cf3eecc
commit
62b32ebcee
4 changed files with 18 additions and 9 deletions
|
|
@ -136,21 +136,34 @@ pub mod flex;
|
||||||
|
|
||||||
mod icon;
|
mod icon;
|
||||||
pub use icon::Icon;
|
pub use icon::Icon;
|
||||||
|
|
||||||
mod heading;
|
mod heading;
|
||||||
pub use heading::{Heading, HeadingDisplay, HeadingType};
|
pub use heading::{Heading, HeadingDisplay, HeadingType};
|
||||||
|
|
||||||
mod paragraph;
|
mod paragraph;
|
||||||
pub use paragraph::Paragraph;
|
pub use paragraph::Paragraph;
|
||||||
|
|
||||||
mod button;
|
mod button;
|
||||||
pub use button::{Button, ButtonTarget, ButtonType};
|
pub use button::{Button, ButtonTarget, ButtonType};
|
||||||
|
|
||||||
mod image;
|
mod image;
|
||||||
pub use image::{Image, ImageSize};
|
pub use image::{Image, ImageSize};
|
||||||
|
|
||||||
mod block;
|
mod block;
|
||||||
pub use block::Block;
|
pub use block::Block;
|
||||||
|
|
||||||
mod branding;
|
mod branding;
|
||||||
pub use branding::Branding;
|
pub use branding::Branding;
|
||||||
|
|
||||||
mod powered_by;
|
mod powered_by;
|
||||||
pub use powered_by::{PoweredBy, PoweredByLogo};
|
pub use powered_by::{PoweredBy, PoweredByLogo};
|
||||||
|
|
||||||
|
mod error403;
|
||||||
|
pub use error403::Error403;
|
||||||
|
|
||||||
|
mod error404;
|
||||||
|
pub use error404::Error404;
|
||||||
|
|
||||||
pub mod menu;
|
pub mod menu;
|
||||||
pub use menu::Menu;
|
pub use menu::Menu;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ pub struct Error403;
|
||||||
|
|
||||||
impl ComponentTrait for Error403 {
|
impl ComponentTrait for Error403 {
|
||||||
fn new() -> Self {
|
fn new() -> Self {
|
||||||
Self
|
Error403
|
||||||
}
|
}
|
||||||
|
|
||||||
fn prepare_component(&self, _cx: &mut Context) -> PrepareMarkup {
|
fn prepare_component(&self, _cx: &mut Context) -> PrepareMarkup {
|
||||||
|
|
@ -7,7 +7,7 @@ pub struct Error404;
|
||||||
|
|
||||||
impl ComponentTrait for Error404 {
|
impl ComponentTrait for Error404 {
|
||||||
fn new() -> Self {
|
fn new() -> Self {
|
||||||
Self
|
Error404
|
||||||
}
|
}
|
||||||
|
|
||||||
fn prepare_component(&self, _cx: &mut Context) -> PrepareMarkup {
|
fn prepare_component(&self, _cx: &mut Context) -> PrepareMarkup {
|
||||||
|
|
@ -1,8 +1,4 @@
|
||||||
mod error403;
|
use crate::base::component::{Error403, Error404};
|
||||||
pub use error403::Error403;
|
|
||||||
mod error404;
|
|
||||||
pub use error404::Error404;
|
|
||||||
|
|
||||||
use crate::locale::L10n;
|
use crate::locale::L10n;
|
||||||
use crate::response::{page::Page, ResponseError};
|
use crate::response::{page::Page, ResponseError};
|
||||||
use crate::service::http::{header::ContentType, StatusCode};
|
use crate::service::http::{header::ContentType, StatusCode};
|
||||||
|
|
@ -33,7 +29,7 @@ impl fmt::Display for FatalError {
|
||||||
let error_page = Page::new(request.clone());
|
let error_page = Page::new(request.clone());
|
||||||
if let Ok(page) = error_page
|
if let Ok(page) = error_page
|
||||||
.with_title(L10n::n("Error FORBIDDEN"))
|
.with_title(L10n::n("Error FORBIDDEN"))
|
||||||
.with_in("content", error403::Error403)
|
.with_in("content", Error403)
|
||||||
.with_template("error")
|
.with_template("error")
|
||||||
.render()
|
.render()
|
||||||
{
|
{
|
||||||
|
|
@ -47,7 +43,7 @@ impl fmt::Display for FatalError {
|
||||||
let error_page = Page::new(request.clone());
|
let error_page = Page::new(request.clone());
|
||||||
if let Ok(page) = error_page
|
if let Ok(page) = error_page
|
||||||
.with_title(L10n::n("Error RESOURCE NOT FOUND"))
|
.with_title(L10n::n("Error RESOURCE NOT FOUND"))
|
||||||
.with_in("content", error404::Error404)
|
.with_in("content", Error404)
|
||||||
.with_template("error")
|
.with_template("error")
|
||||||
.render()
|
.render()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue