From 8de68a6a0d027a86205cab0c078230e9391496d5 Mon Sep 17 00:00:00 2001 From: René 'Necoro' Neumann Date: Tue, 10 Jan 2012 22:33:20 +0100 Subject: Added colorize function to templates --- templates/page.mako | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'templates/page.mako') diff --git a/templates/page.mako b/templates/page.mako index e08207c..bc52c7f 100644 --- a/templates/page.mako +++ b/templates/page.mako @@ -23,3 +23,15 @@ ${next.body()} +<%def name="colorize(fgcolor=None, bgcolor=None, tag='span')"> + % if fgcolor is None and bgcolor is None: + ${caller.body()} + % else: + <% + style = "" + if fgcolor is not None: style += " color: " + fgcolor + if bgcolor is not None: style += " background: "+ bgcolor + %> + <${tag} style="${style}">${caller.body()} + % endif + -- cgit v1.2.3-70-g09d2