From: Quentin Smith Date: Sun, 9 Aug 2009 22:45:28 +0000 (-0400) Subject: Move the help popup code into the templates where it belongs X-Git-Tag: 0.1.0^2~63 X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-web.git/commitdiff_plain/f6bddba1c55448fae6674bb03838fceb4bd982ba Move the help popup code into the templates where it belongs svn path=/package_branches/invirt-web/cherrypy-rebased/; revision=2672 --- diff --git a/code/main.py b/code/main.py index 17bbd62..ab0d1cd 100755 --- a/code/main.py +++ b/code/main.py @@ -93,16 +93,6 @@ class Checkpoint: checkpoint = Checkpoint() -def jquote(string): - return "'" + string.replace('\\', '\\\\').replace("'", "\\'").replace('\n', '\\n') + "'" - -def helppopup(subj): - """Return HTML code for a (?) link to a specified help topic""" - return ('(?)') - def makeErrorPre(old, addition): if addition is None: return @@ -113,7 +103,6 @@ def makeErrorPre(old, addition): Template.database = database Template.config = config -Template.helppopup = staticmethod(helppopup) Template.err = None class JsonDict: diff --git a/code/templates/functions.mako b/code/templates/functions.mako index 99c0d30..a72648a 100644 --- a/code/templates/functions.mako +++ b/code/templates/functions.mako @@ -39,3 +39,13 @@ ${databaseList(sorted(database.Autoinstall.query(), key=lambda x: x.description) % endif + +<%! +def jquote(string): + return "'" + string.replace('\\', '\\\\').replace("'", "\\'").replace('\n', '\\n') + "'" +%> + +<%def name="helppopup(subj)"> +## Return HTML code for a (?) link to a specified help topic +(?) +