-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bc2655e
commit a13b80d
Showing
6 changed files
with
111 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
PROJECT = cowboy_stormpath | ||
DEPS = cowboy | ||
DEPS = cowboy erlydtl | ||
include erlang.mk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
body { | ||
padding-top: 40px; | ||
padding-bottom: 40px; | ||
background-color: #eee; | ||
} | ||
|
||
.form-signin { | ||
max-width: 330px; | ||
padding: 15px; | ||
margin: 0 auto; | ||
} | ||
.form-signin .form-signin-heading, | ||
.form-signin .checkbox { | ||
margin-bottom: 10px; | ||
} | ||
.form-signin .checkbox { | ||
font-weight: normal; | ||
} | ||
.form-signin .form-control { | ||
position: relative; | ||
height: auto; | ||
-webkit-box-sizing: border-box; | ||
-moz-box-sizing: border-box; | ||
box-sizing: border-box; | ||
padding: 10px; | ||
font-size: 16px; | ||
} | ||
.form-signin .form-control:focus { | ||
z-index: 2; | ||
} | ||
.form-signin input[type="email"] { | ||
margin-bottom: -1px; | ||
border-bottom-right-radius: 0; | ||
border-bottom-left-radius: 0; | ||
} | ||
.form-signin input[type="password"] { | ||
margin-bottom: 10px; | ||
border-top-left-radius: 0; | ||
border-top-right-radius: 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
-module(login_handler). | ||
-behaviour(cowboy_http_handler). | ||
|
||
-export([init/3]). | ||
-export([handle/2]). | ||
-export([terminate/3]). | ||
|
||
-record(state, {}). | ||
|
||
init(_, Req, _Opts) -> | ||
{ok, Req, #state{}}. | ||
|
||
handle(Req, State=#state{}) -> | ||
{ok, Body} = login_dtl:render(), | ||
{ok, Req2} = cowboy_req:reply(200, [{<<"content-type">>, <<"text/html">>}], Body, Req), | ||
{ok, Req2, State}. | ||
|
||
terminate(_Reason, _Req, _State) -> | ||
ok. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<meta name="description" content=""> | ||
<meta name="author" content=""> | ||
<link rel="icon" href="../../favicon.ico"> | ||
|
||
<title>Log in</title> | ||
|
||
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" rel="stylesheet"> | ||
|
||
<link href="css/login.css" rel="stylesheet"> | ||
|
||
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --> | ||
<!--[if lt IE 9]> | ||
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> | ||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> | ||
<![endif]--> | ||
</head> | ||
|
||
<body> | ||
|
||
<div class="container"> | ||
|
||
<form class="form-signin" action="/login"> | ||
<h2 class="form-signin-heading">Log in</h2> | ||
<label for="inputEmail" class="sr-only">Email address</label> | ||
<input type="email" id="inputEmail" class="form-control" placeholder="Email address" required autofocus> | ||
<label for="inputPassword" class="sr-only">Password</label> | ||
<input type="password" id="inputPassword" class="form-control" placeholder="Password" required> | ||
<div class="checkbox"> | ||
<label> | ||
<input type="checkbox" value="remember-me"> Remember me | ||
</label> | ||
</div> | ||
<button class="btn btn-lg btn-primary btn-block" type="submit">Log in</button> | ||
<button class="btn btn-default" type="submit">Sign up</button> | ||
<button class="btn btn-default" type="submit">Reset password</button> | ||
</form> | ||
|
||
</div> <!-- /container --> | ||
|
||
</body> | ||
|
||
</html> |