A login view

This commit is contained in:
Lukas Bachschwell 2017-03-19 16:00:06 +01:00
parent 84c49bde58
commit be47815b33

43
views/login.hbs Normal file
View File

@ -0,0 +1,43 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Login</title>
<link rel='stylesheet' href='/css/style.css' />
<link rel='stylesheet' href='/css/bootstrap.min.css' />
<link rel="stylesheet" type="text/css" href="/css/jquery.bracket.min.css" />
<script type='text/javascript' src='/js/jquery-3.1.1.min.js'></script>
<script type='text/javascript' src='/js/jquery.bracket.min.js'></script>
<script type='text/javascript' src='/js/bootstrap.min.js'></script>
<script type='text/javascript' src='/socket.io/socket.io.js'></script>
<script>
$(document).ready(function(){
var email,pass;
$("#submit").click(function(){
email=$("#email").val();
pass=$("#password").val();
/*
* Perform some validation here.
*/
$.post("http://localhost:3000/login",{email:email,passwd:pass},function(data){
console.log(data);
if(data==='done')
{
window.location.href="/admin";
}
});
});
});
</script>
</head>
<body>
<h1>{{mainHeader}}</h1>
<input type="text" size="40" placeholder="Type your email" id="email"><br />
<input type="password" size="40" placeholder="Type your password" id="password"><br />
<input type="button" value="Submit" id="submit">
</body>
</html>