milestone: only show issue-related count under issue list (#4316)
parent
c441f8080e
commit
79ba0314e9
|
@ -21,5 +21,5 @@ indent_style = space
|
|||
indent_size = 2
|
||||
|
||||
[*.js]
|
||||
indent_style = space
|
||||
indent_style = tab
|
||||
indent_size = 4
|
||||
|
|
2
gogs.go
2
gogs.go
|
@ -16,7 +16,7 @@ import (
|
|||
"github.com/gogits/gogs/modules/setting"
|
||||
)
|
||||
|
||||
const APP_VER = "0.10.28.0323"
|
||||
const APP_VER = "0.10.29.0324"
|
||||
|
||||
func init() {
|
||||
setting.AppVer = APP_VER
|
||||
|
|
|
@ -103,6 +103,15 @@ func (m *Milestone) APIFormat() *api.Milestone {
|
|||
return apiMilestone
|
||||
}
|
||||
|
||||
func (m *Milestone) CountIssues(isClosed, includePulls bool) int64 {
|
||||
sess := x.Where("milestone_id = ?", m.ID).And("is_closed = ?", isClosed)
|
||||
if !includePulls {
|
||||
sess.And("is_pull = ?", false)
|
||||
}
|
||||
count, _ := sess.Count(new(Issue))
|
||||
return count
|
||||
}
|
||||
|
||||
// NewMilestone creates new milestone of repository.
|
||||
func NewMilestone(m *Milestone) (err error) {
|
||||
sess := x.NewSession()
|
||||
|
|
|
@ -243,7 +243,7 @@ func serviceRPC(h serviceHandler, service string) {
|
|||
err error
|
||||
)
|
||||
|
||||
// Handle GZIP.
|
||||
// Handle GZIP
|
||||
if h.r.Header.Get("Content-Encoding") == "gzip" {
|
||||
reqBody, err = gzip.NewReader(reqBody)
|
||||
if err != nil {
|
||||
|
|
|
@ -1 +1 @@
|
|||
0.10.28.0323
|
||||
0.10.29.0324
|
|
@ -45,8 +45,10 @@
|
|||
{{end}}
|
||||
{{end}}
|
||||
<span class="issue-stats">
|
||||
<i class="octicon octicon-issue-opened"></i> {{$.i18n.Tr "repo.issues.open_tab" .NumOpenIssues}}
|
||||
<i class="octicon octicon-issue-closed"></i> {{$.i18n.Tr "repo.issues.close_tab" .NumClosedIssues}}
|
||||
{{ $openCount := .CountIssues false false}}
|
||||
{{ $closedCount := .CountIssues true false}}
|
||||
<i class="octicon octicon-issue-opened"></i> {{$.i18n.Tr "repo.issues.open_tab" $openCount}}
|
||||
<i class="octicon octicon-issue-closed"></i> {{$.i18n.Tr "repo.issues.close_tab" $closedCount}}
|
||||
</span>
|
||||
</div>
|
||||
{{if $.IsRepositoryWriter}}
|
||||
|
|
Loading…
Reference in New Issue