Changed page title format.

This commit is contained in:
Dominik Picheta 2013-08-06 20:18:33 +01:00
commit 341fac7288

View file

@ -667,7 +667,6 @@ get "/postActivity.xml":
get "/t/@threadid/?@page?/?": get "/t/@threadid/?@page?/?":
createTFD() createTFD()
var title = "Nimrod Forum - "
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)
@ -679,6 +678,7 @@ get "/t/@threadid/?@page?/?":
cond validThreadId(c) cond validThreadId(c)
gatherTotalPosts(c) gatherTotalPosts(c)
if (@"action").len > 0: if (@"action").len > 0:
var title = ""
case @"action" case @"action"
of "reply": of "reply":
let subject = GetValue(db, let subject = GetValue(db,
@ -687,7 +687,7 @@ get "/t/@threadid/?@page?/?":
body = genPostsList(c, $c.threadId, count) body = genPostsList(c, $c.threadId, count)
cond count != 0 cond count != 0
body.add genFormPost(c, "doreply", "Reply", subject, "", false) body.add genFormPost(c, "doreply", "Reply", subject, "", false)
title.add("Replying to thread: " & pSubject) title = "Replying to thread: " & pSubject
of "edit": of "edit":
cond c.postId != -1 cond c.postId != -1
const query = sql"select header, content from post where id = ?" const query = sql"select header, content from post where id = ?"
@ -695,13 +695,13 @@ get "/t/@threadid/?@page?/?":
let header = ||row[0] let header = ||row[0]
let content = ||row[1] let content = ||row[1]
body = genFormPost(c, "doedit", "Edit", header, content, true) body = genFormPost(c, "doedit", "Edit", header, content, true)
title.add("Editing post") title = "Editing post"
resp c.genMain(body, title) resp c.genMain(body, title & " - Nimrod Forum")
else: else:
incrementViews(c) incrementViews(c)
let posts = genPostsList(c, $c.threadId, count) let posts = genPostsList(c, $c.threadId, count)
cond count != 0 cond count != 0
resp genMain(c, posts, title & pSubject) resp genMain(c, posts, pSubject & " - Nimrod Forum")
get "/page/@page/?": get "/page/@page/?":
createTFD() createTFD()
@ -713,7 +713,7 @@ get "/page/@page/?":
let list = genThreadsList(c, count) let list = genThreadsList(c, count)
if count == 0: if count == 0:
pass() pass()
resp genMain(c, list, "Nimrod Forum - Page " & $c.pageNum, resp genMain(c, list, "Page " & $c.pageNum & " - Nimrod Forum",
genRSSHeaders(c), showRssLinks = true) genRSSHeaders(c), showRssLinks = true)
get "/profile/@nick/?": get "/profile/@nick/?":
@ -722,13 +722,13 @@ get "/profile/@nick/?":
var userinfo: TUserInfo var userinfo: TUserInfo
if gatherUserInfo(c, @"nick", userinfo): if gatherUserInfo(c, @"nick", userinfo):
resp genMain(c, c.genProfile(userinfo), resp genMain(c, c.genProfile(userinfo),
"Nimrod Forum - " & @"nick" & "'s profile") @"nick" & "'s profile - Nimrod Forum")
else: else:
halt() halt()
get "/login/?": get "/login/?":
createTFD() createTFD()
resp genMain(c, genFormLogin(c), "Nimrod Forum - Log in") resp genMain(c, genFormLogin(c), "Log in - Nimrod Forum")
get "/logout/?": get "/logout/?":
createTFD() createTFD()
@ -737,7 +737,7 @@ get "/logout/?":
get "/register/?": get "/register/?":
createTFD() createTFD()
resp genMain(c, genFormRegister(c), "Nimrod Forum - Register") resp genMain(c, genFormRegister(c), "Register - Nimrod Forum")
template readIDs(): stmt = template readIDs(): stmt =
# Retrieve the threadid, postid and pagenum # Retrieve the threadid, postid and pagenum
@ -804,12 +804,12 @@ post "/doedit":
get "/newthread/?": get "/newthread/?":
createTFD() createTFD()
resp genMain(c, genFormPost(c, "donewthread", "New thread", "", "", false), resp genMain(c, genFormPost(c, "donewthread", "New thread", "", "", false),
"Nimrod Forum - New Thread") "New Thread - Nimrod Forum")
const licenseRst = slurp("static/license.rst") const licenseRst = slurp("static/license.rst")
get "/license": get "/license":
createTFD() createTFD()
resp genMain(c, rstToHtml(licenseRst), "Forum content license") resp genMain(c, rstToHtml(licenseRst), "Content license - Nimrod Forum")
when isMainModule: when isMainModule:
docConfig = rstgen.defaultConfig() docConfig = rstgen.defaultConfig()