From c9e1eb0a0d9e6bdafa158442158c762b7f188177 Mon Sep 17 00:00:00 2001 From: FuXiaoHei Date: Mon, 24 Mar 2014 22:23:55 +0800 Subject: [PATCH 1/3] diff page ui --- public/css/gogs.css | 12 +++++++++++- templates/repo/diff.tmpl | 30 ++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/public/css/gogs.css b/public/css/gogs.css index ec37721fd6..434af03590 100755 --- a/public/css/gogs.css +++ b/public/css/gogs.css @@ -711,6 +711,12 @@ html, body { width: 1%; } +.file-content .file-body.file-code .lines-ellipsis { + background-color: #FAFAFA; + color: #999; + width: 1%; +} + .file-content .file-body.file-code .lines-num span { font-family: Menlo, Monaco, Consolas, "Courier New", monospace; line-height: 1.6; @@ -896,7 +902,7 @@ html, body { background-color: #e9aeae; } -.diff-detail-box span.status.rename{ +.diff-detail-box span.status.rename { background-color: #dad8ff; } @@ -962,6 +968,10 @@ html, body { border-color: #f0db88 !important; } +.diff-file-box .ellipsis-code pre { + color: #AAA; +} + /* wrapper and footer */ #wrapper { diff --git a/templates/repo/diff.tmpl b/templates/repo/diff.tmpl index 0c6f4febcd..b0836127ff 100644 --- a/templates/repo/diff.tmpl +++ b/templates/repo/diff.tmpl @@ -387,6 +387,36 @@
	"github.com/youtube/vitess/go/bson"
+ + + + + +
	"github.com/youtube/vitess/go/bson"
+ + + + + 10 + + + 8 + + +
	"github.com/youtube/vitess/go/bson"
+ + + + + 10 + + + 8 + + +
	"github.com/youtube/vitess/go/bson"
+ + From 48ea9b12f65e21c8584eb89224bda4ad6c635847 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Mon, 24 Mar 2014 22:26:05 +0800 Subject: [PATCH 2/3] add log --- models/repo.go | 2 ++ serve.go | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/models/repo.go b/models/repo.go index e27e99b056..14bcfcca4d 100644 --- a/models/repo.go +++ b/models/repo.go @@ -261,6 +261,7 @@ func initRepository(f string, user *User, repo *Repository, initReadme bool, rep return err } + /* // hook/post-update pu, err := os.OpenFile(filepath.Join(repoPath, "hooks", "post-update"), os.O_CREATE|os.O_WRONLY, 0777) if err != nil { @@ -282,6 +283,7 @@ func initRepository(f string, user *User, repo *Repository, initReadme bool, rep if _, err = pu2.WriteString("#!/usr/bin/env bash\ngit update-server-info\n"); err != nil { return err } + */ // Initialize repository according to user's choice. fileName := map[string]string{} diff --git a/serve.go b/serve.go index b84fa2a4e5..ca79973a66 100644 --- a/serve.go +++ b/serve.go @@ -44,6 +44,10 @@ gogs serv provide access auth for repositories`, Flags: []cli.Flag{}, } +func init() { + log.NewLogger(10000, "file", fmt.Sprintf(`{"filename":"%s"}`, "log/serv.log")) +} + func parseCmd(cmd string) (string, string) { ss := strings.SplitN(cmd, " ", 2) if len(ss) != 2 { @@ -227,7 +231,7 @@ func runServ(k *cli.Context) { return } if ref, ok = refs[refname]; !ok { - println("unknow reference name -", refname, "-") + log.Trace("unknow reference name -", refname, "-", b.String()) return } l, err = ref.AllCommits() From 3473aa9e42b670aecaf328c8d281d91b0f7f8923 Mon Sep 17 00:00:00 2001 From: FuXiaoHei Date: Mon, 24 Mar 2014 23:30:02 +0800 Subject: [PATCH 3/3] repo single file raw button --- templates/repo/single_file.tmpl | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/repo/single_file.tmpl b/templates/repo/single_file.tmpl index 40ef44eb1b..2a28f0b54a 100644 --- a/templates/repo/single_file.tmpl +++ b/templates/repo/single_file.tmpl @@ -5,6 +5,7 @@ {{else}} {{end}}{{.FileName}} + Raw {{if .FileIsLarge}}