Fixes editing posts.
This commit is contained in:
parent
58dc6bfcec
commit
6e3c746664
1 changed files with 6 additions and 2 deletions
|
|
@ -118,6 +118,8 @@ proc genThreadUrl(c: TForumData, postId = "", action = "", threadid = "", pageNu
|
||||||
result.add("/" & pageNum)
|
result.add("/" & pageNum)
|
||||||
if action != "":
|
if action != "":
|
||||||
result.add("?action=" & action)
|
result.add("?action=" & action)
|
||||||
|
if postId != "":
|
||||||
|
result.add("&postid=" & postid)
|
||||||
elif postId != "":
|
elif postId != "":
|
||||||
result.add("#" & postId)
|
result.add("#" & postId)
|
||||||
result = c.req.makeUri(result, absolute = false)
|
result = c.req.makeUri(result, absolute = false)
|
||||||
|
|
@ -718,11 +720,13 @@ routes:
|
||||||
createTFD()
|
createTFD()
|
||||||
resp genPostsRSS(c), "application/atom+xml"
|
resp genPostsRSS(c), "application/atom+xml"
|
||||||
|
|
||||||
get "/t/@threadid/?@page?/?":
|
get "/t/@threadid/?@page?/?@postid?/?":
|
||||||
createTFD()
|
createTFD()
|
||||||
parseInt(@"threadid", c.threadId, -1..1000_000)
|
parseInt(@"threadid", c.threadId, -1..1000_000)
|
||||||
if @"page".len > 0:
|
if @"page".len > 0:
|
||||||
parseInt(@"page", c.pageNum, 0..1000_000)
|
parseInt(@"page", c.pageNum, 0..1000_000)
|
||||||
|
if @"postid".len > 0:
|
||||||
|
parseInt(@"postid", c.postId, 0..1000_000)
|
||||||
cond (c.pageNum > 0)
|
cond (c.pageNum > 0)
|
||||||
var count = 0
|
var count = 0
|
||||||
var pSubject = getThreadTitle(c.threadid, c.pageNum)
|
var pSubject = getThreadTitle(c.threadid, c.pageNum)
|
||||||
|
|
@ -854,7 +858,7 @@ routes:
|
||||||
createTFD()
|
createTFD()
|
||||||
readIDs()
|
readIDs()
|
||||||
if edit(c, c.postId):
|
if edit(c, c.postId):
|
||||||
redirect(c.genThreadUrl(pageNum = "0", postId = $c.postId))
|
redirect(c.genThreadUrl(postId = $c.postId))
|
||||||
else:
|
else:
|
||||||
body = ""
|
body = ""
|
||||||
handleError("doedit", "Edit", true)
|
handleError("doedit", "Edit", true)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue