summaryrefslogtreecommitdiffstats
path: root/routers/repo/setting.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2016-03-11 11:56:52 -0500
committerUnknwon <u@gogs.io>2016-03-11 11:56:52 -0500
commit514382e2ebfe6869268aeb919c1fa4d224687e13 (patch)
tree1aa8c4b3b1e771a5dc6f0bdd74567961570efcaa /routers/repo/setting.go
parentcb1eadc2768ea5ffb2967eb4262e96730c3f9ba5 (diff)
downloadgitea-514382e2ebfe6869268aeb919c1fa4d224687e13.tar.gz
gitea-514382e2ebfe6869268aeb919c1fa4d224687e13.zip
Rename module: middleware -> context
Diffstat (limited to 'routers/repo/setting.go')
-rw-r--r--routers/repo/setting.go28
1 files changed, 14 insertions, 14 deletions
diff --git a/routers/repo/setting.go b/routers/repo/setting.go
index cf6f6a11c7..6785722422 100644
--- a/routers/repo/setting.go
+++ b/routers/repo/setting.go
@@ -13,9 +13,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/mailer"
- "github.com/gogits/gogs/modules/middleware"
"github.com/gogits/gogs/modules/setting"
)
@@ -27,13 +27,13 @@ const (
DEPLOY_KEYS base.TplName = "repo/settings/deploy_keys"
)
-func Settings(ctx *middleware.Context) {
+func Settings(ctx *context.Context) {
ctx.Data["Title"] = ctx.Tr("repo.settings")
ctx.Data["PageIsSettingsOptions"] = true
ctx.HTML(200, SETTINGS_OPTIONS)
}
-func SettingsPost(ctx *middleware.Context, form auth.RepoSettingForm) {
+func SettingsPost(ctx *context.Context, form auth.RepoSettingForm) {
ctx.Data["Title"] = ctx.Tr("repo.settings")
ctx.Data["PageIsSettingsOptions"] = true
@@ -271,7 +271,7 @@ func SettingsPost(ctx *middleware.Context, form auth.RepoSettingForm) {
}
}
-func Collaboration(ctx *middleware.Context) {
+func Collaboration(ctx *context.Context) {
ctx.Data["Title"] = ctx.Tr("repo.settings")
ctx.Data["PageIsSettingsCollaboration"] = true
@@ -285,7 +285,7 @@ func Collaboration(ctx *middleware.Context) {
ctx.HTML(200, COLLABORATION)
}
-func CollaborationPost(ctx *middleware.Context) {
+func CollaborationPost(ctx *context.Context) {
name := strings.ToLower(ctx.Query("collaborator"))
if len(name) == 0 || ctx.Repo.Owner.LowerName == name {
ctx.Redirect(setting.AppSubUrl + ctx.Req.URL.Path)
@@ -333,7 +333,7 @@ func CollaborationPost(ctx *middleware.Context) {
ctx.Redirect(setting.AppSubUrl + ctx.Req.URL.Path)
}
-func ChangeCollaborationAccessMode(ctx *middleware.Context) {
+func ChangeCollaborationAccessMode(ctx *context.Context) {
if err := ctx.Repo.Repository.ChangeCollaborationAccessMode(
ctx.QueryInt64("uid"),
models.AccessMode(ctx.QueryInt("mode"))); err != nil {
@@ -341,7 +341,7 @@ func ChangeCollaborationAccessMode(ctx *middleware.Context) {
}
}
-func DeleteCollaboration(ctx *middleware.Context) {
+func DeleteCollaboration(ctx *context.Context) {
if err := ctx.Repo.Repository.DeleteCollaboration(ctx.QueryInt64("id")); err != nil {
ctx.Flash.Error("DeleteCollaboration: " + err.Error())
} else {
@@ -353,7 +353,7 @@ func DeleteCollaboration(ctx *middleware.Context) {
})
}
-func parseOwnerAndRepo(ctx *middleware.Context) (*models.User, *models.Repository) {
+func parseOwnerAndRepo(ctx *context.Context) (*models.User, *models.Repository) {
owner, err := models.GetUserByName(ctx.Params(":username"))
if err != nil {
if models.IsErrUserNotExist(err) {
@@ -377,7 +377,7 @@ func parseOwnerAndRepo(ctx *middleware.Context) (*models.User, *models.Repositor
return owner, repo
}
-func GitHooks(ctx *middleware.Context) {
+func GitHooks(ctx *context.Context) {
ctx.Data["Title"] = ctx.Tr("repo.settings.githooks")
ctx.Data["PageIsSettingsGitHooks"] = true
@@ -391,7 +391,7 @@ func GitHooks(ctx *middleware.Context) {
ctx.HTML(200, GITHOOKS)
}
-func GitHooksEdit(ctx *middleware.Context) {
+func GitHooksEdit(ctx *context.Context) {
ctx.Data["Title"] = ctx.Tr("repo.settings.githooks")
ctx.Data["PageIsSettingsGitHooks"] = true
@@ -409,7 +409,7 @@ func GitHooksEdit(ctx *middleware.Context) {
ctx.HTML(200, GITHOOK_EDIT)
}
-func GitHooksEditPost(ctx *middleware.Context) {
+func GitHooksEditPost(ctx *context.Context) {
name := ctx.Params(":name")
hook, err := ctx.Repo.GitRepo.GetHook(name)
if err != nil {
@@ -428,7 +428,7 @@ func GitHooksEditPost(ctx *middleware.Context) {
ctx.Redirect(ctx.Repo.RepoLink + "/settings/hooks/git")
}
-func DeployKeys(ctx *middleware.Context) {
+func DeployKeys(ctx *context.Context) {
ctx.Data["Title"] = ctx.Tr("repo.settings.deploy_keys")
ctx.Data["PageIsSettingsKeys"] = true
@@ -442,7 +442,7 @@ func DeployKeys(ctx *middleware.Context) {
ctx.HTML(200, DEPLOY_KEYS)
}
-func DeployKeysPost(ctx *middleware.Context, form auth.AddSSHKeyForm) {
+func DeployKeysPost(ctx *context.Context, form auth.AddSSHKeyForm) {
ctx.Data["Title"] = ctx.Tr("repo.settings.deploy_keys")
ctx.Data["PageIsSettingsKeys"] = true
@@ -492,7 +492,7 @@ func DeployKeysPost(ctx *middleware.Context, form auth.AddSSHKeyForm) {
ctx.Redirect(ctx.Repo.RepoLink + "/settings/keys")
}
-func DeleteDeployKey(ctx *middleware.Context) {
+func DeleteDeployKey(ctx *context.Context) {
if err := models.DeleteDeployKey(ctx.User, ctx.QueryInt64("id")); err != nil {
ctx.Flash.Error("DeleteDeployKey: " + err.Error())
} else {