35 lines
1.2 KiB
Rust
35 lines
1.2 KiB
Rust
use maud::{html, PreEscaped};
|
|
|
|
use crate::{templates, utils::theme};
|
|
|
|
// 404 ROUTE NOT FOUND CATCHER
|
|
|
|
/// 404 template builder.
|
|
pub fn build_template() -> PreEscaped<String> {
|
|
let not_found_template = html! {
|
|
div class="card center" {
|
|
div class="capsule-container" {
|
|
div class="capsule info-border" {
|
|
p {
|
|
"No PeachCloud resource exists for this URL. Please ensure that the URL in the address bar is correct."
|
|
}
|
|
p {
|
|
"Click the back arrow in the top-left or the PeachCloud logo at the bottom of your screen to return Home."
|
|
}
|
|
}
|
|
}
|
|
}
|
|
};
|
|
|
|
// wrap the nav bars around the settings menu template content
|
|
// parameters are template, title and back url
|
|
let body =
|
|
templates::nav::build_template(not_found_template, "404: Route Not Found", Some("/"));
|
|
|
|
// query the current theme so we can pass it into the base template builder
|
|
let theme = theme::get_theme();
|
|
|
|
// render the base template with the provided body
|
|
templates::base::build_template(body, theme)
|
|
}
|