summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author无闻 <joe2010xtmf@163.com>2014-10-13 22:47:21 -0400
committer无闻 <joe2010xtmf@163.com>2014-10-13 22:47:21 -0400
commit1a38f0e0d947ffe93ca9b958873f20cc7684334b (patch)
treee42b6898226bda8a351702c3d620222cc342df6a
parent4a8a70dde0f6fd7c5409766d30e6cc932b43b7c8 (diff)
parentfb8beaf19a2a1cb81619681a78bf24a55ce3da64 (diff)
downloadgitea-1a38f0e0d947ffe93ca9b958873f20cc7684334b.tar.gz
gitea-1a38f0e0d947ffe93ca9b958873f20cc7684334b.zip
Merge pull request #561 from eryx/master
Fix pagination() to get the right total number of pages
-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
}