forked from GoAdminGroup/go-admin
/
template.go
92 lines (83 loc) · 3.17 KB
/
template.go
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
package login
const loginTmpl = `{{define "login_theme1"}}
<!DOCTYPE html>
<!--[if lt IE 7]>
<html class="no-js lt-ie9 lt-ie8 lt-ie7">
<![endif]-->
<!--[if IE 7]>
<html class="no-js lt-ie9 lt-ie8">
<![endif]-->
<!--[if IE 8]>
<html class="no-js lt-ie9">
<![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js">
<!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>{{.Title}}</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="{{link .CdnUrl .UrlPrefix "/assets/login/dist/all.min.css"}}">
<!--[if lt IE 9]>
<script src="{{link .CdnUrl .UrlPrefix "/assets/login/dist/respond.min.js"}}"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="row" style="margin-top: 80px;">
<div class="col-md-4 col-md-offset-4">
<form action="##" onsubmit="return false" method="post" id="sign-up-form" class="fh5co-form animate-box"
data-animate-effect="fadeIn">
<h2>{{.Title}}</h2>
<div class="form-group">
<label for="username" class="sr-only">Username</label>
<input type="text" class="form-control" id="username" placeholder="{{lang "username"}}"
autocomplete="off">
</div>
<div class="form-group">
<label for="password" class="sr-only">Password</label>
<input type="password" class="form-control" id="password" placeholder="{{lang "password"}}"
autocomplete="off">
</div>
<div class="form-group">
<button class="btn btn-primary" onclick="submitData()">{{lang "login"}}</button>
</div>
</form>
</div>
</div>
<div class="row" style="padding-top: 60px; clear: both;">
<div class="col-md-12 text-center">
<p>
<small>© All Rights Reserved. GoAdmin</small>
</p>
</div>
</div>
</div>
<div id="particles-js">
<canvas class="particles-js-canvas-el" width="1606" height="1862" style="width: 100%; height: 100%;"></canvas>
</div>
<script src="{{link .CdnUrl .UrlPrefix "/assets/login/dist/all.min.js"}}"></script>
<script>
function submitData() {
$.ajax({
dataType: 'json',
type: 'POST',
url: '{{.UrlPrefix}}/signin',
async: 'true',
data: {
'username': $("#username").val(),
'password': $("#password").val()
},
success: function (data) {
location.href = data.data.url
},
error: function (data) {
alert('{{lang "login fail"}}');
}
});
}
</script>
</body>
</html>
{{end}}`