summaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-05-05 21:36:08 -0400
committerUnknown <joe2010xtmf@163.com>2014-05-05 21:36:08 -0400
commit94bccbb148a4ed897eb8332fc746aa75486c5c4d (patch)
treed731481cd20e375bb62c420abdadf788db02feda /cmd
parent24f614f6db13e5c6720efa518641ffcdcb0d8947 (diff)
downloadgitea-94bccbb148a4ed897eb8332fc746aa75486c5c4d.tar.gz
gitea-94bccbb148a4ed897eb8332fc746aa75486c5c4d.zip
Finish edit and remove web hook
Diffstat (limited to 'cmd')
-rw-r--r--cmd/web.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/cmd/web.go b/cmd/web.go
index be489c1be4..74da86d40e 100644
--- a/cmd/web.go
+++ b/cmd/web.go
@@ -165,21 +165,22 @@ func runWeb(*cli.Context) {
m.Get("/template/**", dev.TemplatePreview)
}
- reqOwner := middleware.RequireOwner
+ reqOwner := middleware.RequireOwner()
m.Group("/:username/:reponame", func(r martini.Router) {
r.Get("/settings", repo.Setting)
r.Post("/settings", bindIgnErr(auth.RepoSettingForm{}), repo.SettingPost)
r.Get("/settings/collaboration", repo.Collaboration)
r.Post("/settings/collaboration", repo.CollaborationPost)
- r.Get("/settings/hooks", repo.WebHooks) // TODO
+ r.Get("/settings/hooks", repo.WebHooks)
r.Get("/settings/hooks/add", repo.WebHooksAdd)
r.Post("/settings/hooks/add", bindIgnErr(auth.NewWebhookForm{}), repo.WebHooksAddPost)
- r.Get("/settings/hooks/id", repo.WebHooksEdit)
- }, reqSignIn, middleware.RepoAssignment(true), reqOwner())
+ r.Get("/settings/hooks/:id", repo.WebHooksEdit)
+ r.Post("/settings/hooks/:id", bindIgnErr(auth.NewWebhookForm{}), repo.WebHooksEditPost)
+ }, reqSignIn, middleware.RepoAssignment(true), reqOwner)
m.Group("/:username/:reponame", func(r martini.Router) {
- r.Get("/action/:action", repo.Action)
+ r.Get("/action/:action", repo.Action) // TODO
r.Get("/issues/new", repo.CreateIssue)
r.Post("/issues/new", bindIgnErr(auth.CreateIssueForm{}), repo.CreateIssuePost)
r.Post("/issues/:index", bindIgnErr(auth.CreateIssueForm{}), repo.UpdateIssue)