From 514382e2ebfe6869268aeb919c1fa4d224687e13 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Fri, 11 Mar 2016 11:56:52 -0500 Subject: Rename module: middleware -> context --- routers/user/profile.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'routers/user/profile.go') diff --git a/routers/user/profile.go b/routers/user/profile.go index d0f41262d1..847cffdd4e 100644 --- a/routers/user/profile.go +++ b/routers/user/profile.go @@ -11,7 +11,7 @@ import ( "github.com/gogits/gogs/models" "github.com/gogits/gogs/modules/base" - "github.com/gogits/gogs/modules/middleware" + "github.com/gogits/gogs/modules/context" "github.com/gogits/gogs/modules/setting" "github.com/gogits/gogs/routers/repo" ) @@ -21,7 +21,7 @@ const ( STARS base.TplName = "user/meta/stars" ) -func GetUserByName(ctx *middleware.Context, name string) *models.User { +func GetUserByName(ctx *context.Context, name string) *models.User { user, err := models.GetUserByName(name) if err != nil { if models.IsErrUserNotExist(err) { @@ -35,11 +35,11 @@ func GetUserByName(ctx *middleware.Context, name string) *models.User { } // GetUserByParams returns user whose name is presented in URL paramenter. -func GetUserByParams(ctx *middleware.Context) *models.User { +func GetUserByParams(ctx *context.Context) *models.User { return GetUserByName(ctx, ctx.Params(":username")) } -func Profile(ctx *middleware.Context) { +func Profile(ctx *context.Context) { uname := ctx.Params(":username") // Special handle for FireFox requests favicon.ico. if uname == "favicon.ico" { @@ -103,7 +103,7 @@ func Profile(ctx *middleware.Context) { ctx.HTML(200, PROFILE) } -func Followers(ctx *middleware.Context) { +func Followers(ctx *context.Context) { u := GetUserByParams(ctx) if ctx.Written() { return @@ -115,7 +115,7 @@ func Followers(ctx *middleware.Context) { repo.RenderUserCards(ctx, u.NumFollowers, u.GetFollowers, FOLLOWERS) } -func Following(ctx *middleware.Context) { +func Following(ctx *context.Context) { u := GetUserByParams(ctx) if ctx.Written() { return @@ -127,11 +127,11 @@ func Following(ctx *middleware.Context) { repo.RenderUserCards(ctx, u.NumFollowing, u.GetFollowing, FOLLOWERS) } -func Stars(ctx *middleware.Context) { +func Stars(ctx *context.Context) { } -func Action(ctx *middleware.Context) { +func Action(ctx *context.Context) { u := GetUserByParams(ctx) if ctx.Written() { return -- cgit v1.2.3