summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Bruhin <git@the-compiler.org>2012-10-19 13:37:41 +0200
committerFlorian Bruhin <git@the-compiler.org>2012-10-19 13:37:41 +0200
commit1aa00a10181cbaadc81c8b8e91f0abbc82487e6d (patch)
tree0e4943fde545114cf6c77b0c6de000690c525b22
parent27f95f74782bfbf69dc099529a3b816aebb24552 (diff)
downloadnpc-1aa00a10181cbaadc81c8b8e91f0abbc82487e6d.tar.gz
npc-1aa00a10181cbaadc81c8b8e91f0abbc82487e6d.zip
Add HTML_FOOTER everywhere
-rwxr-xr-xnpc.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/npc.py b/npc.py
index 865ffe1..b26b721 100755
--- a/npc.py
+++ b/npc.py
@@ -117,6 +117,7 @@ def vote(db):
html += '<a href="/">Go back</a>\n'
html += '</span>\n' # desc
html += '</span>\n' # task
+ html += HTML_FOOTER
return html
if db.query(Users).filter_by(ip=ip).all():
html += '<span class="task">\n'
@@ -125,6 +126,7 @@ def vote(db):
html += '<a href="/">Go back</a>\n'
html += '</span>\n' # desc
html += '</span>\n' # task
+ html += HTML_FOOTER
return html
try:
db.query(Langs).filter_by(lang_id=lang_id).one()
@@ -136,6 +138,7 @@ def vote(db):
html += '<a href="/">Go back</a>\n'
html += '</span>\n' # desc
html += '</span>\n' # task
+ html += HTML_FOOTER
return html
if not task_db.show:
html += '<span class="task">\n'
@@ -144,6 +147,7 @@ def vote(db):
html += '<a href="/">Go back</a>\n'
html += '</span>\n' # desc
html += '</span>\n' # task
+ html += HTML_FOOTER
return html
if task_db.vote_done:
html += '<span class="task">\n'
@@ -152,6 +156,7 @@ def vote(db):
html += '<a href="/">Go back</a>\n'
html += '</span>\n' # desc
html += '</span>\n' # task
+ html += HTML_FOOTER
return html
for lang in db.query(Langs):
if not db.query(Pastes).filter_by(task_id=task_id,
@@ -163,6 +168,7 @@ def vote(db):
html += '<a href="/">Go back</a>\n'
html += '</span>\n' # desc
html += '</span>\n' # task
+ html += HTML_FOOTER
return html
newvote = Votes(ip=ip, lang_id=lang_id, task_id=task_id)
session = create_session()
@@ -177,6 +183,7 @@ def vote(db):
html += '<a href="/">Go back</a>\n'
html += '</span>\n' # desc
html += '</span>\n' # task
+ html += HTML_FOOTER
return html
else:
redirect('/')
@@ -195,6 +202,7 @@ def getvotes(db):
html += '<a href="/">Go back</a>\n'
html += '</span>\n' # desc
html += '</span>\n' # task
+ html += HTML_FOOTER
return html
try:
task = db.query(Tasks).filter_by(task_id=task_id).one()
@@ -205,6 +213,7 @@ def getvotes(db):
html += '<a href="/">go back</a>\n'
html += '</span>\n' # desc
html += '</span>\n' # task
+ html += HTML_FOOTER
return html
if not task.show:
html += '<span class="task">\n'
@@ -213,6 +222,7 @@ def getvotes(db):
html += '<a href="/">Go back</a>\n'
html += '</span>\n' # desc
html += '</span>\n' # task
+ html += HTML_FOOTER
return html
if not task.vote_done:
html += '<span class="task">\n'
@@ -221,6 +231,7 @@ def getvotes(db):
html += '<a href="/">go back</a>\n'
html += '</span>\n' # desc
html += '</span>\n' # task
+ html += HTML_FOOTER
return html
html += '<span class="tasklist voteresult">\n'
html += '<span class="task">\n'
@@ -271,6 +282,7 @@ def submit_get(db):
html += '<a href="/">Go back</a>\n'
html += '</span>\n' # desc
html += '</span>\n' # task
+ html += HTML_FOOTER
return html
try:
lang_db = db.query(Langs).filter_by(lang_id=lang_id).one()
@@ -282,6 +294,7 @@ def submit_get(db):
html += '<a href="/">go back</a>\n'
html += '</span>\n' # desc
html += '</span>\n' # task
+ html += HTML_FOOTER
return html
lang_cm = lang_db.codemirror
cm_deps = lang_db.codemirror_deps
@@ -341,6 +354,7 @@ def submit_post(db):
html += '<a href="/">Go back</a>\n'
html += '</span>\n' # desc
html += '</span>\n' # task
+ html += HTML_FOOTER
return html
if str(user.lang_id) != lang_id:
html += '<span class="task">\n'
@@ -350,6 +364,7 @@ def submit_post(db):
html += '<a href="/">Go back</a>\n'
html += '</span>\n' # desc
html += '</span>\n' # task
+ html += HTML_FOOTER
return html
try:
db.query(Langs).filter_by(lang_id=lang_id).one()
@@ -361,6 +376,7 @@ def submit_post(db):
html += '<a href="/">Go back</a>\n'
html += '</span>\n' # desc
html += '</span>\n' # task
+ html += HTML_FOOTER
return html
if not task_db.show:
html += '<span class="task">\n'
@@ -369,6 +385,7 @@ def submit_post(db):
html += '<a href="/">Go back</a>\n'
html += '</span>\n' # desc
html += '</span>\n' # task
+ html += HTML_FOOTER
return html
paste = Pastes(lang_id=lang_id, task_id=task_id, paste=text)
try:
@@ -407,6 +424,7 @@ def get_source(db):
html += '<a href="/">Go back</a>\n'
html += '</span>\n' # desc
html += '</span>\n' # task
+ html += HTML_FOOTER
return html
try:
lang_db = db.query(Langs).filter_by(lang_id=lang_id).one()
@@ -418,6 +436,7 @@ def get_source(db):
html += '<a href="/">Go back</a>\n'
html += '</span>\n' # desc
html += '</span>\n' # task
+ html += HTML_FOOTER
return html
if not task_db.show:
html += '<span class="task">\n'
@@ -426,6 +445,7 @@ def get_source(db):
html += '<a href="/">Go back</a>\n'
html += '</span>\n' # desc
html += '</span>\n' # task
+ html += HTML_FOOTER
return html
if text:
text = text[0].paste
@@ -487,6 +507,7 @@ def signup(db):
html += '<span class="desc">\n'
html += '<p>Error: This language does not exist!</p>\n'
html += '<a href="/">go back</a>\n'
+ html += HTML_FOOTER
return html
session = create_session()
user = Users(ip=ip, lang_id=signup_lang)
@@ -508,6 +529,7 @@ def signup(db):
html += '<a href="/">go back</a>\n'
html += '</span>\n' # desc
html += '</span>\n' # task
+ html += HTML_FOOTER
return html
for lang in langs:
if not db.query(Users).filter_by(lang_id=lang.lang_id).all():
@@ -624,6 +646,7 @@ def new_post(db):
html += '<a href="/">Go back</a>\n'
html += '</span>\n' # desc
html += '</span>\n' # task
+ html += HTML_FOOTER
return html
task = Tasks(name=title, desc=desc, show=0, vote_done=0)
db.add(task)
@@ -633,6 +656,7 @@ def new_post(db):
html += '<a href="/">Go back</a>\n'
html += '</span>\n' # desc
html += '</span>\n' # task
+ html += HTML_FOOTER
return html
@route('/static/<filename>')