diff options
author | Giteabot <teabot@gitea.io> | 2023-03-14 08:51:14 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-14 20:51:14 +0800 |
commit | 8536dc4b73a22be203659c0b64bba7537efa63d7 (patch) | |
tree | 774c2321bc54a2e9d593ab66a7a10cb9f1f375e1 /modules | |
parent | 0a0f46f2990ada3abf4661f89ffe4ed539690e29 (diff) | |
download | gitea-8536dc4b73a22be203659c0b64bba7537efa63d7.tar.gz gitea-8536dc4b73a22be203659c0b64bba7537efa63d7.zip |
Make branches list page operations remember current page (#23420) (#23460)
Backport #23420 by @wxiaoguang
Close #23411
Always pass "page" query parameter to backend, and make backend respect
it.
The `ctx.FormInt("limit")` is never used, so removed.
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Jason Song <i@wolfogre.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Diffstat (limited to 'modules')
-rw-r--r-- | modules/context/pagination.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/modules/context/pagination.go b/modules/context/pagination.go index 3effd88f10..5a88c92053 100644 --- a/modules/context/pagination.go +++ b/modules/context/pagination.go @@ -18,10 +18,11 @@ type Pagination struct { urlParams []string } -// NewPagination creates a new instance of the Pagination struct -func NewPagination(total, page, issueNum, numPages int) *Pagination { +// NewPagination creates a new instance of the Pagination struct. +// "pagingNum" is "page size" or "limit", "current" is "page" +func NewPagination(total, pagingNum, current, numPages int) *Pagination { p := &Pagination{} - p.Paginater = paginator.New(total, page, issueNum, numPages) + p.Paginater = paginator.New(total, pagingNum, current, numPages) return p } |