diff options
Diffstat (limited to 'routers/web/repo/milestone.go')
-rw-r--r-- | routers/web/repo/milestone.go | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/routers/web/repo/milestone.go b/routers/web/repo/milestone.go index ca77e0976e..3ba27dd19a 100644 --- a/routers/web/repo/milestone.go +++ b/routers/web/repo/milestone.go @@ -53,17 +53,12 @@ func Milestones(ctx *context.Context) { page = 1 } - var total int - var state structs.StateType - if !isShowClosed { - total = int(stats.OpenCount) - state = structs.StateOpen - } else { - total = int(stats.ClosedCount) + state := structs.StateOpen + if isShowClosed { state = structs.StateClosed } - miles, err := models.GetMilestones(models.GetMilestonesOption{ + miles, total, err := models.GetMilestones(models.GetMilestonesOption{ ListOptions: models.ListOptions{ Page: page, PageSize: setting.UI.IssuePagingNum, @@ -106,7 +101,7 @@ func Milestones(ctx *context.Context) { ctx.Data["Keyword"] = keyword ctx.Data["IsShowClosed"] = isShowClosed - pager := context.NewPagination(total, setting.UI.IssuePagingNum, page, 5) + pager := context.NewPagination(int(total), setting.UI.IssuePagingNum, page, 5) pager.AddParam(ctx, "state", "State") pager.AddParam(ctx, "q", "Keyword") ctx.Data["Page"] = pager |