1
0
Fork 0

fix paging links and issue count

This commit is contained in:
Unknwon 2015-07-25 13:07:00 +08:00
parent 68cacf9c63
commit 2e7b38db9f
6 changed files with 19 additions and 11 deletions

View file

@ -7,7 +7,7 @@ Gogs (Go Git Service) is a painless self-hosted Git service.
![Demo](http://gogs.qiniudn.com/gogs_demo.gif)
##### Current version: 0.6.1 Beta
##### Current version: 0.6.2 Beta
### NOTICES

View file

@ -3,10 +3,6 @@ Gogs - Go Git Service [![Build Status](https://travis-ci.org/gogits/gogs.svg?bra
Gogs (Go Git Service) 是一款可轻易搭建的自助 Git 服务。
![Demo](http://gogs.qiniudn.com/gogs_demo.gif)
##### 当前版本0.6.1 Beta
## 开发目的
Gogs 的目标是打造一个最简单、最快速和最轻松的方式搭建自助 Git 服务。使用 Go 语言开发使得 Gogs 能够通过独立的二进制分发,并且支持 Go 语言支持的 **所有平台**,包括 Linux、Mac OS X 以及 Windows。

View file

@ -389,7 +389,7 @@ issues.label_edit = Edit
issues.label_delete = Delete
issues.label_modify = Label Modification
issues.label_deletion = Label Deletion
issues.label_deletion_desc = Delete label will remove it's information in all related issues. Do you want to continue?
issues.label_deletion_desc = Delete label will remove its information in all related issues. Do you want to continue?
issues.label_deletion_success = Label has been deleted successfully!
settings = Settings

View file

@ -412,7 +412,10 @@ func GetIssueStats(repoID, uid, labelID int64, isShowClosed bool, filterMode int
stats := &IssueStats{}
issue := new(Issue)
queryStr := "repo_id=? AND is_closed=?"
queryStr := "issue.repo_id=? AND issue.is_closed=?"
if labelID > 0 {
queryStr += " AND issue.label_ids like '%$" + com.ToStr(labelID) + "|%'"
}
switch filterMode {
case FM_ALL:
stats.OpenCount, _ = x.Where(queryStr, repoID, false).Count(issue)
@ -433,6 +436,15 @@ func GetIssueStats(repoID, uid, labelID int64, isShowClosed bool, filterMode int
case FM_MENTION:
queryStr += " AND uid=? AND is_mentioned=?"
if labelID > 0 {
stats.OpenCount, _ = x.Where(queryStr, repoID, false, uid, true).
Join("INNER", "issue", "issue.id = issue_id").Count(new(IssueUser))
stats.ClosedCount, _ = x.Where(queryStr, repoID, true, uid, true).
Join("INNER", "issue", "issue.id = issue_id").Count(new(IssueUser))
return stats
}
queryStr = strings.Replace(queryStr, "issue.", "", 2)
stats.OpenCount, _ = x.Where(queryStr, repoID, false, uid, true).Count(new(IssueUser))
stats.ClosedCount, _ = x.Where(queryStr, repoID, true, uid, true).Count(new(IssueUser))
return stats

File diff suppressed because one or more lines are too long

View file

@ -87,8 +87,8 @@
{{end}}
<div class="center page buttons">
<a class="ui {{if not .PreviousPage}}disabled{{end}} blue button" href="{{.RepoLink}}/issues?page={{.PreviousPage}}">{{.i18n.Tr "repo.issues.previous"}}</a>
<a class="ui {{if not .NextPage}}disabled{{end}} blue button" href="{{.RepoLink}}/issues?page={{.NextPage}}">{{.i18n.Tr "repo.issues.next"}}</a>
<a class="ui {{if not .PreviousPage}}disabled{{end}} blue button" href="{{.RepoLink}}/issues?type={{$.ViewType}}&state={{$.State}}&labels={{.SelectLabels}}&page={{.PreviousPage}}">{{.i18n.Tr "repo.issues.previous"}}</a>
<a class="ui {{if not .NextPage}}disabled{{end}} blue button" href="{{.RepoLink}}/issues?type={{$.ViewType}}&state={{$.State}}&labels={{.SelectLabels}}&page={{.NextPage}}">{{.i18n.Tr "repo.issues.next"}}</a>
</div>
</div>
</div>