Browse Source

Update delete wiki page route

pull/2746/head
Josh Frye 9 years ago
parent
commit
2f228ddf31
  1. 2
      cmd/web.go
  2. 2
      templates/repo/wiki/view.tmpl

2
cmd/web.go

@ -495,7 +495,7 @@ func runWeb(ctx *cli.Context) {
Post(bindIgnErr(auth.NewWikiForm{}), repo.NewWikiPost) Post(bindIgnErr(auth.NewWikiForm{}), repo.NewWikiPost)
m.Combo("/:page/_edit").Get(repo.EditWiki). m.Combo("/:page/_edit").Get(repo.EditWiki).
Post(bindIgnErr(auth.NewWikiForm{}), repo.EditWikiPost) Post(bindIgnErr(auth.NewWikiForm{}), repo.EditWikiPost)
m.Post("/:page", bindIgnErr(auth.NewWikiForm{}), repo.DeleteWikiPagePost) m.Post("/:page/delete", bindIgnErr(auth.NewWikiForm{}), repo.DeleteWikiPagePost)
}, reqSignIn, reqRepoPusher) }, reqSignIn, reqRepoPusher)
}, repo.MustEnableWiki, middleware.RepoRef()) }, repo.MustEnableWiki, middleware.RepoRef())

2
templates/repo/wiki/view.tmpl

@ -50,7 +50,7 @@
<div class="ui right"> <div class="ui right">
<a class="ui small button" href="{{.RepoLink}}/wiki/{{.PageURL}}/_edit">{{.i18n.Tr "repo.wiki.edit_page_button"}}</a> <a class="ui small button" href="{{.RepoLink}}/wiki/{{.PageURL}}/_edit">{{.i18n.Tr "repo.wiki.edit_page_button"}}</a>
<a class="ui green small button" href="{{.RepoLink}}/wiki/_new">{{.i18n.Tr "repo.wiki.new_page_button"}}</a> <a class="ui green small button" href="{{.RepoLink}}/wiki/_new">{{.i18n.Tr "repo.wiki.new_page_button"}}</a>
<a class="ui red small button delete-button" href="" data-url="{{.RepoLink}}/wiki/{{.PageURL}}/" data-id="{{.PageURL}}">{{.i18n.Tr "repo.wiki.delete_page_button"}}</a> <a class="ui red small button delete-button" href="" data-url="{{.RepoLink}}/wiki/{{.PageURL}}/delete" data-id="{{.PageURL}}">{{.i18n.Tr "repo.wiki.delete_page_button"}}</a>
</div> </div>
{{end}} {{end}}
<div class="ui sub header"> <div class="ui sub header">

Loading…
Cancel
Save