Don't escape a string in one of the Mako templates.
[invirt/packages/invirt-web.git] / code / templates / functions.mako
index a72648a..068401f 100644 (file)
@@ -27,7 +27,7 @@ ${databaseList(sorted(database.Autoinstall.query(), key=lambda x: x.description)
 <%def name="vmTypeList(default=None)">
 % for vmtype in (('linux-hvm', 'HVM'), ('linux', 'ParaVM'), ):
 <label>
-   <input ${'checked="checked"' if default == vmtype[0] else ''} type="radio" name="vmtype" id="vmtype-${vmtype[0]}" value="${vmtype[0]}">${vmtype[1]}</input>
+   <input ${'checked="checked"' if default == vmtype[0] else '' | n} type="radio" name="vmtype" id="vmtype-${vmtype[0]}" value="${vmtype[0]}">${vmtype[1]}</input>
 </label>
 % endfor
 </%def>
@@ -43,6 +43,9 @@ ${databaseList(sorted(database.Autoinstall.query(), key=lambda x: x.description)
 <%!
 def jquote(string):
     return "'" + string.replace('\\', '\\\\').replace("'", "\\'").replace('\n', '\\n') + "'"
+
+def nl2br(string):
+    return string.replace('\n', '<br/>')
 %>
 
 <%def name="helppopup(subj)">