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/org | |
parent | cb1eadc2768ea5ffb2967eb4262e96730c3f9ba5 (diff) | |
download | gitea-514382e2ebfe6869268aeb919c1fa4d224687e13.tar.gz gitea-514382e2ebfe6869268aeb919c1fa4d224687e13.zip |
Rename module: middleware -> context
Diffstat (limited to 'routers/org')
-rw-r--r-- | routers/org/members.go | 8 | ||||
-rw-r--r-- | routers/org/org.go | 6 | ||||
-rw-r--r-- | routers/org/setting.go | 16 | ||||
-rw-r--r-- | routers/org/teams.go | 22 |
4 files changed, 26 insertions, 26 deletions
diff --git a/routers/org/members.go b/routers/org/members.go index a0a3051d4e..1d720ce617 100644 --- a/routers/org/members.go +++ b/routers/org/members.go @@ -9,8 +9,8 @@ import ( "github.com/gogits/gogs/models" "github.com/gogits/gogs/modules/base" + "github.com/gogits/gogs/modules/context" "github.com/gogits/gogs/modules/log" - "github.com/gogits/gogs/modules/middleware" "github.com/gogits/gogs/modules/setting" ) @@ -19,7 +19,7 @@ const ( MEMBER_INVITE base.TplName = "org/member/invite" ) -func Members(ctx *middleware.Context) { +func Members(ctx *context.Context) { org := ctx.Org.Organization ctx.Data["Title"] = org.FullName ctx.Data["PageIsOrgMembers"] = true @@ -33,7 +33,7 @@ func Members(ctx *middleware.Context) { ctx.HTML(200, MEMBERS) } -func MembersAction(ctx *middleware.Context) { +func MembersAction(ctx *context.Context) { uid := com.StrTo(ctx.Query("uid")).MustInt64() if uid == 0 { ctx.Redirect(ctx.Org.OrgLink + "/members") @@ -91,7 +91,7 @@ func MembersAction(ctx *middleware.Context) { } } -func Invitation(ctx *middleware.Context) { +func Invitation(ctx *context.Context) { org := ctx.Org.Organization ctx.Data["Title"] = org.FullName ctx.Data["PageIsOrgMembers"] = true diff --git a/routers/org/org.go b/routers/org/org.go index dff11be47f..1257c108d0 100644 --- a/routers/org/org.go +++ b/routers/org/org.go @@ -8,8 +8,8 @@ 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/middleware" "github.com/gogits/gogs/modules/setting" ) @@ -17,12 +17,12 @@ const ( CREATE base.TplName = "org/create" ) -func Create(ctx *middleware.Context) { +func Create(ctx *context.Context) { ctx.Data["Title"] = ctx.Tr("new_org") ctx.HTML(200, CREATE) } -func CreatePost(ctx *middleware.Context, form auth.CreateOrgForm) { +func CreatePost(ctx *context.Context, form auth.CreateOrgForm) { ctx.Data["Title"] = ctx.Tr("new_org") if ctx.HasError() { diff --git a/routers/org/setting.go b/routers/org/setting.go index 29ce34f5d9..c50e18d7c9 100644 --- a/routers/org/setting.go +++ b/routers/org/setting.go @@ -12,8 +12,8 @@ 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/middleware" "github.com/gogits/gogs/modules/setting" "github.com/gogits/gogs/routers/user" ) @@ -24,13 +24,13 @@ const ( SETTINGS_HOOKS base.TplName = "org/settings/hooks" ) -func Settings(ctx *middleware.Context) { +func Settings(ctx *context.Context) { ctx.Data["Title"] = ctx.Tr("org.settings") ctx.Data["PageIsSettingsOptions"] = true ctx.HTML(200, SETTINGS_OPTIONS) } -func SettingsPost(ctx *middleware.Context, form auth.UpdateOrgSettingForm) { +func SettingsPost(ctx *context.Context, form auth.UpdateOrgSettingForm) { ctx.Data["Title"] = ctx.Tr("org.settings") ctx.Data["PageIsSettingsOptions"] = true @@ -85,7 +85,7 @@ func SettingsPost(ctx *middleware.Context, form auth.UpdateOrgSettingForm) { ctx.Redirect(ctx.Org.OrgLink + "/settings") } -func SettingsAvatar(ctx *middleware.Context, form auth.UploadAvatarForm) { +func SettingsAvatar(ctx *context.Context, form auth.UploadAvatarForm) { form.Enable = true if err := user.UpdateAvatarSetting(ctx, form, ctx.Org.Organization); err != nil { ctx.Flash.Error(err.Error()) @@ -96,7 +96,7 @@ func SettingsAvatar(ctx *middleware.Context, form auth.UploadAvatarForm) { ctx.Redirect(ctx.Org.OrgLink + "/settings") } -func SettingsDeleteAvatar(ctx *middleware.Context) { +func SettingsDeleteAvatar(ctx *context.Context) { if err := ctx.Org.Organization.DeleteAvatar(); err != nil { ctx.Flash.Error(err.Error()) } @@ -104,7 +104,7 @@ func SettingsDeleteAvatar(ctx *middleware.Context) { ctx.Redirect(ctx.Org.OrgLink + "/settings") } -func SettingsDelete(ctx *middleware.Context) { +func SettingsDelete(ctx *context.Context) { ctx.Data["Title"] = ctx.Tr("org.settings") ctx.Data["PageIsSettingsDelete"] = true @@ -136,7 +136,7 @@ func SettingsDelete(ctx *middleware.Context) { ctx.HTML(200, SETTINGS_DELETE) } -func Webhooks(ctx *middleware.Context) { +func Webhooks(ctx *context.Context) { ctx.Data["Title"] = ctx.Tr("org.settings") ctx.Data["PageIsSettingsHooks"] = true ctx.Data["BaseLink"] = ctx.Org.OrgLink @@ -164,7 +164,7 @@ func Webhooks(ctx *middleware.Context) { ctx.HTML(200, SETTINGS_HOOKS) } -func DeleteWebhook(ctx *middleware.Context) { +func DeleteWebhook(ctx *context.Context) { if err := models.DeleteWebhook(ctx.QueryInt64("id")); err != nil { ctx.Flash.Error("DeleteWebhook: " + err.Error()) } else { diff --git a/routers/org/teams.go b/routers/org/teams.go index e4a6afcf45..e8ae8291b7 100644 --- a/routers/org/teams.go +++ b/routers/org/teams.go @@ -12,8 +12,8 @@ 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/middleware" ) const ( @@ -23,7 +23,7 @@ const ( TEAM_REPOSITORIES base.TplName = "org/team/repositories" ) -func Teams(ctx *middleware.Context) { +func Teams(ctx *context.Context) { org := ctx.Org.Organization ctx.Data["Title"] = org.FullName ctx.Data["PageIsOrgTeams"] = true @@ -39,7 +39,7 @@ func Teams(ctx *middleware.Context) { ctx.HTML(200, TEAMS) } -func TeamsAction(ctx *middleware.Context) { +func TeamsAction(ctx *context.Context) { uid := com.StrTo(ctx.Query("uid")).MustInt64() if uid == 0 { ctx.Redirect(ctx.Org.OrgLink + "/teams") @@ -107,7 +107,7 @@ func TeamsAction(ctx *middleware.Context) { } } -func TeamsRepoAction(ctx *middleware.Context) { +func TeamsRepoAction(ctx *context.Context) { if !ctx.Org.IsOwner { ctx.Error(404) return @@ -141,7 +141,7 @@ func TeamsRepoAction(ctx *middleware.Context) { ctx.Redirect(ctx.Org.OrgLink + "/teams/" + ctx.Org.Team.LowerName + "/repositories") } -func NewTeam(ctx *middleware.Context) { +func NewTeam(ctx *context.Context) { ctx.Data["Title"] = ctx.Org.Organization.FullName ctx.Data["PageIsOrgTeams"] = true ctx.Data["PageIsOrgTeamsNew"] = true @@ -149,7 +149,7 @@ func NewTeam(ctx *middleware.Context) { ctx.HTML(200, TEAM_NEW) } -func NewTeamPost(ctx *middleware.Context, form auth.CreateTeamForm) { +func NewTeamPost(ctx *context.Context, form auth.CreateTeamForm) { ctx.Data["Title"] = ctx.Org.Organization.FullName ctx.Data["PageIsOrgTeams"] = true ctx.Data["PageIsOrgTeamsNew"] = true @@ -195,7 +195,7 @@ func NewTeamPost(ctx *middleware.Context, form auth.CreateTeamForm) { ctx.Redirect(ctx.Org.OrgLink + "/teams/" + t.LowerName) } -func TeamMembers(ctx *middleware.Context) { +func TeamMembers(ctx *context.Context) { ctx.Data["Title"] = ctx.Org.Team.Name ctx.Data["PageIsOrgTeams"] = true if err := ctx.Org.Team.GetMembers(); err != nil { @@ -205,7 +205,7 @@ func TeamMembers(ctx *middleware.Context) { ctx.HTML(200, TEAM_MEMBERS) } -func TeamRepositories(ctx *middleware.Context) { +func TeamRepositories(ctx *context.Context) { ctx.Data["Title"] = ctx.Org.Team.Name ctx.Data["PageIsOrgTeams"] = true if err := ctx.Org.Team.GetRepositories(); err != nil { @@ -215,7 +215,7 @@ func TeamRepositories(ctx *middleware.Context) { ctx.HTML(200, TEAM_REPOSITORIES) } -func EditTeam(ctx *middleware.Context) { +func EditTeam(ctx *context.Context) { ctx.Data["Title"] = ctx.Org.Organization.FullName ctx.Data["PageIsOrgTeams"] = true ctx.Data["team_name"] = ctx.Org.Team.Name @@ -223,7 +223,7 @@ func EditTeam(ctx *middleware.Context) { ctx.HTML(200, TEAM_NEW) } -func EditTeamPost(ctx *middleware.Context, form auth.CreateTeamForm) { +func EditTeamPost(ctx *context.Context, form auth.CreateTeamForm) { t := ctx.Org.Team ctx.Data["Title"] = ctx.Org.Organization.FullName ctx.Data["PageIsOrgTeams"] = true @@ -270,7 +270,7 @@ func EditTeamPost(ctx *middleware.Context, form auth.CreateTeamForm) { ctx.Redirect(ctx.Org.OrgLink + "/teams/" + t.LowerName) } -func DeleteTeam(ctx *middleware.Context) { +func DeleteTeam(ctx *context.Context) { if err := models.DeleteTeam(ctx.Org.Team); err != nil { ctx.Flash.Error("DeleteTeam: " + err.Error()) } else { |