From: Evan Broder Date: Mon, 10 Aug 2009 00:08:33 +0000 (-0400) Subject: Translate newlines to break tags in the machine description. X-Git-Tag: 0.1.0^2~53 X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-web.git/commitdiff_plain/f434ce1c604006bca6094e894311055581524b0a Translate newlines to break tags in the machine description. svn path=/package_branches/invirt-web/cherrypy-rebased/; revision=2682 --- diff --git a/code/templates/functions.mako b/code/templates/functions.mako index a72648a..4f23635 100644 --- a/code/templates/functions.mako +++ b/code/templates/functions.mako @@ -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', '
') %> <%def name="helppopup(subj)"> diff --git a/code/templates/list.mako b/code/templates/list.mako index e500896..71afd55 100644 --- a/code/templates/list.mako +++ b/code/templates/list.mako @@ -120,7 +120,7 @@ ${has_vnc[machine]} - ${machine.description} + ${machine.description|self.fn.module.nl2br}