Skip to content

Commit 20e426a

Browse files
committed
Work in progress - template based on jinja2, bootstrap and classic schema
1 parent 28ed352 commit 20e426a

30 files changed

+1716
-5
lines changed

roundup/cgi/engine_jinja2.py

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,31 @@
3232
"""
3333

3434
import jinja2
35+
import gettext
3536

3637
# http://jinja.pocoo.org/docs/api/#loaders
3738

3839
from roundup.cgi.templating import context, LoaderBase, TemplateBase
3940

41+
'''
42+
def get_gettext_translations():
43+
return gettext.find('??')
44+
'''
45+
4046
class Jinja2Loader(LoaderBase):
4147
def __init__(self, dir):
42-
jinjadir = dir + '/jinja2'
43-
# [ ] separate configuration when multiple loaders are used
44-
print "Jinja2 templates:", jinjadir
48+
extensions = [
49+
'jinja2.ext.autoescape',
50+
'jinja2.ext.i18n',
51+
]
52+
print "Jinja2 templates: ", dir
53+
print "Extensions: ", extensions
54+
#translations = get_gettext_translations()
4555
self._env = jinja2.Environment(
46-
loader=jinja2.FileSystemLoader(jinjadir)
56+
loader=jinja2.FileSystemLoader(dir),
57+
extensions=extensions
4758
)
59+
#self._env.install_gettext_translations(translations)
4860

4961
def check(self, tplname):
5062
#print tplname
@@ -91,4 +103,3 @@ def __getattr__(self, name):
91103
# [ ] figure out what are these for
92104
raise NotImplemented
93105
#return getattr(self._pt, name)
94-
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Name: jinja2
2+
Description: This is a generic issue tracker based on classic schema.
3+
It uses Jinja2 for templating and Twitter bootstrap for responsive
4+
markup. You will need jinja and gettext for this to work.
5+
Intended-For: Developers/Fearless first-time roundup users
6+

0 commit comments

Comments
 (0)