use actix_web::{HttpResponse, Responder}; use askama::Template; use crate::constants::APP_NAME; #[derive(Template)] #[template(path = "base_login_page.html")] struct BaseLoginPage { danger: String, success: String, page_title: &'static str, app_name: &'static str, } #[derive(Template)] #[template(path = "login.html")] struct LoginTemplate { _parent: BaseLoginPage, mail: String, } pub async fn login_route() -> impl Responder { HttpResponse::Ok() .content_type("text/html") .body(LoginTemplate { _parent: BaseLoginPage { page_title: "Login", danger: "".to_string(), success: "".to_string(), app_name: APP_NAME, }, mail: "".to_string() }.render().unwrap()) }