diff options
author | Walter Purcaro <vuolter@gmail.com> | 2014-07-19 02:38:53 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2014-07-19 02:38:53 +0200 |
commit | 8446e16346ece5a934550f69e81d0cad528f7fba (patch) | |
tree | a67e2564a6facbe9e307f619e5f98289009e6941 /module/web/webinterface.py | |
parent | Rename pyLoadCore as pyload and pyLoadCli as pyload-cli (diff) | |
download | pyload-8446e16346ece5a934550f69e81d0cad528f7fba.tar.xz |
New web structure + related code improvements and fixes + added flat and dark themes + updated js
Diffstat (limited to 'module/web/webinterface.py')
-rw-r--r-- | module/web/webinterface.py | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/module/web/webinterface.py b/module/web/webinterface.py index 13edd8a5e..b757b74f2 100644 --- a/module/web/webinterface.py +++ b/module/web/webinterface.py @@ -23,8 +23,8 @@ import os from os.path import join, abspath, dirname, exists from os import makedirs -PROJECT_DIR = abspath(dirname(__file__)) -PYLOAD_DIR = abspath(join(PROJECT_DIR, "..", "..")) +THEME_DIR = abspath(join(dirname(__file__), "themes")) +PYLOAD_DIR = abspath(join(THEME_DIR, "..", "..", "..")) sys.path.append(PYLOAD_DIR) @@ -56,7 +56,7 @@ from module.common.JsEngine import JsEngine JS = JsEngine() -TEMPLATE = config.get('webinterface', 'template') +THEME = config.get('webinterface', 'theme') DL_ROOT = config.get('general', 'download_folder') LOG_ROOT = config.get('log', 'log_folder') PREFIX = config.get('webinterface', 'prefix') @@ -74,13 +74,11 @@ if not exists(cache): makedirs(cache) bcc = FileSystemBytecodeCache(cache, '%s.cache') -loader = PrefixLoader({ - TEMPLATE: FileSystemLoader(join(PROJECT_DIR, "templates", TEMPLATE)), - 'js': FileSystemLoader(join(PROJECT_DIR, 'media', 'js')) -}) + +loader = FileSystemLoader(THEME_DIR) env = Environment(loader=loader, extensions=['jinja2.ext.i18n', 'jinja2.ext.autoescape'], trim_blocks=True, auto_reload=False, - bytecode_cache=bcc) + bytecode_cache=bcc) from filters import quotepath, path_make_relative, path_make_absolute, truncate, date |