summaryrefslogtreecommitdiffstats
path: root/routers/admin/users.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2016-03-11 15:33:12 -0500
committerUnknwon <u@gogs.io>2016-03-11 15:33:12 -0500
commit2bf8494332592b3c57f9a12a26b9abd356fb3f15 (patch)
treee46c61ba30018ebbafcda6b97b36d3ffece3cfb0 /routers/admin/users.go
parentdf2bdf7ea36ad0729e0326ca799d8896d7f96946 (diff)
downloadgitea-2bf8494332592b3c57f9a12a26b9abd356fb3f15.tar.gz
gitea-2bf8494332592b3c57f9a12a26b9abd356fb3f15.zip
#13 finish user and repository search
Both are possible on explore and admin panel
Diffstat (limited to 'routers/admin/users.go')
-rw-r--r--routers/admin/users.go20
1 files changed, 3 insertions, 17 deletions
diff --git a/routers/admin/users.go b/routers/admin/users.go
index 274effc4b6..00028a2fdd 100644
--- a/routers/admin/users.go
+++ b/routers/admin/users.go
@@ -8,7 +8,6 @@ import (
"strings"
"github.com/Unknwon/com"
- "github.com/Unknwon/paginater"
"github.com/gogits/gogs/models"
"github.com/gogits/gogs/modules/auth"
@@ -17,6 +16,7 @@ import (
"github.com/gogits/gogs/modules/log"
"github.com/gogits/gogs/modules/mailer"
"github.com/gogits/gogs/modules/setting"
+ "github.com/gogits/gogs/routers"
)
const (
@@ -30,22 +30,8 @@ func Users(ctx *context.Context) {
ctx.Data["PageIsAdmin"] = true
ctx.Data["PageIsAdminUsers"] = true
- total := models.CountUsers()
- page := ctx.QueryInt("page")
- if page <= 1 {
- page = 1
- }
- ctx.Data["Page"] = paginater.New(int(total), setting.AdminUserPagingNum, page, 5)
-
- users, err := models.Users(page, setting.AdminUserPagingNum)
- if err != nil {
- ctx.Handle(500, "Users", err)
- return
- }
- ctx.Data["Users"] = users
-
- ctx.Data["Total"] = total
- ctx.HTML(200, USERS)
+ routers.RenderUserSearch(ctx, models.USER_TYPE_INDIVIDUAL, models.CountUsers, models.Users,
+ setting.AdminUserPagingNum, "id ASC", USERS)
}
func NewUser(ctx *context.Context) {