summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2014-03-25 18:31:27 +0800
committerLunny Xiao <xiaolunwen@gmail.com>2014-03-25 18:31:27 +0800
commit4e88ae19d1e2e91e4d3168304c06fcbce73c31bf (patch)
treea4c2f6b7215ae8c0926e9bfdb29e64c3daaf4739
parentbb71a1bc1da52ce3985dfcb80852df5a9ca053d5 (diff)
parent6e33e54e71cdb6a100b9048bd6d9567fea2e7c91 (diff)
downloadgitea-4e88ae19d1e2e91e4d3168304c06fcbce73c31bf.tar.gz
gitea-4e88ae19d1e2e91e4d3168304c06fcbce73c31bf.zip
Merge branch 'master' of github.com:gogits/gogs
-rw-r--r--modules/base/conf.go2
-rwxr-xr-xpublic/css/gogs.css11
-rw-r--r--routers/install.go13
-rw-r--r--routers/repo/issue.go1
-rw-r--r--templates/install.tmpl70
-rw-r--r--templates/issue/create.tmpl10
-rw-r--r--templates/repo/issues.tmpl1
-rw-r--r--web.go1
8 files changed, 107 insertions, 2 deletions
diff --git a/modules/base/conf.go b/modules/base/conf.go
index d3122a5339..90b3547642 100644
--- a/modules/base/conf.go
+++ b/modules/base/conf.go
@@ -243,7 +243,7 @@ func newNotifyMailService() {
}
func NewConfigContext() {
- var err error
+ //var err error
workDir, err := exeDir()
if err != nil {
fmt.Printf("Fail to get work directory: %s\n", err)
diff --git a/public/css/gogs.css b/public/css/gogs.css
index 8b031d6ed3..2254ef5a24 100755
--- a/public/css/gogs.css
+++ b/public/css/gogs.css
@@ -224,6 +224,15 @@ html, body {
line-height: 30px;
}
+#gogs-install-card{
+ width: 800px;
+}
+
+#gogs-install-card .form-group {
+ margin-left: 0;
+ margin-right: 0;
+}
+
.gogs-card .btn {
cursor: pointer;
margin-right: 1.2em;
@@ -676,7 +685,7 @@ html, body {
margin: 0 .5em 0 0;
}
-.file-content .file-head .file-size{
+.file-content .file-head .file-size {
font-size: 13px;
color: #888;
margin-left: 1em;
diff --git a/routers/install.go b/routers/install.go
new file mode 100644
index 0000000000..d7d5159efc
--- /dev/null
+++ b/routers/install.go
@@ -0,0 +1,13 @@
+// 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 routers
+
+import "github.com/gogits/gogs/modules/middleware"
+
+func Install(ctx *middleware.Context){
+ ctx.Data["PageIsInstall"] = true
+ ctx.Data["Title"] = "Install"
+ ctx.HTML(200,"install")
+}
diff --git a/routers/repo/issue.go b/routers/repo/issue.go
index e03f115e24..d54582a2a0 100644
--- a/routers/repo/issue.go
+++ b/routers/repo/issue.go
@@ -45,6 +45,7 @@ func CreateIssue(ctx *middleware.Context, params martini.Params, form auth.Creat
}
ctx.Data["Title"] = "Create issue"
+ ctx.Data["IsRepoToolbarIssues"] = true
if ctx.Req.Method == "GET" {
ctx.HTML(200, "issue/create")
diff --git a/templates/install.tmpl b/templates/install.tmpl
new file mode 100644
index 0000000000..a13f219088
--- /dev/null
+++ b/templates/install.tmpl
@@ -0,0 +1,70 @@
+{{template "base/head" .}}
+<div id="gogs-body" class="container">
+ <form action="/install" method="post" class="form-horizontal gogs-card" id="gogs-install-card">
+ {{.CsrfTokenHtml}}
+ <h3>Install Steps</h3>
+ <div class="alert alert-danger form-error{{if .HasError}}{{else}} hidden{{end}}">{{.ErrorMsg}}</div>
+ <p class="help-block text-center">GoGits need MySQL or PostgreSQL server</p>
+ <div class="form-group {{if .Err_User}}has-error has-feedback{{end}}">
+ <label class="col-md-3 control-label"><strong>MySQL </strong>Host: </label>
+ <div class="col-md-8">
+ <input name="host" class="form-control" placeholder="Type mysql server ip or domain" value="localhost" required="required">
+ </div>
+ </div>
+ <div class="form-group {{if .Err_User}}has-error has-feedback{{end}}">
+ <label class="col-md-3 control-label">Port: </label>
+ <div class="col-md-8">
+ <input name="port" class="form-control" placeholder="Type mysql server port" value="3306" required="required">
+ </div>
+ </div>
+ <div class="form-group {{if .Err_User}}has-error has-feedback{{end}}">
+ <label class="col-md-3 control-label">User: </label>
+ <div class="col-md-8">
+ <input name="user" class="form-control" placeholder="Type mysql username" required="required">
+ </div>
+ </div>
+ <div class="form-group {{if .Err_Password}}has-error has-feedback{{end}}">
+ <label class="col-md-3 control-label">Password: </label>
+ <div class="col-md-8">
+ <input name="passwd" type="password" class="form-control" placeholder="Type mysql password" required="required">
+ </div>
+ </div>
+ <div class="form-group {{if .Err_Password}}has-error has-feedback{{end}}">
+ <label class="col-md-3 control-label">Database: </label>
+ <div class="col-md-8">
+ <input name="database" type="text" class="form-control" placeholder="Type mysql database name" value="gogs" required="required">
+ <p class="help-block">Recommend use INNODB engine with utf8_general_ci charset.</p>
+ </div>
+ </div>
+
+ <div class="form-group">
+ <div class="col-md-8 col-md-offset-3">
+ <button class="btn btn-sm btn-info">Test Connection</button>
+ </div>
+ </div>
+
+ <hr/>
+
+ <p class="help-block text-center">General settings for GoGits</p>
+
+ <div class="form-group {{if .Err_Password}}has-error has-feedback{{end}}">
+ <label class="col-md-3 control-label">Repository Path: </label>
+ <div class="col-md-8">
+ <input name="repo-path" type="text" class="form-control" placeholder="Type your repository directory" value="/var/gogs/repostiory" required="required">
+ <p class="help-block">The git copy of each repository is saved in this directory.</p>
+ </div>
+ </div>
+ <div class="form-group {{if .Err_Password}}has-error has-feedback{{end}}">
+ <label class="col-md-3 control-label">System User: </label>
+ <div class="col-md-8">
+ <input name="system-user" type="text" class="form-control" placeholder="Type mysql password" value="root" required="required">
+ <p class="help-block">The user has access to visit and run GoGits.</p>
+ </div>
+ </div>
+ <hr/>
+ <div class="form-group text-center">
+ <a class="btn btn-danger btn-lg">Install GoGits</a>
+ </div>
+ </form>
+</div>
+{{template "base/footer" .}} \ No newline at end of file
diff --git a/templates/issue/create.tmpl b/templates/issue/create.tmpl
new file mode 100644
index 0000000000..e71843e6f0
--- /dev/null
+++ b/templates/issue/create.tmpl
@@ -0,0 +1,10 @@
+{{template "base/head" .}}
+{{template "base/navbar" .}}
+{{template "repo/nav" .}}
+{{template "repo/toolbar" .}}
+<div id="gogs-body" class="container">
+ <div id="gogs-source">
+ new-issues
+ </div>
+</div>
+{{template "base/footer" .}} \ No newline at end of file
diff --git a/templates/repo/issues.tmpl b/templates/repo/issues.tmpl
index daacc089c3..bf23ff83ff 100644
--- a/templates/repo/issues.tmpl
+++ b/templates/repo/issues.tmpl
@@ -4,6 +4,7 @@
{{template "repo/toolbar" .}}
<div id="gogs-body" class="container">
<div id="gogs-source">
+ issues
</div>
</div>
{{template "base/footer" .}} \ No newline at end of file
diff --git a/web.go b/web.go
index 0747f224b7..6538c61f19 100644
--- a/web.go
+++ b/web.go
@@ -90,6 +90,7 @@ func runWeb(*cli.Context) {
// Routers.
m.Get("/", ignSignIn, routers.Home)
+ m.Get("/install",routers.Install)
m.Get("/issues", reqSignIn, user.Issues)
m.Get("/pulls", reqSignIn, user.Pulls)
m.Get("/stars", reqSignIn, user.Stars)