mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Rename module: middleware -> context
This commit is contained in:
@@ -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 {
|
||||
|
Reference in New Issue
Block a user