From fc4e71d7809e6e9975d678ee388fc28c74e0e3af Mon Sep 17 00:00:00 2001
From: RaNaN <Mast3rRaNaN@hotmail.de>
Date: Wed, 10 Jul 2013 23:07:52 +0200
Subject: several ui fixes

---
 pyload/web/pyload_app.py | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

(limited to 'pyload/web/pyload_app.py')

diff --git a/pyload/web/pyload_app.py b/pyload/web/pyload_app.py
index 3d3f297a8..2f6211621 100644
--- a/pyload/web/pyload_app.py
+++ b/pyload/web/pyload_app.py
@@ -19,9 +19,9 @@
 import time
 from os.path import join
 
-from bottle import route, static_file, response, redirect
+from bottle import route, static_file, response, redirect, template
 
-from webinterface import PROJECT_DIR, SETUP, APP_PATH, UNAVAILALBE
+from webinterface import PYLOAD, PROJECT_DIR, SETUP, APP_PATH, UNAVAILALBE
 
 from utils import login_required
 
@@ -32,6 +32,7 @@ def serve_icon(path):
     return redirect('/images/icon.png')
     # return static_file(path, root=join("tmp", "icons"))
 
+
 @route("/download/:fid")
 @login_required('Download')
 def download(fid, api):
@@ -48,8 +49,11 @@ def index():
         # TODO show different page
         pass
 
-    # TODO: render it as simple template with configuration
-    return server_static('index.html')
+    f = server_static('index.html')
+    content = f.body.read()
+    f.body = template(content, ws=PYLOAD.getWSAddress(), web=PYLOAD.getConfigValue('webinterface', 'port'))
+
+    return f
 
 # Very last route that is registered, could match all uris
 @route('/<path:path>')
-- 
cgit v1.2.3