Skip to content

Commit

Permalink
app: Fix the url to delete a wikipage.
Browse files Browse the repository at this point in the history
  • Loading branch information
eungjun-yi committed May 15, 2012
1 parent 1e733b2 commit c5ae82b
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ app.get ROOT_PATH+'/pages', wikiApp.getPages # get page list
app.get ROOT_PATH+'/pages/:name', wikiApp.getPage # get a page
app.get ROOT_PATH+'/new', wikiApp.getNew # get a form to post new wikipage
app.post ROOT_PATH+'/pages', wikiApp.postNew # post new wikipage
app.post ROOT_PATH+'/delete/:name', wikiApp.postDelete # delete wikipage
app.del ROOT_PATH+'/pages/:name', wikiApp.postDelete # delete wikipage
app.post '/api/note/pages/:name', wikiApp.postRollback # wikipage rollback

# Login & Logout
Expand Down
3 changes: 2 additions & 1 deletion views/edit.jade
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ block content

div.btn-group
a(href="?").btn View
form(method="post", action="/wikis/note/delete/"+title)
form(method="post", action="/wikis/note/pages/"+title)
input(type="hidden", name="_method", id='_method', value="delete")
input(type="submit", value="delete", name="submit").btn
br
br
Expand Down
3 changes: 2 additions & 1 deletion views/history.jade
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ block content
a(href="?action=edit") Edit
li
a(href="?action=history") History
form(method="post", action="/wikis/note/delete/"+title)
form(method="post", action="/wikis/note/pages/"+title)
input(type="hidden", name="_method", id='_method', value="delete")
input(type="submit", value="delete", name="submit")

script(type="text/javascript", src="http://cdnjs.cloudflare.com/ajax/libs/jquery/1.7.2/jquery.min.js")
Expand Down
3 changes: 2 additions & 1 deletion views/page.jade
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ block content
a(href=urls.history).btn History
div.span1
form(method="post", action=urls.delete)
input(type="hidden", name="_method", id='_method', value="delete")
input(type="submit", value="delete", name="submit").btn

div.row
div.span12
!= content
!= content
2 changes: 1 addition & 1 deletion wikiApp.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ commandUrls = (name) ->
query:
action: 'history',
delete: url.format
pathname: ROOT_PATH + '/delete/' + name,
pathname: ROOT_PATH + '/pages/' + name,

view = (name, req, res) ->
wiki.getPage name, req.query.rev, (err, page) ->
Expand Down

0 comments on commit c5ae82b

Please sign in to comment.