Allow link to extra notes page, sort comments by chapter if applicable

This commit is contained in:
mez 2025-08-02 20:01:15 +01:00
parent a66d108921
commit 761bfe0672
2 changed files with 17 additions and 0 deletions

16
new.py
View file

@ -107,6 +107,10 @@ while ficcount > 0:
ficdict["summary"] = fileread.summary
except:
pass
try:
ficdict["extralink"] = fileread.extralink
except:
pass
try:
if fileread.eventname == "bethefirst":
ficdict["event"] = "Be The First"
@ -254,6 +258,10 @@ while ficcount > 0:
ficdict["comments"] = False
except:
ficdict["comments"] = False
try:
ficdict["comments"] = sorted(ficdict["comments"],key=lambda d: d["chapter"])
except:
pass
try:
ficdict["cssoverride"] = fileread.cssoverride
except:
@ -615,6 +623,10 @@ for fic in ficlist:
ficpage.write(" version: <a href=\"/fic/" + stringno(fic["transid"]) + "\">" + stringno(fic["transid"]) + "</a></li>")
except:
pass
try:
ficpage.write("\n<li>See <a href=\"" + fic["extralink"] + "\">here</a> for additional notes.</li>")
except:
pass
allowcomments = False
havecomments = False
commentlink = False
@ -824,6 +836,10 @@ for fic in ficlist:
elif fic["french"] == "translation":
transpage.write("English")
transpage.write(" version: <a href=\"/fic/" + stringno(fic["id"]) + "\">" + stringno(fic["id"]) + "</a></li>")
try:
transpage.write("\n<li>See <a href=\"" + fic["extralink"] + "\">here</a> for additional notes.</li>")
except:
pass
allowcomments = False
havecomments = False
commentlink = False

View file

@ -17,6 +17,7 @@ fandom = [""]
genre = [""] # ship category comes first, 1 more is displayed
warnstring = 9000000000 # 9 is a dummy; then sex (0–3), death, mental health, bigotry, vomiting, consent, underage, incest, amputation (all others being 0–2)
# summary = ""
# extralink = ""
# event = "" # challenge (including fests; anything without a specific prompt), ao3exchange, exchange, prompt
# eventname = ""
# prompt = ""