diff options
author | 0ko <0ko@noreply.codeberg.org> | 2024-03-07 09:30:12 +0100 |
---|---|---|
committer | 0ko <0ko@noreply.codeberg.org> | 2024-03-07 09:30:12 +0100 |
commit | 498a3f988db67927b538c2224d5637dba965588f (patch) | |
tree | 7d8d1ba4356641d796177afd64da39d9dd696ce5 /routers | |
parent | Merge pull request '[BUG] Remember topic only in repo search' (#2575) from gu... (diff) | |
download | forgejo-498a3f988db67927b538c2224d5637dba965588f.tar.xz forgejo-498a3f988db67927b538c2224d5637dba965588f.zip |
Better number for UserCards pagination
Diffstat (limited to 'routers')
-rw-r--r-- | routers/web/repo/view.go | 8 |
1 files changed, 4 insertions, 4 deletions
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) |