Add base status bar
This commit is contained in:
@ -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)]
|
||||
|
Reference in New Issue
Block a user