summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
Diffstat (limited to 'module')
-rw-r--r--module/web/utils.py4
-rw-r--r--module/web/webinterface.py7
2 files changed, 6 insertions, 5 deletions
diff --git a/module/web/utils.py b/module/web/utils.py
index cf3f2d5f3..d7e76f84d 100644
--- a/module/web/utils.py
+++ b/module/web/utils.py
@@ -16,8 +16,6 @@
@author: RaNaN
"""
-from os.path import join, abspath, commonprefix
-
from bottle import request, HTTPError, redirect, ServerAdapter
from webinterface import env, TEMPLATE
@@ -26,7 +24,7 @@ def render_to_response(name, args={}, proc=[]):
for p in proc:
args.update(p())
- t = env.get_template(join(TEMPLATE, name))
+ t = env.get_template(TEMPLATE + "/" + name)
return t.render(**args)
def parse_permissions(session):
diff --git a/module/web/webinterface.py b/module/web/webinterface.py
index ea649c835..dd5920486 100644
--- a/module/web/webinterface.py
+++ b/module/web/webinterface.py
@@ -33,7 +33,7 @@ from module import InitHomeDir
import bottle
from bottle import run, app
-from jinja2 import Environment, FileSystemLoader, FileSystemBytecodeCache
+from jinja2 import Environment, FileSystemLoader, PrefixLoader, FileSystemBytecodeCache
from middlewares import StripPathMiddleware, GZipMiddleWare
try:
@@ -89,7 +89,10 @@ if not exists(join("tmp", "jinja_cache")):
makedirs(join("tmp", "jinja_cache"))
bcc = FileSystemBytecodeCache(join("tmp","jinja_cache"))
-env = Environment(loader=FileSystemLoader(join(PROJECT_DIR, "templates", "jinja")), extensions=['jinja2.ext.i18n'], trim_blocks=True, auto_reload=False, bytecode_cache=bcc)
+loader = PrefixLoader({
+ "default": FileSystemLoader(join(PROJECT_DIR, "templates", "jinja", "default"))
+ })
+env = Environment(loader=loader, extensions=['jinja2.ext.i18n'], trim_blocks=True, auto_reload=False, bytecode_cache=bcc)
from filters import quotepath, path_make_relative, path_make_absolute, truncate,date