From 88291745747ffb200b55ca62e1054d1d2c4315d3 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Fri, 29 Aug 2014 15:32:52 +0800 Subject: Finish new admin users pages --- routers/admin/admin.go | 30 ------------------------------ 1 file changed, 30 deletions(-) (limited to 'routers/admin/admin.go') diff --git a/routers/admin/admin.go b/routers/admin/admin.go index ebc446b8..75dbf271 100644 --- a/routers/admin/admin.go +++ b/routers/admin/admin.go @@ -23,7 +23,6 @@ import ( const ( DASHBOARD base.TplName = "admin/dashboard" - USERS base.TplName = "admin/users" REPOS base.TplName = "admin/repos" AUTHS base.TplName = "admin/auths" CONFIG base.TplName = "admin/config" @@ -157,35 +156,6 @@ func Dashboard(ctx *middleware.Context) { ctx.HTML(200, DASHBOARD) } -func Users(ctx *middleware.Context) { - ctx.Data["Title"] = "User Management" - ctx.Data["PageIsUsers"] = true - - p := com.StrTo(ctx.Query("p")).MustInt() - if p < 1 { - p = 1 - } - pageNum := 50 - count := models.CountUsers() - curCount := int64((p-1)*pageNum + pageNum) - if curCount > count { - p = int(count) / pageNum - } else if count > curCount { - ctx.Data["NextPageNum"] = p + 1 - } - if p > 1 { - ctx.Data["LastPageNum"] = p - 1 - } - - var err error - ctx.Data["Users"], err = models.GetUsers(pageNum, (p-1)*pageNum) - if err != nil { - ctx.Handle(500, "admin.Users(GetUsers)", err) - return - } - ctx.HTML(200, USERS) -} - func Repositories(ctx *middleware.Context) { ctx.Data["Title"] = "Repository Management" ctx.Data["PageIsRepos"] = true -- cgit v1.2.3