budgeteer/templates/login.html

44 lines
950 B
HTML

{{define "login"}}
<!DOCTYPE html>
<html>
<head>
<title>Login</title>
{{template "head"}}
<script>
$(document).ready(function() {
$('#invalidCredentials').hide();
$('#loginForm').ajaxForm({
success: function() {
window.location.href = "/api/v1/restricted";
},
error: function() {
$('#invalidCredentials').show();
}
});
});
</script>
</head>
<body>
<div class="container" id="head">
Budgeteer
</div>
<div class="container center-block" id="content">
<form id="loginForm" action="/api/v1/login" method="POST">
<label for="username">User</label>
<input type="text" name="username" /><br />
<label for="password">Password</label>
<input type="password" name="password" /><br />
<div id="invalidCredentials">
The entered credentials are invalid
</div>
<input type="submit" value="Login" />
</form>
</div>
</body>
</html>
{{end}}