improve /template/render/

This commit is contained in:
Martijn Voncken 2008-07-22 18:24:42 +00:00
parent c5be051136
commit 498fbab03a
1 changed files with 4 additions and 5 deletions

View File

@ -390,15 +390,14 @@ class template_static(static_handler):
'templates/%s/static' % config.get('template')) 'templates/%s/static' % config.get('template'))
route("/template/static/(.*)", template_static) route("/template/static/(.*)", template_static)
class render_static: class template_render:
"render anything in template_dir" "render anything in /render/ dir"
@deco.deluge_page @deco.deluge_page
def GET(self, name): def GET(self, name):
filename = os.path.join(os.path.dirname(__file__), filename = os.path.join(os.path.dirname(__file__),
'templates/%s/static/%s' % (config.get('template'), name)) 'templates/%s/render/%s' % (config.get('template'), name))
log.debug("render-static:%s" % filename)
return web.template.Template(open(filename).read(), filename=filename)() return web.template.Template(open(filename).read(), filename=filename)()
route("/template/render/(.*)", render_static) route("/template/render/(.*)", template_render)
class template_style: class template_style:
def GET(self): def GET(self):