From 139a6f80dc258bba1e61aa9584787b86ac4addf3 Mon Sep 17 00:00:00 2001 From: skyblue Date: Sun, 23 Mar 2014 23:22:35 +0800 Subject: [PATCH 01/14] update my config --- conf/app.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/app.ini b/conf/app.ini index ab9f6dc4bb..b9472b551a 100644 --- a/conf/app.ini +++ b/conf/app.ini @@ -2,7 +2,7 @@ APP_NAME = Gogs: Go Git Service APP_LOGO = img/favicon.png ; !!MUST CHANGE TO YOUR USER NAME!! -RUN_USER = lunny +RUN_USER = skyblue ; Either "dev", "prod" or "test", default is "dev" RUN_MODE = dev @@ -164,4 +164,4 @@ RECEIVERS = [log.database] LEVEL = Driver = -CONN = \ No newline at end of file +CONN = From 1d30f545d65fe2d7fe6e0a88fbb693ca68e9417e Mon Sep 17 00:00:00 2001 From: lunny Date: Mon, 24 Mar 2014 14:28:20 +0000 Subject: [PATCH 02/14] Init commit --- .gitignore | 22 ++++++++++++++++++++++ LICENSE | 27 +++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 .gitignore create mode 100644 LICENSE diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000..6cd1df2b7a --- /dev/null +++ b/.gitignore @@ -0,0 +1,22 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000000..3af16b0724 --- /dev/null +++ b/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2014 +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of the {organization} nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file From 7f6126dd04142c23fe5565a4c1f8cd8c93158460 Mon Sep 17 00:00:00 2001 From: FuXiaoHei Date: Tue, 25 Mar 2014 16:51:42 +0800 Subject: [PATCH 03/14] install sample page --- modules/base/conf.go | 2 +- public/css/gogs.css | 11 ++++++- routers/install.go | 13 ++++++++ templates/install.tmpl | 70 ++++++++++++++++++++++++++++++++++++++++++ web.go | 1 + 5 files changed, 95 insertions(+), 2 deletions(-) create mode 100644 routers/install.go create mode 100644 templates/install.tmpl 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/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" .}} +
+
+ {{.CsrfTokenHtml}} +

Install Steps

+
{{.ErrorMsg}}
+

GoGits need MySQL or PostgreSQL server

+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +

Recommend use INNODB engine with utf8_general_ci charset.

+
+
+ +
+
+ +
+
+ +
+ +

General settings for GoGits

+ +
+ +
+ +

The git copy of each repository is saved in this directory.

+
+
+
+ +
+ +

The user has access to visit and run GoGits.

