Fixes RSS regression.

This commit is contained in:
Dominik Picheta 2018-05-20 23:15:35 +01:00
commit 1aadce71dc
2 changed files with 12 additions and 10 deletions

View file

@ -1305,9 +1305,6 @@ routes:
) )
resp content.rstToHtml() resp content.rstToHtml()
get re"/(.+)?":
resp readFile("public/karax.html")
get "/threadActivity.xml": get "/threadActivity.xml":
createTFD() createTFD()
resp genThreadsRSS(c), "application/atom+xml" resp genThreadsRSS(c), "application/atom+xml"
@ -1316,6 +1313,10 @@ routes:
createTFD() createTFD()
resp genPostsRSS(c), "application/atom+xml" resp genPostsRSS(c), "application/atom+xml"
get re"/(.+)?":
resp readFile("public/karax.html")
get "/activateEmail/?": get "/activateEmail/?":
createTFD() createTFD()
cond(@"nick" != "") cond(@"nick" != "")

View file

@ -32,7 +32,7 @@
# ORDER BY modified DESC LIMIT 1""") # ORDER BY modified DESC LIMIT 1""")
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"> <feed xmlns="http://www.w3.org/2005/Atom">
<title>Nim forum thread activity</title> <title>${config.name} thread activity</title>
<link href="${c.req.makeUri("/threadActivity.xml")}" rel="self" /> <link href="${c.req.makeUri("/threadActivity.xml")}" rel="self" />
<link href="${frontQuery}" /> <link href="${frontQuery}" />
<id>${frontQuery}</id> <id>${frontQuery}</id>
@ -60,13 +60,14 @@ ${xmlEncode(rstToHtml(!postContent))}</content>
# #
#proc genPostsRSS(c: TForumData): string = #proc genPostsRSS(c: TForumData): string =
# result = "" # result = ""
# const query = sql"""SELECT A.id, B.name, A.content, A.thread, # const query = sql"""SELECT A.id, B.name, A.content, A.thread, T.name,
# A.header, strftime('%Y-%m-%dT%H:%M:%SZ', A.creation), # strftime('%Y-%m-%dT%H:%M:%SZ', A.creation),
# A.creation, COUNT(C.id) # A.creation, COUNT(C.id)
# FROM post AS A, person AS B, post AS C # FROM post AS A, person AS B, post AS C, thread AS T
# WHERE A.author = B.id AND A.thread = C.thread AND C.id <= A.id # WHERE A.author = B.id AND A.thread = C.thread AND C.id <= A.id
# AND T.id = A.thread
# GROUP BY A.id # GROUP BY A.id
# ORDER BY A.creation DESC LIMIT ?""" # ORDER BY A.creation DESC LIMIT 10"""
# const postId = 0 # const postId = 0
# const postAuthor = 1 # const postAuthor = 1
# const postContent = 2 # const postContent = 2
@ -81,12 +82,12 @@ ${xmlEncode(rstToHtml(!postContent))}</content>
# ORDER BY creation DESC LIMIT 1""") # ORDER BY creation DESC LIMIT 1""")
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"> <feed xmlns="http://www.w3.org/2005/Atom">
<title>Nim forum post activity</title> <title>${config.name} post activity</title>
<link href="${c.req.makeUri("/postActivity.xml")}" rel="self" /> <link href="${c.req.makeUri("/postActivity.xml")}" rel="self" />
<link href="${frontQuery}" /> <link href="${frontQuery}" />
<id>${frontQuery}</id> <id>${frontQuery}</id>
<updated>${recent}</updated> <updated>${recent}</updated>
# for row in rows(db, query, 10): # for row in rows(db, query):
<entry> <entry>
<title>${xmlEncode(!postHeader)}</title> <title>${xmlEncode(!postHeader)}</title>
<id>urn:entry:${!postId}</id> <id>urn:entry:${!postId}</id>