From 05f63405e052fd5358e2aff5654212ea874b4e20 Mon Sep 17 00:00:00 2001 From: Ruud Date: Sat, 28 May 2011 23:21:58 +0200 Subject: [PATCH] url_base fix --- couchpotato/__init__.py | 2 +- couchpotato/cli.py | 5 ++++- couchpotato/core/plugins/base.py | 4 +--- couchpotato/static/style/main.css | 4 +++- couchpotato/templates/_desktop.html | 6 ++---- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/couchpotato/__init__.py b/couchpotato/__init__.py index 2a10f833..92819a54 100644 --- a/couchpotato/__init__.py +++ b/couchpotato/__init__.py @@ -24,7 +24,7 @@ def get_session(engine = None): return scoped_session(sessionmaker(bind = engine)) def get_engine(): - return create_engine(Env.get('db_path')+'?check_same_thread=False', echo = False) + return create_engine(Env.get('db_path') + '?check_same_thread=False', echo = False) def addView(route, func, static = False): web.add_url_rule(route + ('' if static else '/'), endpoint = route if route else 'index', view_func = func) diff --git a/couchpotato/cli.py b/couchpotato/cli.py index 3425480d..8341140e 100644 --- a/couchpotato/cli.py +++ b/couchpotato/cli.py @@ -120,7 +120,7 @@ def cmd_couchpotato(base_path, args): # Create app from couchpotato import app api_key = Env.setting('api_key') - url_base = '/' + Env.setting('url_base') if Env.setting('url_base') else '' + url_base = '/' + Env.setting('url_base').lstrip('/') if Env.setting('url_base') else '' reloader = debug and not options.daemonize # Basic config @@ -129,6 +129,9 @@ def cmd_couchpotato(base_path, args): app.debug = debug app.secret_key = api_key app.static_path = url_base + '/static' + app.add_url_rule(app.static_path + '/', + endpoint = 'static', + view_func = app.send_static_file) # Register modules app.register_module(web, url_prefix = '%s/' % url_base) diff --git a/couchpotato/core/plugins/base.py b/couchpotato/core/plugins/base.py index cf6dc08a..e617fb1f 100644 --- a/couchpotato/core/plugins/base.py +++ b/couchpotato/core/plugins/base.py @@ -1,4 +1,4 @@ -from couchpotato import addView, get_session +from couchpotato import addView from couchpotato.environment import Env from flask.helpers import send_from_directory import os.path @@ -28,9 +28,7 @@ class Plugin(): return path def showStatic(self, file = ''): - dir = os.path.join(self.plugin_path, 'static') - return send_from_directory(dir, file) def isDisabled(self): diff --git a/couchpotato/static/style/main.css b/couchpotato/static/style/main.css index f5cf9bec..88289c6b 100644 --- a/couchpotato/static/style/main.css +++ b/couchpotato/static/style/main.css @@ -111,10 +111,11 @@ form { font-weight: bold; line-height: 1; + border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; - border-radius: 5px; + box-shadow: 0 1px 3px rgba(0,0,0,0.5); -moz-box-shadow: 0 1px 3px rgba(0,0,0,0.5); -webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.5); box-shadow: 0 1px 3px rgba(0,0,0,0.5); @@ -134,6 +135,7 @@ form { background: #4e5969; padding:10px; height: 60px; + box-shadow: 0 0 30px rgba(0,0,0,0.1); -moz-box-shadow: 0 0 30px rgba(0,0,0,0.1); -webkit-box-shadow: 0 0 30px rgba(0,0,0,0.1); position: fixed; diff --git a/couchpotato/templates/_desktop.html b/couchpotato/templates/_desktop.html index ec64755a..454a3aff 100644 --- a/couchpotato/templates/_desktop.html +++ b/couchpotato/templates/_desktop.html @@ -25,11 +25,9 @@ {% for url in fireEvent('clientscript.get_scripts', as_html = True, single = True) %} - - {% endfor %} + {% endfor %} {% for url in fireEvent('clientscript.get_styles', as_html = True, single = True) %} - - {% endfor %} + {% endfor %}