+
+
+
+ +
+
+{{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) From d24a4a142e5de9b2d9701ae93892234122e8b89b Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Tue, 25 Mar 2014 17:11:13 +0800 Subject: [PATCH 04/14] bug fixed --- serve.go | 57 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/serve.go b/serve.go index c3eb233c76..f9e915ed84 100644 --- a/serve.go +++ b/serve.go @@ -109,20 +109,25 @@ func runServ(k *cli.Context) { repoName = repoName[:len(repoName)-4] } + isWrite := In(verb, COMMANDS_WRITE) + isRead := In(verb, COMMANDS_READONLY) + repo, err := models.GetRepositoryByName(user.Id, repoName) var isExist bool = true if err != nil { if err == models.ErrRepoNotExist { isExist = false + if isRead { + println("Repository", user.Name+"/"+repoName, "is not exist") + return + } } else { - println("Unavilable repository", err) + println("Get repository error:", err) return } } - isWrite := In(verb, COMMANDS_WRITE) - isRead := In(verb, COMMANDS_READONLY) - + // access check switch { case isWrite: has, err := models.HasAccess(user.Name, repoName, models.AU_WRITABLE) @@ -156,12 +161,11 @@ func runServ(k *cli.Context) { return } + var rep *git.Repository + repoPath := models.RepoPath(user.Name, repoName) if !isExist { - if isRead { - println("Repository", user.Name+"/"+repoName, "is not exist") - return - } else if isWrite { - _, err := models.CreateRepository(user, repoName, "", "", "", false, true) + if isWrite { + _, err = models.CreateRepository(user, repoName, "", "", "", false, true) if err != nil { println("Create repository failed") return @@ -169,11 +173,11 @@ func runServ(k *cli.Context) { } } - rep, err := git.OpenRepository(models.RepoPath(user.Name, repoName)) - if err != nil { - println(err.Error()) - return - } + rep, err = git.OpenRepository(repoPath) + if err != nil { + println(err.Error()) + return + } refs, err := rep.AllReferencesMap() if err != nil { @@ -194,17 +198,14 @@ func runServ(k *cli.Context) { if err = gitcmd.Run(); err != nil { println("execute command error:", err.Error()) - } - - if !strings.HasPrefix(cmd, "git-receive-pack") { return } - // update - //w, _ := os.Create("serve.log") - //defer w.Close() - //log.SetOutput(w) + if isRead { + return + } + // find push reference name var t = "ok refs/heads/" var i int var refname string @@ -220,12 +221,17 @@ func runServ(k *cli.Context) { refname = l[idx+len(t):] } } + if refname == "" { + println("No find any reference name:", b.String()) + return + } + var ref *git.Reference var ok bool - var l *list.List //log.Info("----", refname, "-----") if ref, ok = refs[refname]; !ok { + // for new branch refs, err = rep.AllReferencesMap() if err != nil { println(err.Error()) @@ -280,13 +286,8 @@ func runServ(k *cli.Context) { repo.Id, repoName, refname, &base.PushCommits{l.Len(), commits}); err != nil { log.Error("runUpdate.models.CommitRepoAction: %v", err, commits) } else { - //log.Info("refname", refname) - //log.Info("Listen: %v", cmd) - //fmt.Println("...", cmd) - - //runUpdate(k) c := exec.Command("git", "update-server-info") - c.Dir = models.RepoPath(user.Name, repoName) + c.Dir = repoPath err := c.Run() if err != nil { log.Error("update-server-info: %v", err) From c61fa28f49f9bed8e198f0ef8b2b18afec921ae5 Mon Sep 17 00:00:00 2001 From: xiaoxiao Date: Tue, 25 Mar 2014 17:17:34 +0800 Subject: [PATCH 05/14] Init commit --- .gitignore | 22 ++++++++++++++++++++++ LICENSE | 27 +++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 .gitignore create mode 100644 LICENSE diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000..6cd1df2b7a --- /dev/null +++ b/.gitignore @@ -0,0 +1,22 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000000..3af16b0724 --- /dev/null +++ b/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2014 +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of the {organization} nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file From 649bc91057398e6c7cd31b41f15fafeffba167ef Mon Sep 17 00:00:00 2001 From: xiaoxiao Date: Tue, 25 Mar 2014 17:25:55 +0800 Subject: [PATCH 06/14] Init commit --- .gitignore | 22 ++++++++++++++++++++++ LICENSE | 27 +++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 .gitignore create mode 100644 LICENSE diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000..6cd1df2b7a --- /dev/null +++ b/.gitignore @@ -0,0 +1,22 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000000..3af16b0724 --- /dev/null +++ b/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2014 +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of the {organization} nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file From a80603727db5a6871a833310bb47431e97628109 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Tue, 25 Mar 2014 17:52:03 +0800 Subject: [PATCH 07/14] add log --- serve.go | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/serve.go b/serve.go index 480b122f3b..8d9fd69cda 100644 --- a/serve.go +++ b/serve.go @@ -48,6 +48,7 @@ gogs serv provide access auth for repositories`, func init() { os.MkdirAll("log", os.ModePerm) log.NewLogger(10000, "file", fmt.Sprintf(`{"filename":"%s"}`, "log/serv.log")) + log.Info("start logging...") } func parseCmd(cmd string) (string, string) { @@ -124,6 +125,7 @@ func runServ(k *cli.Context) { } } else { println("Get repository error:", err) + log.Error(err.Error()) return } } @@ -134,6 +136,7 @@ func runServ(k *cli.Context) { has, err := models.HasAccess(user.Name, repoName, models.AU_WRITABLE) if err != nil { println("Inernel error:", err) + log.Error(err.Error()) return } if !has { @@ -144,12 +147,14 @@ func runServ(k *cli.Context) { has, err := models.HasAccess(user.Name, repoName, models.AU_READABLE) if err != nil { println("Inernel error") + log.Error(err.Error()) return } if !has { has, err = models.HasAccess(user.Name, repoName, models.AU_WRITABLE) if err != nil { println("Inernel error") + log.Error(err.Error()) return } } @@ -169,6 +174,7 @@ func runServ(k *cli.Context) { _, err = models.CreateRepository(user, repoName, "", "", "", false, true) if err != nil { println("Create repository failed") + log.Error(err.Error()) return } } @@ -177,12 +183,14 @@ func runServ(k *cli.Context) { rep, err = git.OpenRepository(repoPath) if err != nil { println(err.Error()) + log.Error(err.Error()) return } refs, err := rep.AllReferencesMap() if err != nil { println(err.Error()) + log.Error(err.Error()) return } @@ -199,6 +207,7 @@ func runServ(k *cli.Context) { if err = gitcmd.Run(); err != nil { println("execute command error:", err.Error()) + log.Error(err.Error()) return } @@ -238,15 +247,17 @@ func runServ(k *cli.Context) { refs, err = rep.AllReferencesMap() if err != nil { println(err.Error()) + log.Error(err.Error()) return } if ref, ok = refs[refname]; !ok { - log.Trace("unknow reference name -", refname, "-", b.String()) + log.Error("unknow reference name -", refname, "-", b.String()) return } l, err = ref.AllCommits() if err != nil { println(err.Error()) + log.Error(err.Error()) return } } else { @@ -256,12 +267,14 @@ func runServ(k *cli.Context) { last, err = ref.LastCommit() if err != nil { println(err.Error()) + log.Error(err.Error()) return } ref2, err := rep.LookupReference(ref.Name) if err != nil { println(err.Error()) + log.Error(err.Error()) return } @@ -269,6 +282,7 @@ func runServ(k *cli.Context) { before, err := ref2.LastCommit() if err != nil { println(err.Error()) + log.Error(err.Error()) return } //log.Info("----", before.Id(), "-----", last.Id()) From d8b859ec86560844fd230542e7958cd3912c0b1e Mon Sep 17 00:00:00 2001 From: xiaoxiao Date: Tue, 25 Mar 2014 17:53:03 +0800 Subject: [PATCH 08/14] Init commit --- .gitignore | 22 ++++++++++++++++++++++ LICENSE | 27 +++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 .gitignore create mode 100644 LICENSE diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000..6cd1df2b7a --- /dev/null +++ b/.gitignore @@ -0,0 +1,22 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000000..3af16b0724 --- /dev/null +++ b/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2014 +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of the {organization} nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file From 2856bee02201677f362dc587441970eeba219da2 Mon Sep 17 00:00:00 2001 From: xiaoxiao Date: Tue, 25 Mar 2014 18:12:51 +0800 Subject: [PATCH 09/14] Init commit --- .gitignore | 22 ++++++++++++++++++++++ LICENSE | 27 +++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 .gitignore create mode 100644 LICENSE diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000..6cd1df2b7a --- /dev/null +++ b/.gitignore @@ -0,0 +1,22 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000000..3af16b0724 --- /dev/null +++ b/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2014 +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of the {organization} nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file From 19b7f74b75caf8cef50c687d422d761ca74b3b90 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Tue, 25 Mar 2014 18:26:30 +0800 Subject: [PATCH 10/14] add log --- serve.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/serve.go b/serve.go index 6add5a9bd8..acdcb877ff 100644 --- a/serve.go +++ b/serve.go @@ -183,14 +183,14 @@ func runServ(k *cli.Context) { rep, err = git.OpenRepository(repoPath) if err != nil { - println(err.Error()) + println("OpenRepository failed:", err.Error()) log.Error(err.Error()) return } refs, err := rep.AllReferencesMap() if err != nil { - println(err.Error()) + println("Get All References failed:", err.Error()) log.Error(err.Error()) return } @@ -247,7 +247,7 @@ func runServ(k *cli.Context) { // for new branch refs, err = rep.AllReferencesMap() if err != nil { - println(err.Error()) + println("Get All References failed:", err.Error()) log.Error(err.Error()) return } @@ -257,7 +257,7 @@ func runServ(k *cli.Context) { } l, err = ref.AllCommits() if err != nil { - println(err.Error()) + println("Get All Commits failed:", err.Error()) log.Error(err.Error()) return } @@ -267,14 +267,14 @@ func runServ(k *cli.Context) { //log.Info("00000", ref.Oid.String()) last, err = ref.LastCommit() if err != nil { - println(err.Error()) + println("Get last commit failed:", err.Error()) log.Error(err.Error()) return } ref2, err := rep.LookupReference(ref.Name) if err != nil { - println(err.Error()) + println("look up reference failed:", err.Error()) log.Error(err.Error()) return } @@ -282,7 +282,7 @@ func runServ(k *cli.Context) { //log.Info("11111", ref2.Oid.String()) before, err := ref2.LastCommit() if err != nil { - println(err.Error()) + println("Get last commit failed:", err.Error()) log.Error(err.Error()) return } From 01b3b7004dfd7d70770ccd09a335db36c681a207 Mon Sep 17 00:00:00 2001 From: xiaoxiao Date: Tue, 25 Mar 2014 18:26:58 +0800 Subject: [PATCH 11/14] Init commit --- .gitignore | 22 ++++++++++++++++++++++ LICENSE | 27 +++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 .gitignore create mode 100644 LICENSE diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000..6cd1df2b7a --- /dev/null +++ b/.gitignore @@ -0,0 +1,22 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000000..3af16b0724 --- /dev/null +++ b/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2014 +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of the {organization} nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file From 6e33e54e71cdb6a100b9048bd6d9567fea2e7c91 Mon Sep 17 00:00:00 2001 From: FuXiaoHei Date: Tue, 25 Mar 2014 18:27:29 +0800 Subject: [PATCH 12/14] add issue-create template file --- routers/repo/issue.go | 1 + templates/issue/create.tmpl | 10 ++++++++++ templates/repo/issues.tmpl | 1 + 3 files changed, 12 insertions(+) create mode 100644 templates/issue/create.tmpl 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/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" .}} +
+
+ new-issues +
+
+{{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" .}}
+ issues
{{template "base/footer" .}} \ No newline at end of file From 7048ea45279cd96f88845d83fe7cef6fbb545fcf Mon Sep 17 00:00:00 2001 From: skyblue Date: Tue, 25 Mar 2014 18:34:57 +0800 Subject: [PATCH 13/14] update avatar, remove gzip request header --- modules/avatar/avatar.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/avatar/avatar.go b/modules/avatar/avatar.go index 0ba20294af..3b423a6d15 100644 --- a/modules/avatar/avatar.go +++ b/modules/avatar/avatar.go @@ -251,8 +251,8 @@ var client = &http.Client{} func (this *thunderTask) fetch() error { req, _ := http.NewRequest("GET", this.Url, nil) - req.Header.Set("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8") - req.Header.Set("Accept-Encoding", "gzip,deflate,sdch") + req.Header.Set("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/jpeg,image/png,*/*;q=0.8") + req.Header.Set("Accept-Encoding", "deflate,sdch") req.Header.Set("Accept-Language", "zh-CN,zh;q=0.8") req.Header.Set("Cache-Control", "no-cache") req.Header.Set("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.154 Safari/537.36") From 2a2f025388b2f47cff4162adc207af2ba68d64d9 Mon Sep 17 00:00:00 2001 From: FuXiaoHei Date: Tue, 25 Mar 2014 18:44:37 +0800 Subject: [PATCH 14/14] change css name style --- public/css/gogs.css | 202 ++++++++++++++++--------------- public/js/app.js | 10 +- templates/admin/config.tmpl | 4 +- templates/admin/dashboard.tmpl | 4 +- templates/admin/nav.tmpl | 2 +- templates/admin/repos.tmpl | 4 +- templates/admin/users.tmpl | 4 +- templates/admin/users/edit.tmpl | 4 +- templates/admin/users/new.tmpl | 4 +- templates/base/navbar.tmpl | 26 ++-- templates/help.tmpl | 4 +- templates/home.tmpl | 2 +- templates/install.tmpl | 4 +- templates/issue/create.tmpl | 4 +- templates/repo/branches.tmpl | 4 +- templates/repo/commits.tmpl | 4 +- templates/repo/create.tmpl | 4 +- templates/repo/diff.tmpl | 4 +- templates/repo/issues.tmpl | 4 +- templates/repo/list.tmpl | 2 +- templates/repo/nav.tmpl | 8 +- templates/repo/pulls.tmpl | 4 +- templates/repo/setting.tmpl | 6 +- templates/repo/single.tmpl | 4 +- templates/repo/toolbar.tmpl | 2 +- templates/status/200.tmpl | 2 +- templates/status/404.tmpl | 2 +- templates/status/500.tmpl | 2 +- templates/user/active.tmpl | 4 +- templates/user/dashboard.tmpl | 8 +- templates/user/delete.tmpl | 10 +- templates/user/issues.tmpl | 4 +- templates/user/notification.tmpl | 4 +- templates/user/password.tmpl | 8 +- templates/user/profile.tmpl | 12 +- templates/user/publickey.tmpl | 12 +- templates/user/pulls.tmpl | 4 +- templates/user/security.tmpl | 4 +- templates/user/setting.tmpl | 8 +- templates/user/setting_nav.tmpl | 2 +- templates/user/signin.tmpl | 6 +- templates/user/signup.tmpl | 4 +- templates/user/stars.tmpl | 4 +- 43 files changed, 214 insertions(+), 210 deletions(-) diff --git a/public/css/gogs.css b/public/css/gogs.css index 2254ef5a24..c8c5d87b8d 100755 --- a/public/css/gogs.css +++ b/public/css/gogs.css @@ -52,14 +52,14 @@ html, body { } /* gogits nav header */ -.gogs-masthead { +.masthead { background-color: #428bca; box-shadow: inset 0 -2px 5px rgba(0, 0, 0, .1); margin: 0; } /* gogits nav item link */ -.gogs-nav-item { +.nav-item { position: relative; display: inline-block; padding: 10px; @@ -69,39 +69,39 @@ html, body { height: 46px; } -#gogs-nav-logo { +#nav-logo { padding-left: 0; padding-right: 0; margin-right: 10px; } -.gogs-nav-item:hover, -.gogs-nav-item:focus { +.nav-item:hover, +.nav-item:focus { color: #fff; text-decoration: none; } -.gogs-nav-item.navbar-right { +.nav-item.navbar-right { margin-top: 3px; } -.gogs-nav-item.navbar-btn { +.nav-item.navbar-btn { cursor: pointer; margin-top: 8px; padding: 5px 15px; height: 30px; } -.gogs-nav-item.navbar-right .fa { +.nav-item.navbar-right .fa { margin: 0; } /* gogits nav item active status */ -.gogs-nav .active { +.nav .active { color: #fff; } -.gogs-nav .active:after { +.nav .active:after { position: absolute; bottom: -1px; left: 50%; @@ -115,29 +115,29 @@ html, body { border-left: 5px solid transparent; } -#gogs-nav-logo:after { +#nav-logo:after { bottom: -4px !important; } -#gogs-nav-avatar:after { +#nav-avatar:after { bottom: -4px !important; } -.gogs-nav .tooltip { +.nav .tooltip { border: none; } /* gogits logo */ -#gogs-nav-avatar { +#nav-avatar { margin-top: 0; } -#gogs-logo, #gogs-nav-avatar img { +#logo, #nav-avatar img { width: 28px; height: 28px; } -#gogs-nav-out { +#nav-out { margin-top: 10px; padding: 5px 0; margin-left: 10px; @@ -145,56 +145,56 @@ html, body { float: right; } -#gogs-nav-signin, #gogs-nav-signup { +#nav-signin, #nav-signup { float: right; margin-left: 1em; } -#gogs-nav-out .fa { +#nav-out .fa { vertical-align: -10%; margin: 0 .5em; } /* gogits body */ -#gogs-body { +#body { padding-bottom: 60px; margin-top: 30px; } -#gogs-body .btn-default { +#body .btn-default { background-color: #FFF; background-image: linear-gradient(to bottom, #FFF 0, #FAFAFA 100%); } -#gogs-body-nav { +#body-nav { background-color: #FFF; border-bottom: 1px solid #DDD; height: 66px } -#gogs-body-nav .nav { +#body-nav .nav { font-size: 14px; margin-top: 12px; } -#gogs-body-nav .nav-pills li a { +#body-nav .nav-pills li a { color: #444; } -#gogs-body-nav .nav-pills li.active a { +#body-nav .nav-pills li.active a { font-weight: bold; border-bottom: 2px solid #d26911; background-color: transparent; color: #444; } -#gogs-body-nav .nav-pills li:hover a { +#body-nav .nav-pills li:hover a { background-color: transparent; text-decoration: underline; } /* gogits login card */ -.gogs-card { +.card { margin: auto; padding: 30px; background: #fff; @@ -203,87 +203,87 @@ html, body { box-sizing: border-box; } -.gogs-card h3 { +.card h3 { margin-top: 0; margin-bottom: 30px; padding-bottom: 20px; border-bottom: 1px solid #ccc; } -#gogs-login-card { +#login-card { width: 600px; } -#gogs-login-card .form-control { +#login-card .form-control { padding: 6px 12px; box-sizing: content-box; } -#gogs-login-card .control-label { +#login-card .control-label { height: 44px; line-height: 30px; } -#gogs-install-card{ +#install-card { width: 800px; } -#gogs-install-card .form-group { +#install-card .form-group { margin-left: 0; margin-right: 0; } -.gogs-card .btn { +.card .btn { cursor: pointer; margin-right: 1.2em; } -#gogs-social-login { +#social-login { margin-top: 30px; padding-top: 20px; border-top: 1px solid #ccc; } -#gogs-social-login .btn { +#social-login .btn { float: none; margin: auto; } /* gogs-user-profile */ -#gogs-user-avatar { +#user-avatar { width: 200px; height: 200px; border-radius: 6px; } -#gogs-user-avatar-commit { +#user-avatar-commit { width: 16px; height: 16px; border-radius: 2px; } -#gogs-user-name { +#user-name { margin-top: 20px; font-size: 1.6em; font-weight: bold; margin-bottom: 20px; } -#gogs-user-profile .profile-info .list-group-item { +#user-profile .profile-info .list-group-item { background-color: transparent; padding-top: 18px; color: #666; } -#gogs-user-profile .profile-info .list-group-item a { +#user-profile .profile-info .list-group-item a { margin: 0; padding: 0; display: inline; color: #0093c4; } -#gogs-user-profile .profile-info .list-group { +#user-profile .profile-info .list-group { border-top: 1px solid #ccc; padding-bottom: 18px; border-bottom: 1px solid #ccc; @@ -291,50 +291,50 @@ html, body { padding-right: 18px; } -#gogs-user-activity .tab-pane { +#user-activity .tab-pane { padding: 20px; } -#gogs-user-act-tabs li.active a { +#user-act-tabs li.active a { border-bottom-color: #ddd; } /* gogits repo create */ -#gogs-repo-create { +#repo-create { width: 800px; } -#gogs-repo-create textarea[name=desc] { +#repo-create textarea[name=desc] { height: 8em; } /* gogits user setting */ -#gogs-user-setting-nav > h4, #gogs-user-setting-container > h4, #gogs-user-setting-container > div > h4, -#gogs-ssh-keys > h4, #gogs-user-delete > h4, #gogs-repo-setting-container .tab-pane > h4 { +#user-setting-nav > h4, #user-setting-container > h4, #user-setting-container > div > h4, +#ssh-keys > h4, #user-delete > h4, #repo-setting-container .tab-pane > h4 { padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid #CCC; } -#gogs-user-setting-nav .list-group .list-group-item a { +#user-setting-nav .list-group .list-group-item a { margin-left: 0; padding: .6em; font-size: 14px; color: #3B73AF; } -#gogs-user-setting-nav .list-group .list-group-item { +#user-setting-nav .list-group .list-group-item { background-color: transparent; } -#gogs-user-setting-nav .list-group .list-group-item-success a { +#user-setting-nav .list-group .list-group-item-success a { font-weight: bold; color: #444; } -.gogs-admin-nav { +.admin-nav { background-color: #FFF; padding-top: 10px; padding-left: 0; @@ -342,49 +342,49 @@ html, body { border: 1px solid #D8D8D8; } -.gogs-admin-nav li { +.admin-nav li { margin-bottom: 8px; border-left: 4px solid transparent; } -.gogs-admin-nav li:hover { +.admin-nav li:hover { border-left-color: #EEE; } -.gogs-admin-nav li.active:hover { +.admin-nav li.active:hover { border-left: 4px solid #DD4B39; } -#gogs-repo-setting-container .form-horizontal label { +#repo-setting-container .form-horizontal label { line-height: 30px; } /* gogits user ssh keys */ -#gogs-ssh-keys .list-group-item { +#ssh-keys .list-group-item { padding: 15px 0; border-bottom: 1px solid #DDD; } -#gogs-ssh-keys .list-group-item .delete { +#ssh-keys .list-group-item .delete { margin: -5px 50px 0; } -#gogs-ssh-keys .list-group-item:after { +#ssh-keys .list-group-item:after { clear: both; } -#gogs-ssh-keys .name { +#ssh-keys .name { font-size: 14px; font-weight: bold; } -#gogs-ssh-keys .print { +#ssh-keys .print { padding-left: 1em; color: #888; } -#gogs-ssh-add { +#ssh-add { display: inline-block; color: white; cursor: pointer; @@ -392,25 +392,25 @@ html, body { border-radius: 3px; } -#gogs-ssh-form textarea { +#ssh-form textarea { height: 16em; } -/* #gogs-feed */ +/* #feed */ -#gogs-feed-right .repo-panel .panel-heading .btn { +#feed-right .repo-panel .panel-heading .btn { margin-top: -4px; } -#gogs-feed-right .repo-panel .panel-body { +#feed-right .repo-panel .panel-body { padding: 0; } -#gogs-feed-right .repo-panel .list-group { +#feed-right .repo-panel .list-group { margin-bottom: 0; } -#gogs-feed-right .repo-panel .list-group-item a { +#feed-right .repo-panel .list-group-item a { display: block; margin-left: 0; background-color: transparent; @@ -418,11 +418,11 @@ html, body { font-weight: bold; } -#gogs-feed-right .repo-panel .list-group-item .fa { +#feed-right .repo-panel .list-group-item .fa { color: #666; } -#gogs-feed-right .repo-panel .list-group-item { +#feed-right .repo-panel .list-group-item { font-size: 14px; line-height: 32px; border-bottom: 1px solid #DDD; @@ -430,97 +430,101 @@ html, body { clear: both; } -#gogs-feed-right .repo-panel .list-group-item:last-child { +#feed-right .repo-panel .list-group-item:last-child { border-bottom: none; } -#gogs-feed-right .repo-panel .list-group-item:hover { +#feed-right .repo-panel .list-group-item:hover { background-color: #eafffd; background-color: rgba(65, 131, 196, 0.1); } -#gogs-feed-right .repo-panel span.stars { +#feed-right .repo-panel span.stars { color: #666; margin-right: 1em; } /* gogits repo single page */ -#gogs-body-nav.gogs-repo-nav { +#body-nav.repo-nav { padding-top: 16px; padding-bottom: 30px; height: auto; } -.gogs-repo-nav .name { +.repo-nav .name { margin-top: 15px; } -.gogs-repo-nav .desc { +.repo-nav .desc { color: #888; margin-bottom: 0; } -.gogs-repo-nav h3 .fa { +.repo-nav h3 .fa { color: #BBB; margin-left: 0; } -.gogs-repo-nav .actions { +.repo-nav .actions { padding-top: 20px; } -.gogs-repo-nav .btn-default { +.repo-nav .btn-default { font-family: Tahoma, Arial, sans-serif; } -#gogs-repo-watching .dropdown-menu { +#repo-watching .dropdown-menu { width: 280px; padding: 0; } -#gogs-repo-watching .dropdown-menu .dropdown-item:hover .dropdown-header, #gogs-repo-watching .dropdown-item .dropdown-header.text-primary { +#repo-watching .dropdown-menu .dropdown-item:hover .dropdown-header, #repo-watching .dropdown-item .dropdown-header.text-primary { color: rgb(65, 131, 196); cursor: pointer; } -#gogs-repo-watching .dropdown-menu .description { +#repo-watching .dropdown-menu .description { padding: 0 20px; color: #888; } -#gogs-repo-watching .dropdown-menu .dropdown-header { +#repo-watching .dropdown-menu .dropdown-header { color: #444; font-weight: bold; font-size: 14px; margin-bottom: 4px; } -#gogs-repo-toolbar { +#repo-toolbar { border-bottom: 1px solid #DDD; background-color: #FFF; height: 40px; font-size: 14px; } -#gogs-repo-toolbar .navbar-default { +#repo-toolbar .navbar-default { border: none; height: 39px; } -#gogs-repo-toolbar .nav > li > a { +#repo-toolbar .nav > li > a { height: 39px; } -#gogs-repo-toolbar .navbar-toolbar.navbar-default .navbar-nav > .active > a:after { +#repo-toolbar .nav .active { + color: #F6F6F6; +} + +#repo-toolbar .nav > .active > a:after { border-bottom-color: #999; } -#gogs-repo-toolbar .navbar.nav-toolbar { +#repo-toolbar .navbar.nav-toolbar { margin-bottom: 0; } -#gogs-repo-toolbar .navbar-collapse { +#repo-toolbar .navbar-collapse { padding: 0; } @@ -588,29 +592,29 @@ html, body { min-width: 200px; } -#gogs-repo-clone .dropdown-menu { +#repo-clone .dropdown-menu { width: 400px; padding: 20px; } -#gogs-repo-clone .input-group { +#repo-clone .input-group { margin-bottom: 15px; } -/* #gogs-source */ -#gogs-source { +/* #source */ +#source { margin-top: -20px; } -#gogs-source .source-toolbar:after { +#source .source-toolbar:after { clear: both; } -#gogs-source .source-toolbar .branch-switch { +#source .source-toolbar .branch-switch { display: inline-block; } -#gogs-source .source-toolbar .breadcrumb { +#source .source-toolbar .breadcrumb { margin: 0 .5em; padding: 6px 15px; font-size: 16px; @@ -619,9 +623,9 @@ html, body { background-color: transparent; } -#gogs-source .source-toolbar, -#gogs-source .info-box, -#gogs-source .file-content { +#source .source-toolbar, +#source .info-box, +#source .file-content { margin: 0 0 10px; } @@ -941,7 +945,7 @@ html, body { color: #888; } -#gogs-source .file-content.diff-file-box { +#source .file-content.diff-file-box { margin-bottom: 20px; } diff --git a/public/js/app.js b/public/js/app.js index f98fd03f82..0973398a50 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -243,7 +243,7 @@ function initCore() { function initRegister() { $.getScript("/js/jquery.validate.min.js", function () { - Gogits.validateForm("#gogs-login-card", { + Gogits.validateForm("#login-card", { rules: { "username": { required: true, @@ -268,7 +268,7 @@ function initRegister() { } function initUserSetting() { - $('#gogs-ssh-keys .delete').confirmation({ + $('#ssh-keys .delete').confirmation({ singleton: true, onConfirm: function (e, $this) { Gogits.ajaxDelete("", {"id": $this.data("del")}, function (json) { @@ -303,7 +303,7 @@ function initRepository() { // watching script (function () { - var $watch = $('#gogs-repo-watching'), + var $watch = $('#repo-watching'), watchLink = $watch.data("watch"), unwatchLink = $watch.data("unwatch"); $watch.on('click', '.to-watch',function () { @@ -354,14 +354,14 @@ function initRepository() { (function ($) { $(function () { initCore(); - var body = $("#gogs-body"); + var body = $("#body"); if (body.data("page") == "user-signup") { initRegister(); } if (body.data("page") == "user") { initUserSetting(); } - if ($('.gogs-repo-nav').length) { + if ($('.repo-nav').length) { initRepository(); } }); diff --git a/templates/admin/config.tmpl b/templates/admin/config.tmpl index 1e26304602..39895aa311 100644 --- a/templates/admin/config.tmpl +++ b/templates/admin/config.tmpl @@ -1,8 +1,8 @@ {{template "base/head" .}} {{template "base/navbar" .}} -
+
{{template "admin/nav" .}} -
+
Server Configuration diff --git a/templates/admin/dashboard.tmpl b/templates/admin/dashboard.tmpl index 2a5a161e03..e0b31817aa 100644 --- a/templates/admin/dashboard.tmpl +++ b/templates/admin/dashboard.tmpl @@ -1,8 +1,8 @@ {{template "base/head" .}} {{template "base/navbar" .}} -
+
{{template "admin/nav" .}} -
+
Statistic diff --git a/templates/admin/nav.tmpl b/templates/admin/nav.tmpl index 72f008acc7..8c2e33888e 100644 --- a/templates/admin/nav.tmpl +++ b/templates/admin/nav.tmpl @@ -1,4 +1,4 @@ -
+
  • Dashboard
  • Users
  • diff --git a/templates/admin/repos.tmpl b/templates/admin/repos.tmpl index 2c91ccc096..8cc424db68 100644 --- a/templates/admin/repos.tmpl +++ b/templates/admin/repos.tmpl @@ -1,8 +1,8 @@ {{template "base/head" .}} {{template "base/navbar" .}} -
    +
    {{template "admin/nav" .}} -
    +
    Repository Management diff --git a/templates/admin/users.tmpl b/templates/admin/users.tmpl index dec5c18954..63da451743 100644 --- a/templates/admin/users.tmpl +++ b/templates/admin/users.tmpl @@ -1,8 +1,8 @@ {{template "base/head" .}} {{template "base/navbar" .}} -
    +
    {{template "admin/nav" .}} -
    +
    User Management diff --git a/templates/admin/users/edit.tmpl b/templates/admin/users/edit.tmpl index 08f11fcb12..5db2c7a95e 100644 --- a/templates/admin/users/edit.tmpl +++ b/templates/admin/users/edit.tmpl @@ -1,8 +1,8 @@ {{template "base/head" .}} {{template "base/navbar" .}} -
    +
    {{template "admin/nav" .}} -
    +
    Edit Account diff --git a/templates/admin/users/new.tmpl b/templates/admin/users/new.tmpl index 7b41ae43a7..7f441f32b3 100644 --- a/templates/admin/users/new.tmpl +++ b/templates/admin/users/new.tmpl @@ -1,8 +1,8 @@ {{template "base/head" .}} {{template "base/navbar" .}} -
    +
    {{template "admin/nav" .}} -
    +
    New Account diff --git a/templates/base/navbar.tmpl b/templates/base/navbar.tmpl index 90e90f296f..829ecba62b 100644 --- a/templates/base/navbar.tmpl +++ b/templates/base/navbar.tmpl @@ -1,25 +1,25 @@ - -
    +
    {{if .IsRepositoryWatching}} {{else}} diff --git a/templates/repo/pulls.tmpl b/templates/repo/pulls.tmpl index daacc089c3..8c5d9376c8 100644 --- a/templates/repo/pulls.tmpl +++ b/templates/repo/pulls.tmpl @@ -2,8 +2,8 @@ {{template "base/navbar" .}} {{template "repo/nav" .}} {{template "repo/toolbar" .}} -
    -
    +
    +
    {{template "base/footer" .}} \ No newline at end of file diff --git a/templates/repo/setting.tmpl b/templates/repo/setting.tmpl index c826e55a77..d527dac3bc 100644 --- a/templates/repo/setting.tmpl +++ b/templates/repo/setting.tmpl @@ -2,8 +2,8 @@ {{template "base/navbar" .}} {{template "repo/nav" .}} {{template "repo/toolbar" .}} -
    -
    +