summaryrefslogtreecommitdiff
path: root/src/render/mod.rs
diff options
context:
space:
mode:
authorKjetil Orbekk <kjetil.orbekk@gmail.com>2017-06-17 22:23:39 -0400
committerKjetil Orbekk <kjetil.orbekk@gmail.com>2017-06-17 22:23:59 -0400
commit1e5f237c20310cbf6ace17b6a7b05298429aca46 (patch)
tree61c67dc5846cec4a79e960eb4e28afa1699272de /src/render/mod.rs
parent41025a52fe3d2e4988296bfdc1ef549b60b8b667 (diff)
feature: Working login with authentication.
Diffstat (limited to 'src/render/mod.rs')
-rw-r--r--src/render/mod.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/render/mod.rs b/src/render/mod.rs
index 8575e9b..fe0053a 100644
--- a/src/render/mod.rs
+++ b/src/render/mod.rs
@@ -13,6 +13,7 @@ impl Renderer {
info!("Rendering page with context: {:?}", self);
let login_box: Box<RenderBox> = match self.user {
Some(ref user) => box_html!{
+ : "Logged in as ";
: user;
: " (";
a(href="logout") { // TODO get base url from context
@@ -57,9 +58,14 @@ impl Renderer {
}).into_string().unwrap()
}
- pub fn login_page(&self) -> String {
+ pub fn login_page(&self, is_retry: bool) -> String {
self.render_in_page(box_html! {
h1 { : "Log in" }
+ @ if is_retry {
+ p {
+ : "Incorrect username or password. Try again."
+ }
+ }
form(method="post") {
p { : "Username" }
input(type="text", name="username") {}