diff --git a/.editorconfig b/.editorconfig index 3fbca842..04c5131e 100644 --- a/.editorconfig +++ b/.editorconfig @@ -21,5 +21,5 @@ indent_style = space indent_size = 2 [*.js] -indent_style = space +indent_style = tab indent_size = 4 diff --git a/gogs.go b/gogs.go index 4628ca53..daabd5ac 100644 --- a/gogs.go +++ b/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 diff --git a/models/milestone.go b/models/milestone.go index 56a19cd8..206798e6 100644 --- a/models/milestone.go +++ b/models/milestone.go @@ -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() diff --git a/routers/repo/http.go b/routers/repo/http.go index e1cc5f96..9b893f27 100644 --- a/routers/repo/http.go +++ b/routers/repo/http.go @@ -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 { diff --git a/templates/.VERSION b/templates/.VERSION index 41542a93..f50cab28 100644 --- a/templates/.VERSION +++ b/templates/.VERSION @@ -1 +1 @@ -0.10.28.0323 \ No newline at end of file +0.10.29.0324 \ No newline at end of file diff --git a/templates/repo/issue/milestones.tmpl b/templates/repo/issue/milestones.tmpl index e9055843..634dfdd6 100644 --- a/templates/repo/issue/milestones.tmpl +++ b/templates/repo/issue/milestones.tmpl @@ -45,8 +45,10 @@ {{end}} {{end}} - {{$.i18n.Tr "repo.issues.open_tab" .NumOpenIssues}} - {{$.i18n.Tr "repo.issues.close_tab" .NumClosedIssues}} + {{ $openCount := .CountIssues false false}} + {{ $closedCount := .CountIssues true false}} + {{$.i18n.Tr "repo.issues.open_tab" $openCount}} + {{$.i18n.Tr "repo.issues.close_tab" $closedCount}} {{if $.IsRepositoryWriter}}