From f434ce1c604006bca6094e894311055581524b0a Mon Sep 17 00:00:00 2001 From: Evan Broder Date: Sun, 9 Aug 2009 20:08:33 -0400 Subject: [PATCH] Translate newlines to break tags in the machine description. svn path=/package_branches/invirt-web/cherrypy-rebased/; revision=2682 --- code/templates/functions.mako | 3 +++ code/templates/list.mako | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) 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} -- 1.7.9.5