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/repo/release.go | |
parent | cb1eadc2768ea5ffb2967eb4262e96730c3f9ba5 (diff) | |
download | gitea-514382e2ebfe6869268aeb919c1fa4d224687e13.tar.gz gitea-514382e2ebfe6869268aeb919c1fa4d224687e13.zip |
Rename module: middleware -> context
Diffstat (limited to 'routers/repo/release.go')
-rw-r--r-- | routers/repo/release.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/routers/repo/release.go b/routers/repo/release.go index 4073fde82e..8985cdb8f5 100644 --- a/routers/repo/release.go +++ b/routers/repo/release.go @@ -10,9 +10,9 @@ import ( "github.com/gogits/gogs/models" "github.com/gogits/gogs/modules/auth" "github.com/gogits/gogs/modules/base" + "github.com/gogits/gogs/modules/context" "github.com/gogits/gogs/modules/log" "github.com/gogits/gogs/modules/markdown" - "github.com/gogits/gogs/modules/middleware" ) const ( @@ -21,7 +21,7 @@ const ( ) // calReleaseNumCommitsBehind calculates given release has how many commits behind default branch. -func calReleaseNumCommitsBehind(repoCtx *middleware.RepoContext, release *models.Release, countCache map[string]int64) error { +func calReleaseNumCommitsBehind(repoCtx *context.Repository, release *models.Release, countCache map[string]int64) error { // Fast return if release target is same as default branch. if repoCtx.BranchName == release.Target { release.NumCommitsBehind = repoCtx.CommitsCount - release.NumCommits @@ -43,7 +43,7 @@ func calReleaseNumCommitsBehind(repoCtx *middleware.RepoContext, release *models return nil } -func Releases(ctx *middleware.Context) { +func Releases(ctx *context.Context) { ctx.Data["Title"] = ctx.Tr("repo.release.releases") ctx.Data["PageIsReleaseList"] = true @@ -141,14 +141,14 @@ func Releases(ctx *middleware.Context) { ctx.HTML(200, RELEASES) } -func NewRelease(ctx *middleware.Context) { +func NewRelease(ctx *context.Context) { ctx.Data["Title"] = ctx.Tr("repo.release.new_release") ctx.Data["PageIsReleaseList"] = true ctx.Data["tag_target"] = ctx.Repo.Repository.DefaultBranch ctx.HTML(200, RELEASE_NEW) } -func NewReleasePost(ctx *middleware.Context, form auth.NewReleaseForm) { +func NewReleasePost(ctx *context.Context, form auth.NewReleaseForm) { ctx.Data["Title"] = ctx.Tr("repo.release.new_release") ctx.Data["PageIsReleaseList"] = true @@ -201,7 +201,7 @@ func NewReleasePost(ctx *middleware.Context, form auth.NewReleaseForm) { ctx.Redirect(ctx.Repo.RepoLink + "/releases") } -func EditRelease(ctx *middleware.Context) { +func EditRelease(ctx *context.Context) { ctx.Data["Title"] = ctx.Tr("repo.release.edit_release") ctx.Data["PageIsReleaseList"] = true ctx.Data["PageIsEditRelease"] = true @@ -226,7 +226,7 @@ func EditRelease(ctx *middleware.Context) { ctx.HTML(200, RELEASE_NEW) } -func EditReleasePost(ctx *middleware.Context, form auth.EditReleaseForm) { +func EditReleasePost(ctx *context.Context, form auth.EditReleaseForm) { ctx.Data["Title"] = ctx.Tr("repo.release.edit_release") ctx.Data["PageIsReleaseList"] = true ctx.Data["PageIsEditRelease"] = true @@ -263,7 +263,7 @@ func EditReleasePost(ctx *middleware.Context, form auth.EditReleaseForm) { ctx.Redirect(ctx.Repo.RepoLink + "/releases") } -func DeleteRelease(ctx *middleware.Context) { +func DeleteRelease(ctx *context.Context) { if err := models.DeleteReleaseByID(ctx.QueryInt64("id")); err != nil { ctx.Flash.Error("DeleteReleaseByID: " + err.Error()) } else { |