author | Tero Marttila <terom@fixme.fi> |
Sat, 07 Feb 2009 17:14:01 +0200 | |
branch | sites |
changeset 35 | 79ea0e2a6cc2 |
parent 29 | b06ff4c05d42 |
child 42 | 5a72c00c4ae4 |
permissions | -rw-r--r-- |
""" Helper functions for use in templates """ import time import config def now () : """ Returns the current date/time """ return time.strftime(config.DATETIME_FMT) def copyright_year () : """ Returns the current year """ return time.strftime("%Y") def breadcrumb (trail, links=True) : """ Returns a nicely formatted breadcrumb tail, optinally with links """ return ' » '.join( ( '<a href="$site_url/%s">%s</a>' % (page.url, page.title) if links else page.title ) for page in trail )