aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-05-13 12:40:32 -0400
committerUnknown <joe2010xtmf@163.com>2014-05-13 12:40:32 -0400
commit98dbbae2efd5c232d94f5e4d8df9d388cace2ebc (patch)
tree262ea9952e6c9f960ca86e839fb1f23cc8ee898c
parentc117f9e73f148468c624f31be237af7a691533a0 (diff)
downloadgitea-98dbbae2efd5c232d94f5e4d8df9d388cace2ebc.tar.gz
gitea-98dbbae2efd5c232d94f5e4d8df9d388cace2ebc.zip
Fix #166
-rw-r--r--README.md2
-rw-r--r--README_ZH.md2
-rw-r--r--gogs.go2
-rw-r--r--models/git_diff.go2
-rw-r--r--modules/middleware/repo.go1
-rw-r--r--templates/repo/diff.tmpl4
6 files changed, 7 insertions, 6 deletions
diff --git a/README.md b/README.md
index a43be6f36f..e50af3526f 100644
--- a/README.md
+++ b/README.md
@@ -5,7 +5,7 @@ Gogs(Go Git Service) is a Self Hosted Git Service in the Go Programming Language
![Demo](http://gowalker.org/public/gogs_demo.gif)
-##### Current version: 0.3.3 Alpha
+##### Current version: 0.3.4 Alpha
### NOTICES
diff --git a/README_ZH.md b/README_ZH.md
index 05797b9634..928d43f78a 100644
--- a/README_ZH.md
+++ b/README_ZH.md
@@ -5,7 +5,7 @@ Gogs(Go Git Service) 是一个由 Go 语言编写的自助 Git 托管服务。
![Demo](http://gowalker.org/public/gogs_demo.gif)
-##### 当前版本:0.3.3 Alpha
+##### 当前版本:0.3.4 Alpha
## 开发目的
diff --git a/gogs.go b/gogs.go
index 912cd77788..2a18b4de9d 100644
--- a/gogs.go
+++ b/gogs.go
@@ -17,7 +17,7 @@ import (
"github.com/gogits/gogs/modules/base"
)
-const APP_VER = "0.3.3.0512 Alpha"
+const APP_VER = "0.3.4.0513 Alpha"
func init() {
base.AppVer = APP_VER
diff --git a/models/git_diff.go b/models/git_diff.go
index cf93af6959..8dd5a8c882 100644
--- a/models/git_diff.go
+++ b/models/git_diff.go
@@ -49,6 +49,7 @@ type DiffSection struct {
type DiffFile struct {
Name string
+ Index int
Addition, Deletion int
Type int
IsBin bool
@@ -144,6 +145,7 @@ func ParsePatch(reader io.Reader) (*Diff, error) {
curFile = &DiffFile{
Name: a[strings.Index(a, "/")+1:],
+ Index: len(diff.Files) + 1,
Type: DIFF_FILE_CHANGE,
Sections: make([]*DiffSection, 0, 10),
}
diff --git a/modules/middleware/repo.go b/modules/middleware/repo.go
index 1bd1ea475d..bfb1e69da8 100644
--- a/modules/middleware/repo.go
+++ b/modules/middleware/repo.go
@@ -226,7 +226,6 @@ func RepoAssignment(redirect bool, args ...bool) martini.Handler {
ctx.Data["IsBranch"] = ctx.Repo.IsBranch
ctx.Data["IsCommit"] = ctx.Repo.IsCommit
- log.Debug("Repo.Commit: %v", ctx.Repo.Commit)
}
log.Debug("displayBare: %v; IsBare: %v", displayBare, ctx.Repo.Repository.IsBare)
diff --git a/templates/repo/diff.tmpl b/templates/repo/diff.tmpl
index 0b6d4f722e..c85caa21ec 100644
--- a/templates/repo/diff.tmpl
+++ b/templates/repo/diff.tmpl
@@ -51,14 +51,14 @@
</div>
<!-- todo finish all file status, now modify, add, delete and rename -->
<span class="status {{DiffTypeToStr .Type}}" data-toggle="tooltip" data-placement="right" title="{{DiffTypeToStr .Type}}">&nbsp;</span>
- <a class="file" href="#diff-1">{{.Name}}</a>
+ <a class="file" href="#diff-{{.Index}}">{{.Name}}</a>
</li>
{{end}}
</ol>
</div>
{{range .Diff.Files}}
- <div class="panel panel-default diff-file-box diff-box file-content" id="diff-2">
+ <div class="panel panel-default diff-file-box diff-box file-content" id="diff-{{.Index}}">
<div class="panel-heading">
<div class="diff-counter count pull-left">
{{if not .IsBin}}