diff options
author | Unknwon <u@gogs.io> | 2016-03-11 11:56:52 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2016-03-11 11:56:52 -0500 |
commit | 514382e2ebfe6869268aeb919c1fa4d224687e13 (patch) | |
tree | 1aa8c4b3b1e771a5dc6f0bdd74567961570efcaa /routers/user/profile.go | |
parent | cb1eadc2768ea5ffb2967eb4262e96730c3f9ba5 (diff) | |
download | gitea-514382e2ebfe6869268aeb919c1fa4d224687e13.tar.gz gitea-514382e2ebfe6869268aeb919c1fa4d224687e13.zip |
Rename module: middleware -> context
Diffstat (limited to 'routers/user/profile.go')
-rw-r--r-- | routers/user/profile.go | 16 |
1 files changed, 8 insertions, 8 deletions
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 |