Skip to content

Commit

Permalink
Jinja use i18n and trim_blocks, plus get_template fix for footer
Browse files Browse the repository at this point in the history
  • Loading branch information
marcus-sonestedt committed Nov 1, 2009
1 parent 82e2d40 commit 58697a6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion buildbot/status/web/base.py
Expand Up @@ -298,7 +298,7 @@ def path_to_root(self, request):

def footer(self, req):
status = self.getStatus(req)
template = req.templates.get_template("footer.html")
template = req.site.buildbot_service.templates.get_template("footer.html")
return template.render(projectURL = status.getProjectURL(),
projectName = status.getProjectName(),
welcomeurl = self.path_to_root(req) + "index.html",
Expand Down
4 changes: 3 additions & 1 deletion buildbot/status/web/baseweb.py
Expand Up @@ -484,7 +484,9 @@ def __init__(self, http_port=None, distrib_port=None, allowForce=False,
root = os.path.join(os.getcwd(), 'templates')
loader = jinja2.ChoiceLoader([jinja2.FileSystemLoader(root),
default_loader])
self.templates = jinja2.Environment(loader=loader)
self.templates = jinja2.Environment(loader=loader,
extensions=['jinja2.ext.i18n'],
trim_blocks=True)

# keep track of cached connections so we can break them when we shut
# down. See ticket #102 for more details.
Expand Down

0 comments on commit 58697a6

Please sign in to comment.