Browse Source

repo: recalculate milestone completeness on issue list (#4316)

pull/4343/head
Unknwon 8 years ago
parent
commit
09cb48e41c
No known key found for this signature in database
GPG Key ID: 25B575AE3213B2B3
  1. 5
      routers/repo/issue.go

5
routers/repo/issue.go

@ -1087,6 +1087,11 @@ func Milestones(ctx *context.Context) {
return
}
for _, m := range miles {
m.NumOpenIssues = int(m.CountIssues(false, false))
m.NumClosedIssues = int(m.CountIssues(true, false))
if m.NumOpenIssues+m.NumClosedIssues > 0 {
m.Completeness = m.NumClosedIssues * 100 / (m.NumOpenIssues + m.NumClosedIssues)
}
m.RenderedContent = string(markdown.Render([]byte(m.Content), ctx.Repo.RepoLink, ctx.Repo.Repository.ComposeMetas()))
}
ctx.Data["Milestones"] = miles

Loading…
Cancel
Save