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/view.go | |
parent | 40dc458bb69f9827e804e2fe51c9f42caf3d3ddc (diff) | |
download | gitea-fcbac38d6fd8c91be0da5e7f37e7bc69b071253a.tar.gz gitea-fcbac38d6fd8c91be0da5e7f37e7bc69b071253a.zip |
Unifies pagination template usage (#6531) (#6533)
Diffstat (limited to 'routers/repo/view.go')
-rw-r--r-- | routers/repo/view.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/routers/repo/view.go b/routers/repo/view.go index d20f94dfba..fa1e2d0747 100644 --- a/routers/repo/view.go +++ b/routers/repo/view.go @@ -24,8 +24,6 @@ import ( "code.gitea.io/gitea/modules/markup" "code.gitea.io/gitea/modules/setting" "code.gitea.io/gitea/modules/templates" - - "github.com/Unknwon/paginater" ) const ( @@ -462,10 +460,10 @@ func RenderUserCards(ctx *context.Context, total int, getter func(page int) ([]* if page <= 0 { page = 1 } - pager := paginater.New(total, models.ItemsPerPage, page, 5) + pager := context.NewPagination(total, models.ItemsPerPage, page, 5) ctx.Data["Page"] = pager - items, err := getter(pager.Current()) + items, err := getter(pager.Paginater.Current()) if err != nil { ctx.ServerError("getter", err) return @@ -480,6 +478,7 @@ func Watchers(ctx *context.Context) { ctx.Data["Title"] = ctx.Tr("repo.watchers") ctx.Data["CardsTitle"] = ctx.Tr("repo.watchers") ctx.Data["PageIsWatchers"] = true + RenderUserCards(ctx, ctx.Repo.Repository.NumWatches, ctx.Repo.Repository.GetWatchers, tplWatchers) } |