fixed 404 navbar
This commit is contained in:
parent
9606eea9e8
commit
5d21e028db
|
@ -68,10 +68,9 @@ impl Server {
|
||||||
Extension(srv): Extension<Server>,
|
Extension(srv): Extension<Server>,
|
||||||
cookies: Cookies,
|
cookies: Cookies,
|
||||||
) -> Result<impl IntoResponse, ServerError> {
|
) -> Result<impl IntoResponse, ServerError> {
|
||||||
let user = srv.from_cookies(cookies)?;
|
|
||||||
Ok((
|
Ok((
|
||||||
StatusCode::OK,
|
StatusCode::OK,
|
||||||
response::Html(srv.hb.render("index", &user)?),
|
response::Html(srv.hb.render("index", &srv.from_cookies(cookies)?)?),
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -95,8 +94,8 @@ impl Server {
|
||||||
cookies: Cookies,
|
cookies: Cookies,
|
||||||
) -> Result<impl IntoResponse, ServerError> {
|
) -> Result<impl IntoResponse, ServerError> {
|
||||||
Ok((
|
Ok((
|
||||||
StatusCode::OK,
|
StatusCode::NOT_FOUND,
|
||||||
response::Html(srv.hb.render("404", &srv.from_cookies(cookies)?)?),
|
response::Html(srv.hb.render("err404", &srv.from_cookies(cookies)?)?),
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -41,8 +41,8 @@ impl Server {
|
||||||
.expect("success-partial");
|
.expect("success-partial");
|
||||||
hb.register_template_string("index", include_str!("../../templates/html/index.html"))
|
hb.register_template_string("index", include_str!("../../templates/html/index.html"))
|
||||||
.expect("index");
|
.expect("index");
|
||||||
hb.register_template_string("404", include_str!("../../templates/html/404.html"))
|
hb.register_template_string("err404", include_str!("../../templates/html/404.html"))
|
||||||
.expect("404");
|
.expect("err404");
|
||||||
hb.register_partial(
|
hb.register_partial(
|
||||||
"LoggedOut",
|
"LoggedOut",
|
||||||
include_str!("../../templates/html/nav-loggedout.html"),
|
include_str!("../../templates/html/nav-loggedout.html"),
|
||||||
|
|
Loading…
Reference in New Issue