Update the cherrypy branch to use authz.afs.cells instead of just
[invirt/packages/invirt-web.git] / code / templates / functions.mako
index 99c0d30..4f23635 100644 (file)
@@ -39,3 +39,16 @@ ${databaseList(sorted(database.Autoinstall.query(), key=lambda x: x.description)
 </tr>
 % endif
 </%def>
+
+<%!
+def jquote(string):
+    return "'" + string.replace('\\', '\\\\').replace("'", "\\'").replace('\n', '\\n') + "'"
+
+def nl2br(string):
+    return string.replace('\n', '<br/>')
+%>
+
+<%def name="helppopup(subj)">
+## Return HTML code for a (?) link to a specified help topic
+<span class="helplink"><a href="help?simple=true;subject=${subj | u}" target="_blank" onclick="return helppopup(${subj | u,jquote})">(?)</a></span>
+</%def>