31 lines
1.1 KiB
Rust
31 lines
1.1 KiB
Rust
use maud::{html, PreEscaped};
|
|
|
|
use crate::templates;
|
|
|
|
// https://github.com/tomaka/rouille/blob/master/examples/login-session.rs
|
|
|
|
// /login
|
|
pub fn login() -> PreEscaped<String> {
|
|
let back = "/".to_string();
|
|
let title = "Login".to_string();
|
|
|
|
let content = html! {
|
|
div class="card center" {
|
|
div class="card-container" {
|
|
form id="login_form" action="/login" method="post" {
|
|
// input field for username
|
|
input id="username" name="username" class="center input" type="text" placeholder="Username" title="Username for authentication" autofocus { }
|
|
// input field for password
|
|
input id="password" name="password" class="center input" type="password" placeholder="Password" title="Password for given username" { }
|
|
div id="buttonDiv" {
|
|
// login button
|
|
input id="loginUser" class="button button-primary center" title="Login" type="submit" value="Login" { }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
};
|
|
|
|
templates::base::base(back, title, content)
|
|
}
|