12 changed files with 144 additions and 41 deletions
-
5bee.json
-
7gogs.go
-
17models/access.go
-
4models/user.go
-
38routers/user/user.go
-
15templates/base/base.tmpl
-
2templates/base/footer.tmpl
-
32templates/base/head.tmpl
-
4templates/base/navbar.tmpl
-
11templates/dashboard.tmpl
-
6templates/status/403.tmpl
-
44templates/user/signup.tmpl
@ -0,0 +1,38 @@ |
|||
// Copyright 2014 The Gogs Authors. All rights reserved.
|
|||
// Use of this source code is governed by a MIT-style
|
|||
// license that can be found in the LICENSE file.
|
|||
|
|||
package user |
|||
|
|||
import ( |
|||
"fmt" |
|||
"net/http" |
|||
|
|||
"github.com/martini-contrib/render" |
|||
|
|||
//"github.com/gogits/gogs/utils/log"
|
|||
"github.com/gogits/gogs/models" |
|||
) |
|||
|
|||
func SignIn(r render.Render) { |
|||
r.Redirect("/user/signup", 302) |
|||
} |
|||
|
|||
func SignUp(req *http.Request, r render.Render) { |
|||
if req.Method == "GET" { |
|||
r.HTML(200, "user/signup", map[string]interface{}{ |
|||
"Title": "Sign Up", |
|||
}) |
|||
return |
|||
} |
|||
|
|||
// TODO: validate form.
|
|||
err := models.RegisterUser(&models.User{ |
|||
Name: req.FormValue("username"), |
|||
Email: req.FormValue("email"), |
|||
Passwd: req.FormValue("passwd"), |
|||
}) |
|||
r.HTML(403, "status/403", map[string]interface{}{ |
|||
"Title": fmt.Sprintf("%v", err), |
|||
}) |
|||
} |
@ -1,15 +0,0 @@ |
|||
<!DOCTYPE html> |
|||
<html> |
|||
<head> |
|||
{{template "base/head" .}} |
|||
{{template "head" .}} |
|||
</head> |
|||
<body> |
|||
<noscript>Please enable JavaScript in your browser!</noscript> |
|||
{{template "base/navbar" .}} |
|||
<div class="container"> |
|||
{{template "body" .}} |
|||
</div> |
|||
{{template "base/footer" .}} |
|||
</body> |
|||
</html> |
@ -0,0 +1,2 @@ |
|||
</body> |
|||
</html> |
@ -1,14 +1,22 @@ |
|||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
|||
<link rel="shortcut icon" href="img/favicon.png" /> |
|||
<meta name="author" content="Gogs - Go Git Service" /> |
|||
<meta name="description" content="Gogs(Go Git Service) is a GitHub-like clone in the Go Programming Language" /> |
|||
<meta name="keywords" content="go, git"> |
|||
<!DOCTYPE html> |
|||
<html> |
|||
<head> |
|||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
|||
<link rel="shortcut icon" href="/img/favicon.png" /> |
|||
<meta name="author" content="Gogs - Go Git Service" /> |
|||
<meta name="description" content="Gogs(Go Git Service) is a GitHub-like clone in the Go Programming Language" /> |
|||
<meta name="keywords" content="go, git"> |
|||
|
|||
<!-- Stylesheets --> |
|||
<link href="css/bootstrap.min.css" rel="stylesheet" /> |
|||
<link href="css/todc-bootstrap.min.css" rel="stylesheet" /> |
|||
<link href="css/font-awesome.min.css" rel="stylesheet" /> |
|||
<link href="css/gogs.css" rel="stylesheet" /> |
|||
<!-- Stylesheets --> |
|||
<link href="/css/bootstrap.min.css" rel="stylesheet" /> |
|||
<link href="/css/todc-bootstrap.min.css" rel="stylesheet" /> |
|||
<link href="/css/font-awesome.min.css" rel="stylesheet" /> |
|||
<link href="/css/gogs.css" rel="stylesheet" /> |
|||
|
|||
<script src="js/jquery-1.10.1.min.js"></script> |
|||
<script src="js/bootstrap.min.js"></script> |
|||
<script src="/js/jquery-1.10.1.min.js"></script> |
|||
<script src="/js/bootstrap.min.js"></script> |
|||
|
|||
<title>{{.Title}} | Gogs - Go Git Service</title> |
|||
</head> |
|||
<body> |
|||
<noscript>Please enable JavaScript in your browser!</noscript> |
@ -1,5 +1,6 @@ |
|||
{{template "base/base" .}} |
|||
{{define "head"}} <title>{{.Title}} | Gogs - Go Git Service</title>{{end}} |
|||
{{define "body"}} |
|||
Website is still in the progress of building...please come back later! |
|||
{{end}} |
|||
{{template "base/head" .}} |
|||
{{template "base/navbar" .}} |
|||
<div class="container"> |
|||
Website is still in the progress of building...please come back later! |
|||
</div> |
|||
{{template "base/footer" .}} |
@ -0,0 +1,6 @@ |
|||
{{template "base/head" .}} |
|||
{{template "base/navbar" .}} |
|||
<div class="container"> |
|||
403 Forbidden |
|||
</div> |
|||
{{template "base/footer" .}} |
@ -0,0 +1,44 @@ |
|||
{{template "base/head" .}} |
|||
{{template "base/navbar" .}} |
|||
<div class="container"> |
|||
<form action="/user/signup" method="post" class="form-horizontal"> |
|||
<div class="form-group"> |
|||
<label class="col-md-4 control-label">Username: </label> |
|||
<div class="col-md-3"> |
|||
<input name="username" class="form-control" placeholder="Type your username"> |
|||
</div> |
|||
</div> |
|||
|
|||
<div class="form-group"> |
|||
<label class="col-md-4 control-label">Email: </label> |
|||
<div class="col-md-3"> |
|||
<input name="email" class="form-control" placeholder="Type your e-mail address"> |
|||
</div> |
|||
</div> |
|||
|
|||
<div class="form-group"> |
|||
<label class="col-md-4 control-label">Password: </label> |
|||
<div class="col-md-3"> |
|||
<input name="passwd" type="password" class="form-control" placeholder="Type your password"> |
|||
</div> |
|||
</div> |
|||
|
|||
<div class="form-group"> |
|||
<label class="col-md-4 control-label">Re-type: </label> |
|||
<div class="col-md-3"> |
|||
<input type="password" class="form-control" placeholder="Re-type your password"> |
|||
</div> |
|||
</div> |
|||
|
|||
<div class="form-group"> |
|||
<div class="col-md-offset-4 col-md-3"> |
|||
<button type="submit" class="btn btn-info">Sign Up</button> |
|||
</div> |
|||
</div> |
|||
|
|||
<div class="col-md-offset-4 col-md-3"> |
|||
<a href="/user/signin">Already have an account? Sign in now!</a> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
{{template "base/footer" .}} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue