aboutsummaryrefslogtreecommitdiffstats
path: root/routers/repo/wiki.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/wiki.go
parentcb1eadc2768ea5ffb2967eb4262e96730c3f9ba5 (diff)
downloadgitea-514382e2ebfe6869268aeb919c1fa4d224687e13.tar.gz
gitea-514382e2ebfe6869268aeb919c1fa4d224687e13.zip
Rename module: middleware -> context
Diffstat (limited to 'routers/repo/wiki.go')
-rw-r--r--routers/repo/wiki.go20
1 files changed, 10 insertions, 10 deletions
diff --git a/routers/repo/wiki.go b/routers/repo/wiki.go
index 4975080d20..e0b3e692c1 100644
--- a/routers/repo/wiki.go
+++ b/routers/repo/wiki.go
@@ -14,8 +14,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/markdown"
- "github.com/gogits/gogs/modules/middleware"
)
const (
@@ -25,7 +25,7 @@ const (
WIKI_PAGES base.TplName = "repo/wiki/pages"
)
-func MustEnableWiki(ctx *middleware.Context) {
+func MustEnableWiki(ctx *context.Context) {
if !ctx.Repo.Repository.EnableWiki {
ctx.Handle(404, "MustEnableWiki", nil)
return
@@ -43,7 +43,7 @@ type PageMeta struct {
Updated time.Time
}
-func renderWikiPage(ctx *middleware.Context, isViewPage bool) (*git.Repository, string) {
+func renderWikiPage(ctx *context.Context, isViewPage bool) (*git.Repository, string) {
wikiRepo, err := git.OpenRepository(ctx.Repo.Repository.WikiPath())
if err != nil {
ctx.Handle(500, "OpenRepository", err)
@@ -115,7 +115,7 @@ func renderWikiPage(ctx *middleware.Context, isViewPage bool) (*git.Repository,
return wikiRepo, pageName
}
-func Wiki(ctx *middleware.Context) {
+func Wiki(ctx *context.Context) {
ctx.Data["PageIsWiki"] = true
if !ctx.Repo.Repository.HasWiki() {
@@ -140,7 +140,7 @@ func Wiki(ctx *middleware.Context) {
ctx.HTML(200, WIKI_VIEW)
}
-func WikiPages(ctx *middleware.Context) {
+func WikiPages(ctx *context.Context) {
ctx.Data["Title"] = ctx.Tr("repo.wiki.pages")
ctx.Data["PageIsWiki"] = true
@@ -186,7 +186,7 @@ func WikiPages(ctx *middleware.Context) {
ctx.HTML(200, WIKI_PAGES)
}
-func NewWiki(ctx *middleware.Context) {
+func NewWiki(ctx *context.Context) {
ctx.Data["Title"] = ctx.Tr("repo.wiki.new_page")
ctx.Data["PageIsWiki"] = true
ctx.Data["RequireSimpleMDE"] = true
@@ -198,7 +198,7 @@ func NewWiki(ctx *middleware.Context) {
ctx.HTML(200, WIKI_NEW)
}
-func NewWikiPost(ctx *middleware.Context, form auth.NewWikiForm) {
+func NewWikiPost(ctx *context.Context, form auth.NewWikiForm) {
ctx.Data["Title"] = ctx.Tr("repo.wiki.new_page")
ctx.Data["PageIsWiki"] = true
ctx.Data["RequireSimpleMDE"] = true
@@ -221,7 +221,7 @@ func NewWikiPost(ctx *middleware.Context, form auth.NewWikiForm) {
ctx.Redirect(ctx.Repo.RepoLink + "/wiki/" + models.ToWikiPageURL(form.Title))
}
-func EditWiki(ctx *middleware.Context) {
+func EditWiki(ctx *context.Context) {
ctx.Data["PageIsWiki"] = true
ctx.Data["PageIsWikiEdit"] = true
ctx.Data["RequireSimpleMDE"] = true
@@ -239,7 +239,7 @@ func EditWiki(ctx *middleware.Context) {
ctx.HTML(200, WIKI_NEW)
}
-func EditWikiPost(ctx *middleware.Context, form auth.NewWikiForm) {
+func EditWikiPost(ctx *context.Context, form auth.NewWikiForm) {
ctx.Data["Title"] = ctx.Tr("repo.wiki.new_page")
ctx.Data["PageIsWiki"] = true
ctx.Data["RequireSimpleMDE"] = true
@@ -257,7 +257,7 @@ func EditWikiPost(ctx *middleware.Context, form auth.NewWikiForm) {
ctx.Redirect(ctx.Repo.RepoLink + "/wiki/" + models.ToWikiPageURL(form.Title))
}
-func DeleteWikiPagePost(ctx *middleware.Context) {
+func DeleteWikiPagePost(ctx *context.Context) {
pageURL := ctx.Params(":page")
if len(pageURL) == 0 {
pageURL = "Home"