Translate newlines to break tags in the machine description.
authorEvan Broder <broder@mit.edu>
Mon, 10 Aug 2009 00:08:33 +0000 (20:08 -0400)
committerEvan Broder <broder@mit.edu>
Mon, 10 Aug 2009 00:08:33 +0000 (20:08 -0400)
svn path=/package_branches/invirt-web/cherrypy-rebased/; revision=2682

code/templates/functions.mako
code/templates/list.mako

index a72648a..4f23635 100644 (file)
@@ -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)">
index e500896..71afd55 100644 (file)
@@ -120,7 +120,7 @@ ${has_vnc[machine]}
 </td>
       </tr>
       <tr>
-        <td colspan="7" style="padding-left: 1em; color: #666">${machine.description}</td>
+        <td colspan="7" style="padding-left: 1em; color: #666">${machine.description|self.fn.module.nl2br}</td>
       </tr>
 </%def>