Change static path
This commit is contained in:
@@ -80,7 +80,7 @@ class ClientScript(Plugin):
|
|||||||
for static_type in self.core_static:
|
for static_type in self.core_static:
|
||||||
for rel_path in self.core_static.get(static_type):
|
for rel_path in self.core_static.get(static_type):
|
||||||
file_path = os.path.join(Env.get('app_dir'), 'couchpotato', 'static', rel_path)
|
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':
|
if static_type == 'script':
|
||||||
self.registerScript(core_url, file_path, position = 'front')
|
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()
|
class_name = re.sub('([a-z0-9])([A-Z])', r'\1_\2', s1).lower()
|
||||||
|
|
||||||
# View path
|
# View path
|
||||||
path = 'api/%s/static/%s/' % (Env.setting('api_key'), class_name)
|
path = 'static/plugin/%s/' % (class_name)
|
||||||
|
|
||||||
# Add handler to Tornado
|
# Add handler to Tornado
|
||||||
Env.get('app').add_handlers(".*$", [(Env.get('web_base') + path + '(.*)', StaticFileHandler, {'path': static_folder})])
|
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'],
|
debug = config['use_reloader'],
|
||||||
gzip = True,
|
gzip = True,
|
||||||
cookie_secret = api_key,
|
cookie_secret = api_key,
|
||||||
login_url = "/login",
|
login_url = '%slogin/' % web_base,
|
||||||
)
|
)
|
||||||
Env.set('app', application)
|
Env.set('app', application)
|
||||||
|
|
||||||
@@ -257,7 +257,7 @@ def runCouchPotato(options, base_path, args, data_dir = None, log_dir = None, En
|
|||||||
])
|
])
|
||||||
|
|
||||||
# Static paths
|
# Static paths
|
||||||
static_path = '%sstatic/' % api_base
|
static_path = '%sstatic/' % web_base
|
||||||
for dir_name in ['fonts', 'images', 'scripts', 'style']:
|
for dir_name in ['fonts', 'images', 'scripts', 'style']:
|
||||||
application.add_handlers(".*$", [
|
application.add_handlers(".*$", [
|
||||||
('%s%s/(.*)' % (static_path, dir_name), StaticFileHandler, {'path': toUnicode(os.path.join(base_path, 'couchpotato', 'static', dir_name))})
|
('%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