4
from turbozpt.template import PageTemplate
4
from turbozpt.template import zpt
6
6
_base = os.path.dirname(__file__)
8
return PageTemplate(os.path.join(_base, 'templates', name + '.pt'))
8
return zpt(os.path.join(_base, 'templates', name + '.pt'))
11
11
def file_change_summary(url, entry, links=True):
12
return _pt('revisionfilechanges').render(
13
dict(url=url, entry=entry, links=links))
12
return _pt('revisionfilechanges')(url=url, entry=entry, links=links)
15
14
def revisioninfo(url, branch, entry, includefilechanges=False):
16
15
from loggerhead import util
17
return _pt('revisioninfo').render(
18
dict(url=url, change=entry, branch=branch, util=util,
19
includefilechanges=includefilechanges,
20
file_change_summary=file_change_summary))
16
return _pt('revisioninfo')(
17
url=url, change=entry, branch=branch, util=util,
18
includefilechanges=includefilechanges,
19
file_change_summary=file_change_summary)
23
22
def collapse_button(group, name, normal='block'):
24
return _pt('collapse-button').render(
25
dict(group=group, name=name, normal=normal, tg=turbogears))
23
return _pt('collapse-button')(
24
group=group, name=name, normal=normal, tg=turbogears)
27
26
def collapse_all_button(group, normal='block'):
28
return _pt('collapse-all-button').render(
29
dict(group=group, normal=normal, tg=turbogears))
27
return _pt('collapse-all-button')(
28
group=group, normal=normal, tg=turbogears)
31
30
templatefunctions = {'file_change_summary':file_change_summary,
32
31
'revisioninfo':revisioninfo,