]> source.dussan.org Git - gitea.git/commitdiff
Mirror fix on admin/orgs paging
authorUnknwon <joe2010xtmf@163.com>
Fri, 10 Oct 2014 07:28:21 +0000 (03:28 -0400)
committerUnknwon <joe2010xtmf@163.com>
Fri, 10 Oct 2014 07:28:21 +0000 (03:28 -0400)
gogs.go
routers/admin/orgs.go
routers/admin/users.go
templates/.VERSION

diff --git a/gogs.go b/gogs.go
index f38256220ff2858f29d16689d67f6cec917606dc..05fcd2cd9c356d803e4bebca84b4323d78d4be69 100644 (file)
--- a/gogs.go
+++ b/gogs.go
@@ -17,7 +17,7 @@ import (
        "github.com/gogits/gogs/modules/setting"
 )
 
-const APP_VER = "0.5.5.1009 Beta"
+const APP_VER = "0.5.5.1010 Beta"
 
 func init() {
        runtime.GOMAXPROCS(runtime.NumCPU())
index e813e4742046c86d1211289be779b0d1015d8a39..54d7af5cb3c6131f83dabcc537cdb38d87594893 100644 (file)
@@ -25,7 +25,7 @@ func Organizations(ctx *middleware.Context) {
        var err error
        ctx.Data["Orgs"], err = models.GetOrganizations(pageNum, (p-1)*pageNum)
        if err != nil {
-               ctx.Handle(500, "GetUsers", err)
+               ctx.Handle(500, "GetOrganizations", err)
                return
        }
        ctx.HTML(200, ORGS)
index e5cd364f3a7d7985e2f14fe08c5a99b077d14e33..c9adf2d85669261be3f5bcdf03e55006a360f036 100644 (file)
@@ -24,14 +24,14 @@ const (
 )
 
 func pagination(ctx *middleware.Context, count int64, pageNum int) int {
-       p := com.StrTo(ctx.Query("p")).MustInt()
+       p := ctx.QueryInt("p")
        if p < 1 {
                p = 1
        }
        curCount := int64((p-1)*pageNum + pageNum)
-       if curCount > count {
+       if curCount >= count {
                p = int(count) / pageNum
-       } else if count > curCount {
+       } else {
                ctx.Data["NextPageNum"] = p + 1
        }
        if p > 1 {
index 35a9c242838bd563a5aa84b8710773ca71268b74..d62a81b607736e68bc461fef29ac187382cd8c32 100644 (file)
@@ -1 +1 @@
-0.5.5.1009 Beta
\ No newline at end of file
+0.5.5.1010 Beta
\ No newline at end of file