author | Tero Marttila <terom@fixme.fi> |
Sat, 07 Feb 2009 05:12:57 +0200 | |
changeset 28 | b68145b5ce24 |
parent 26 | 9d3beac1b196 |
child 29 | b06ff4c05d42 |
permissions | -rw-r--r-- |
26
9d3beac1b196
remove foo.html page, and rice up the footer a bit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
1 |
""" |
9d3beac1b196
remove foo.html page, and rice up the footer a bit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
2 |
Helper functions for use in templates |
9d3beac1b196
remove foo.html page, and rice up the footer a bit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
3 |
""" |
9d3beac1b196
remove foo.html page, and rice up the footer a bit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
4 |
|
9d3beac1b196
remove foo.html page, and rice up the footer a bit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
5 |
import time |
9d3beac1b196
remove foo.html page, and rice up the footer a bit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
6 |
|
9d3beac1b196
remove foo.html page, and rice up the footer a bit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
7 |
import config |
9d3beac1b196
remove foo.html page, and rice up the footer a bit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
8 |
|
9d3beac1b196
remove foo.html page, and rice up the footer a bit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
9 |
def now () : |
9d3beac1b196
remove foo.html page, and rice up the footer a bit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
10 |
""" |
9d3beac1b196
remove foo.html page, and rice up the footer a bit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
11 |
Returns the current date/time |
9d3beac1b196
remove foo.html page, and rice up the footer a bit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
12 |
""" |
9d3beac1b196
remove foo.html page, and rice up the footer a bit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
13 |
|
9d3beac1b196
remove foo.html page, and rice up the footer a bit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
14 |
return time.strftime(config.DATETIME_FMT) |
9d3beac1b196
remove foo.html page, and rice up the footer a bit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
15 |
|
28 | 16 |
def breadcrumb (trail, links=True) : |
17 |
""" |
|
18 |
Returns a nicely formatted breadcrumb tail, optinally with links |
|
19 |
""" |
|
20 |
||
21 |
return ' » '.join( |
|
22 |
( |
|
23 |
'<a href="$site_url/%s">%s</a>' % (page.url, page.title) if links else page.title |
|
24 |
) for page in trail |
|
25 |
) |
|
26 |