aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.editorconfig2
-rw-r--r--gogs.go2
-rw-r--r--models/milestone.go9
-rw-r--r--routers/repo/http.go2
-rw-r--r--templates/.VERSION2
-rw-r--r--templates/repo/issue/milestones.tmpl6
6 files changed, 17 insertions, 6 deletions
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}}
<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}}