summaryrefslogtreecommitdiff
path: root/templates/page.mako
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2012-01-10 22:33:20 +0100
committerRené 'Necoro' Neumann <necoro@necoro.net>2012-01-10 22:33:20 +0100
commit8de68a6a0d027a86205cab0c078230e9391496d5 (patch)
tree4ac0c5220f666746caeeff8cc8cf950b5f3040ea /templates/page.mako
parent9b5a3dce00b2c021362919c5509b38413baec133 (diff)
downloadkosten-8de68a6a0d027a86205cab0c078230e9391496d5.tar.gz
kosten-8de68a6a0d027a86205cab0c078230e9391496d5.tar.bz2
kosten-8de68a6a0d027a86205cab0c078230e9391496d5.zip
Added colorize function to templates
Diffstat (limited to 'templates/page.mako')
-rw-r--r--templates/page.mako12
1 files changed, 12 insertions, 0 deletions
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()}
</a>
</%def>
+<%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()}</${tag}>
+ % endif
+</%def>