Add base status bar

This commit is contained in:
2025-01-22 21:09:45 +01:00
parent 3b208c0103
commit d133513daf
3 changed files with 29 additions and 4 deletions

View File

@ -29,7 +29,9 @@ pub async fn static_file(path: web::Path<String>) -> HttpResult {
#[derive(askama::Template)]
#[template(path = "index.html")]
struct HomeTemplate {}
struct HomeTemplate {
name: String,
}
/// Main route
pub async fn home(session: Session) -> HttpResult {
@ -53,7 +55,7 @@ pub async fn home(session: Session) -> HttpResult {
Ok(HttpResponse::Ok()
.insert_header(("content-type", "text/html"))
.body(HomeTemplate {}.render().unwrap()))
.body(HomeTemplate { name: user.name }.render().unwrap()))
}
#[derive(serde::Deserialize)]