aboutsummaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-07-25 07:59:54 +0800
committerUnknwon <u@gogs.io>2015-07-25 07:59:54 +0800
commit68cacf9c63024921818190163b3fa25158980b09 (patch)
treef12ea814fa1e907880f6056713f61813fdc5e272 /routers
parentc0883a51a03d2f7af56c20cbf054b9106528c75f (diff)
downloadgitea-68cacf9c63024921818190163b3fa25158980b09.tar.gz
gitea-68cacf9c63024921818190163b3fa25158980b09.zip
fix issue paging
Diffstat (limited to 'routers')
-rw-r--r--routers/repo/issue.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/routers/repo/issue.go b/routers/repo/issue.go
index e2d5bdc62e..79f8e36353 100644
--- a/routers/repo/issue.go
+++ b/routers/repo/issue.go
@@ -93,20 +93,21 @@ func Issues(ctx *middleware.Context) {
}
repo := ctx.Repo.Repository
+ selectLabels := ctx.Query("labels")
milestoneID := ctx.QueryInt64("milestone")
+ issueStats := models.GetIssueStats(repo.Id, uid, com.StrTo(selectLabels).MustInt64(), isShowClosed, filterMode)
+
page := ctx.QueryInt("page")
if page <= 1 {
page = 1
} else {
ctx.Data["PreviousPage"] = page - 1
}
- if (!isShowClosed && repo.NumOpenIssues > setting.IssuePagingNum*page) ||
- (isShowClosed && repo.NumClosedIssues > setting.IssuePagingNum*page) {
+ if (!isShowClosed && int(issueStats.OpenCount) > setting.IssuePagingNum*page) ||
+ (isShowClosed && int(issueStats.ClosedCount) > setting.IssuePagingNum*page) {
ctx.Data["NextPage"] = page + 1
}
- selectLabels := ctx.Query("labels")
-
// Get issues.
issues, err := models.GetIssues(uid, assigneeID, repo.Id, posterID, milestoneID,
page, isShowClosed, filterMode == models.FM_MENTION, selectLabels, ctx.Query("sortType"))
@@ -148,7 +149,6 @@ func Issues(ctx *middleware.Context) {
}
}
- issueStats := models.GetIssueStats(repo.Id, uid, com.StrTo(selectLabels).MustInt64(), isShowClosed, filterMode)
ctx.Data["IssueStats"] = issueStats
ctx.Data["SelectLabels"] = com.StrTo(selectLabels).MustInt64()
ctx.Data["ViewType"] = viewType