From 498a3f988db67927b538c2224d5637dba965588f Mon Sep 17 00:00:00 2001 From: 0ko <0ko@noreply.codeberg.org> Date: Thu, 7 Mar 2024 13:30:12 +0500 Subject: Better number for UserCards pagination --- routers/web/repo/view.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'routers') diff --git a/routers/web/repo/view.go b/routers/web/repo/view.go index 27984e7621..9f8d1fcdfd 100644 --- a/routers/web/repo/view.go +++ b/routers/web/repo/view.go @@ -1127,12 +1127,12 @@ func RenderUserCards(ctx *context.Context, total int, getter func(opts db.ListOp if page <= 0 { page = 1 } - pager := context.NewPagination(total, setting.ItemsPerPage, page, 5) + pager := context.NewPagination(total, setting.MaxUserCardsPerPage, page, 5) ctx.Data["Page"] = pager items, err := getter(db.ListOptions{ Page: pager.Paginater.Current(), - PageSize: setting.ItemsPerPage, + PageSize: setting.MaxUserCardsPerPage, }) if err != nil { ctx.ServerError("getter", err) @@ -1173,12 +1173,12 @@ func Forks(ctx *context.Context) { page = 1 } - pager := context.NewPagination(ctx.Repo.Repository.NumForks, setting.ItemsPerPage, page, 5) + pager := context.NewPagination(ctx.Repo.Repository.NumForks, setting.MaxForksPerPage, page, 5) ctx.Data["Page"] = pager forks, err := repo_model.GetForks(ctx, ctx.Repo.Repository, db.ListOptions{ Page: pager.Paginater.Current(), - PageSize: setting.ItemsPerPage, + PageSize: setting.MaxForksPerPage, }) if err != nil { ctx.ServerError("GetForks", err) -- cgit v1.2.3