From 3b62a0fe0edad32c201ca0fce9b39bc540f6d5f4 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Tue, 10 Nov 2015 16:46:17 -0500 Subject: [PATCH] fix #1572 fix file histrory paging issue --- README.md | 2 +- gogs.go | 2 +- modules/base/markdown.go | 1 - routers/repo/commit.go | 83 +++++++------------------------ templates/.VERSION | 2 +- templates/repo/commits_table.tmpl | 2 +- 6 files changed, 23 insertions(+), 69 deletions(-) diff --git a/README.md b/README.md index 567777b42c..25b84d8eb3 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Gogs - Go Git Service [![Build Status](https://travis-ci.org/gogits/gogs.svg?bra ![](public/img/gogs-large-resize.png) -##### Current version: 0.7.2 Beta +##### Current version: 0.7.4 Beta diff --git a/gogs.go b/gogs.go index 74e5bd64e6..d56dd2c41b 100644 --- a/gogs.go +++ b/gogs.go @@ -17,7 +17,7 @@ import ( "github.com/gogits/gogs/modules/setting" ) -const APP_VER = "0.7.2.1109 Beta" +const APP_VER = "0.7.4.1110 Beta" func init() { runtime.GOMAXPROCS(runtime.NumCPU()) diff --git a/modules/base/markdown.go b/modules/base/markdown.go index e59a6273ab..8f3d6bef1a 100644 --- a/modules/base/markdown.go +++ b/modules/base/markdown.go @@ -107,7 +107,6 @@ func (options *CustomRender) Image(out *bytes.Buffer, link []byte, title []byte, } link = []byte(prefix + string(link)) } - fmt.Println(2, string(link)) out.WriteString(` commitsCount { - nextPage = 0 - } + ctx.Data["Page"] = paginater.New(commitsCount, git.CommitsRangeSize, page, 5) - commits, err := ctx.Repo.GitRepo.CommitsByFileAndRange( - branchName, fileName, page) + commits, err := ctx.Repo.GitRepo.CommitsByFileAndRange(branchName, fileName, page) if err != nil { - ctx.Handle(500, "repo.FileHistory(CommitsByRange)", err) + ctx.Handle(500, "CommitsByFileAndRange", err) return } commits = RenderIssueLinks(commits, ctx.Repo.RepoLink) commits = models.ValidateCommitsWithEmails(commits) - ctx.Data["Commits"] = commits - ctx.Data["Username"] = userName - ctx.Data["Reponame"] = repoName + + ctx.Data["Username"] = ctx.Repo.Owner.Name + ctx.Data["Reponame"] = ctx.Repo.Repository.Name ctx.Data["FileName"] = fileName ctx.Data["CommitCount"] = commitsCount - ctx.Data["LastPageNum"] = lastPage - ctx.Data["NextPageNum"] = nextPage + ctx.Data["Branch"] = branchName ctx.HTML(200, COMMITS) } diff --git a/templates/.VERSION b/templates/.VERSION index c5c0c2eee9..ba0a480335 100644 --- a/templates/.VERSION +++ b/templates/.VERSION @@ -1 +1 @@ -0.7.2.1109 Beta \ No newline at end of file +0.7.4.1110 Beta \ No newline at end of file diff --git a/templates/repo/commits_table.tmpl b/templates/repo/commits_table.tmpl index 6fc17508c5..58ab1ebb1e 100644 --- a/templates/repo/commits_table.tmpl +++ b/templates/repo/commits_table.tmpl @@ -1,5 +1,5 @@

- {{.CommitCount}} {{.i18n.Tr "repo.commits.commits"}} + {{.CommitCount}} {{.i18n.Tr "repo.commits.commits"}} {{if .Branch}}({{.Branch}}){{end}} {{if .PageIsCommits}}