budgeteer/templates/login.html
2016-12-03 20:30:40 +01:00

48 lines
1.1 KiB
HTML

<html>
<head>
<title>Login</title>
<link href="/static/css/bootstrap.min.css" rel="stylesheet" />
<link href="/static/css/bootstrap-theme.min.css" rel="stylesheet" />
<style>
#invalidCredentials {
color: red;
}
</style>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.js"></script>
<script src="http://malsup.github.com/jquery.form.js"></script>
<script>
$(document).ready(function() {
$('#invalidCredentials').hide();
$('#loginForm').ajaxForm({
success: function() {
window.location.href = "/api/v1/restricted";
},
error: function() {
$('#invalidCredentials').show();
}
});
});
</script>
</head>
<head><title>Login</title>
<body>
<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>
</body>
</html>