login.ejs
2.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<% include ../includes/header.ejs %>
<div class="row">
<div class="col-md-4 col-md-offset-4">
<%if(typeof flashMessage !=='undefined') {%>
<div class="alert alert-danger" role="alert"><%=flashMessage%></div>
<%}%>
<div class="login-panel panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">로그인</h3>
</div>
<div class="panel-body">
<form role="form" action="" id="login_form" method="post">
<fieldset>
<div class="form-group">
<input class="form-control" placeholder="ID" name="username" type="text" autofocus="" required="">
</div>
<div class="form-group">
<input class="form-control" placeholder="Password" name="password" type="password" value="" required="">
</div>
<!-- Change this to a button or input when using this as a form -->
<input type="submit" class="btn btn-lg btn-success btn-block" value="로그인">
<div style="margin-top: 10px">
<a href="/auth/facebook" class="btn btn-lg btn-primary btn-block">
<i class="fa fa-facebook" aria-hidden="true"></i> 페이스북 로그인
</a>
</div>
</fieldset>
</form>
</div>
</div>
</div>
</div>
<script type="text/javascript">
(function(){
$(document).ready(function() {
$('#login_form').submit(function(){
var $usernameInput = $('#login_form input[name=username]');
var $passwordInput = $('#login_form input[name=password]');
if(!$usernameInput.val()){
alert("아이디를 입력해주세요.");
$usernameInput.focus();
return false;
}
if(!$passwordInput.val()){
alert("패스워드를 입력해주세요.");
$passwordInput.focus();
return false;
}
return true;
});
});
})();
</script>
<% include ../includes/footer.ejs %>