Change static path
This commit is contained in:
@@ -80,7 +80,7 @@ class ClientScript(Plugin):
|
||||
for static_type in self.core_static:
|
||||
for rel_path in self.core_static.get(static_type):
|
||||
file_path = os.path.join(Env.get('app_dir'), 'couchpotato', 'static', rel_path)
|
||||
core_url = 'api/%s/static/%s' % (Env.setting('api_key'), rel_path)
|
||||
core_url = 'static/%s' % rel_path
|
||||
|
||||
if static_type == 'script':
|
||||
self.registerScript(core_url, file_path, position = 'front')
|
||||
|
||||
@@ -83,7 +83,7 @@ class Plugin(object):
|
||||
class_name = re.sub('([a-z0-9])([A-Z])', r'\1_\2', s1).lower()
|
||||
|
||||
# View path
|
||||
path = 'api/%s/static/%s/' % (Env.setting('api_key'), class_name)
|
||||
path = 'static/plugin/%s/' % (class_name)
|
||||
|
||||
# Add handler to Tornado
|
||||
Env.get('app').add_handlers(".*$", [(Env.get('web_base') + path + '(.*)', StaticFileHandler, {'path': static_folder})])
|
||||
|
||||
@@ -234,7 +234,7 @@ def runCouchPotato(options, base_path, args, data_dir = None, log_dir = None, En
|
||||
debug = config['use_reloader'],
|
||||
gzip = True,
|
||||
cookie_secret = api_key,
|
||||
login_url = "/login",
|
||||
login_url = '%slogin/' % web_base,
|
||||
)
|
||||
Env.set('app', application)
|
||||
|
||||
@@ -246,7 +246,7 @@ def runCouchPotato(options, base_path, args, data_dir = None, log_dir = None, En
|
||||
(r'%s(.*)(/?)' % api_base, ApiHandler), # Main API handler
|
||||
(r'%sgetkey(/?)' % web_base, KeyHandler), # Get API key
|
||||
(r'%s' % api_base, RedirectHandler, {"url": web_base + 'docs/'}), # API docs
|
||||
|
||||
|
||||
# Login handlers
|
||||
(r'%slogin(/?)' % web_base, LoginHandler),
|
||||
(r'%slogout(/?)' % web_base, LogoutHandler),
|
||||
@@ -257,7 +257,7 @@ def runCouchPotato(options, base_path, args, data_dir = None, log_dir = None, En
|
||||
])
|
||||
|
||||
# Static paths
|
||||
static_path = '%sstatic/' % api_base
|
||||
static_path = '%sstatic/' % web_base
|
||||
for dir_name in ['fonts', 'images', 'scripts', 'style']:
|
||||
application.add_handlers(".*$", [
|
||||
('%s%s/(.*)' % (static_path, dir_name), StaticFileHandler, {'path': toUnicode(os.path.join(base_path, 'couchpotato', 'static', dir_name))})
|
||||
|
||||
Reference in New Issue
Block a user