diff options
author | Mario Lubenka <mario.lubenka@googlemail.com> | 2019-04-20 06:15:19 +0200 |
---|---|---|
committer | techknowlogick <matti@mdranta.net> | 2019-04-20 00:15:19 -0400 |
commit | fcbac38d6fd8c91be0da5e7f37e7bc69b071253a (patch) | |
tree | cdf7c901df75d0d2f26567d1090ed0e3c1af138d /routers/repo/issue.go | |
parent | 40dc458bb69f9827e804e2fe51c9f42caf3d3ddc (diff) | |
download | gitea-fcbac38d6fd8c91be0da5e7f37e7bc69b071253a.tar.gz gitea-fcbac38d6fd8c91be0da5e7f37e7bc69b071253a.zip |
Unifies pagination template usage (#6531) (#6533)
Diffstat (limited to 'routers/repo/issue.go')
-rw-r--r-- | routers/repo/issue.go | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/routers/repo/issue.go b/routers/repo/issue.go index 7d235d84ef..c818ac4840 100644 --- a/routers/repo/issue.go +++ b/routers/repo/issue.go @@ -27,7 +27,6 @@ import ( "code.gitea.io/gitea/modules/util" "github.com/Unknwon/com" - "github.com/Unknwon/paginater" ) const ( @@ -186,8 +185,7 @@ func issues(ctx *context.Context, milestoneID int64, isPullOption util.OptionalB } else { total = int(issueStats.ClosedCount) } - pager := paginater.New(total, setting.UI.IssuePagingNum, page, 5) - ctx.Data["Page"] = pager + pager := context.NewPagination(total, setting.UI.IssuePagingNum, page, 5) var issues []*models.Issue if forceEmpty { @@ -199,7 +197,7 @@ func issues(ctx *context.Context, milestoneID int64, isPullOption util.OptionalB PosterID: posterID, MentionedID: mentionedID, MilestoneID: milestoneID, - Page: pager.Current(), + Page: pager.Paginater.Current(), PageSize: setting.UI.IssuePagingNum, IsClosed: util.OptionalBoolOf(isShowClosed), IsPull: isPullOption, @@ -268,6 +266,15 @@ func issues(ctx *context.Context, milestoneID int64, isPullOption util.OptionalB } else { ctx.Data["State"] = "open" } + + pager.AddParam(ctx, "q", "Keyword") + pager.AddParam(ctx, "type", "ViewType") + pager.AddParam(ctx, "sort", "SortType") + pager.AddParam(ctx, "state", "State") + pager.AddParam(ctx, "labels", "SelectLabels") + pager.AddParam(ctx, "milestone", "MilestoneID") + pager.AddParam(ctx, "assignee", "AssigneeID") + ctx.Data["Page"] = pager } // Issues render issues page |