summaryrefslogtreecommitdiffstats
path: root/routers/admin/users.go
diff options
context:
space:
mode:
authorEryx <evorui@gmail.com>2014-10-14 09:54:45 +0800
committerEryx <evorui@gmail.com>2014-10-14 09:54:45 +0800
commitfb8beaf19a2a1cb81619681a78bf24a55ce3da64 (patch)
treee42b6898226bda8a351702c3d620222cc342df6a /routers/admin/users.go
parent4a8a70dde0f6fd7c5409766d30e6cc932b43b7c8 (diff)
downloadgitea-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.go3
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
}