From d2aff9a46a20bfd5345fec8a88d2638997a833c0 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Fri, 29 Aug 2014 20:50:43 +0800 Subject: Continue working on new admin pages --- routers/admin/admin.go | 44 -------------------------------------------- 1 file changed, 44 deletions(-) (limited to 'routers/admin/admin.go') diff --git a/routers/admin/admin.go b/routers/admin/admin.go index 75dbf2712b..b2c932c98f 100644 --- a/routers/admin/admin.go +++ b/routers/admin/admin.go @@ -23,8 +23,6 @@ import ( const ( DASHBOARD base.TplName = "admin/dashboard" - REPOS base.TplName = "admin/repos" - AUTHS base.TplName = "admin/auths" CONFIG base.TplName = "admin/config" MONITOR_PROCESS base.TplName = "admin/monitor/process" MONITOR_CRON base.TplName = "admin/monitor/cron" @@ -156,48 +154,6 @@ func Dashboard(ctx *middleware.Context) { ctx.HTML(200, DASHBOARD) } -func Repositories(ctx *middleware.Context) { - ctx.Data["Title"] = "Repository Management" - ctx.Data["PageIsRepos"] = true - - p := com.StrTo(ctx.Query("p")).MustInt() - if p < 1 { - p = 1 - } - pageNum := 50 - count := models.CountRepositories() - 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["Repos"], err = models.GetRepositoriesWithUsers(pageNum, (p-1)*pageNum) - if err != nil { - ctx.Handle(500, "admin.Repositories", err) - return - } - ctx.HTML(200, REPOS) -} - -func Auths(ctx *middleware.Context) { - ctx.Data["Title"] = "Auth Sources" - ctx.Data["PageIsAuths"] = true - - var err error - ctx.Data["Sources"], err = models.GetAuths() - if err != nil { - ctx.Handle(500, "admin.Auths", err) - return - } - ctx.HTML(200, AUTHS) -} - func Config(ctx *middleware.Context) { ctx.Data["Title"] = "Server Configuration" ctx.Data["PageIsConfig"] = true -- cgit v1.2.3