X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-web.git/blobdiff_plain/d6a12bd1e32e3f9bc63c2c6f1d2d2793a9eee4d2..2be0969e153ace507ec07b27d156b50e54e00f94:/code/templates/functions.mako
diff --git a/code/templates/functions.mako b/code/templates/functions.mako
index 99c0d30..7b46a35 100644
--- a/code/templates/functions.mako
+++ b/code/templates/functions.mako
@@ -15,19 +15,19 @@ onchange="${onchange}"\
%def>
<%def name="cdromList(default='', onchange=None)">
-${databaseList(sorted(database.CDROM.query(), key=lambda x: x.description),
+${databaseList(sorted(database.CDROM.query, key=lambda x: x.description),
default, onchange, 'cdrom', 'cdromlist', 'cdrom_id', 'description')|n}
%def>
<%def name="autoList(default='', onchange=None)">
-${databaseList(sorted(database.Autoinstall.query(), key=lambda x: x.description),
+${databaseList(sorted(database.Autoinstall.query, key=lambda x: x.description),
default, onchange, 'autoinstall', 'autoinstalllist', 'autoinstall_id', 'description')|n}
%def>
<%def name="vmTypeList(default=None)">
% for vmtype in (('linux-hvm', 'HVM'), ('linux', 'ParaVM'), ):
% endfor
%def>
@@ -39,3 +39,16 @@ ${databaseList(sorted(database.Autoinstall.query(), key=lambda x: x.description)
% endif
%def>
+
+<%!
+def jquote(string):
+ return "'" + string.replace('\\', '\\\\').replace("'", "\\'").replace('\n', '\\n') + "'"
+
+def nl2br(string):
+ return string.replace('\n', '
')
+%>
+
+<%def name="helppopup(subj)">
+## Return HTML code for a (?) link to a specified help topic
+(?)
+%def>