diff options
author | Eryx <evorui@gmail.com> | 2014-10-14 09:54:45 +0800 |
---|---|---|
committer | Eryx <evorui@gmail.com> | 2014-10-14 09:54:45 +0800 |
commit | fb8beaf19a2a1cb81619681a78bf24a55ce3da64 (patch) | |
tree | e42b6898226bda8a351702c3d620222cc342df6a /routers/admin/users.go | |
parent | 4a8a70dde0f6fd7c5409766d30e6cc932b43b7c8 (diff) | |
download | gitea-fb8beaf19a2a1cb81619681a78bf24a55ce3da64.tar.gz gitea-fb8beaf19a2a1cb81619681a78bf24a55ce3da64.zip |
Fix pagination() to get the right total number of pages
Diffstat (limited to 'routers/admin/users.go')
-rw-r--r-- | routers/admin/users.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/routers/admin/users.go b/routers/admin/users.go index c9adf2d856..3510445329 100644 --- a/routers/admin/users.go +++ b/routers/admin/users.go @@ -5,6 +5,7 @@ package admin import ( + "math" "strings" "github.com/Unknwon/com" @@ -30,7 +31,7 @@ func pagination(ctx *middleware.Context, count int64, pageNum int) int { } curCount := int64((p-1)*pageNum + pageNum) if curCount >= count { - p = int(count) / pageNum + p = int(math.Ceil(float64(count) / float64(pageNum))) } else { ctx.Data["NextPageNum"] = p + 1 } |