Static serving of staged logos

This commit is contained in:
Dannon Baker
2018-03-26 13:15:09 -04:00
parent 6875307b2a
commit 4969394a3c
2 changed files with 7 additions and 6 deletions
@@ -47,7 +47,7 @@ var View = Backbone.View.extend({
name: v.name,
keywords: v.keywords || [],
title: v.html,
image_src: v.logo ? Galaxy.root + "static/" + v.logo : null,
image_src: v.logo ? Galaxy.root + v.logo : null,
description: v.description || "No description available.",
regular: v.regular,
visualization: v
+6 -5
View File
@@ -45,7 +45,7 @@ class ServesStaticPluginMixin(object):
return os.path.join(self.path, 'static')
def _build_static_url(self):
return '/'.join([self.base_url, 'static'])
return self.static_path.replace("./config", "./static")
class ServesTemplatesPluginMixin(object):
@@ -169,12 +169,13 @@ class VisualizationPlugin(ServesStaticPluginMixin, ServesTemplatesPluginMixin):
# ---- non-public
def _check_path(self, path):
return os.path.exists(os.path.join(self.path, path))
return os.path.exists(path)
def _set_up_static_images(self):
default_path = 'static/logo.png'
if self._check_path(default_path):
self.config['logo'] = '/'.join(['plugins', self.base_url, default_path])
if self.serves_static:
logo_path = '/'.join([self.static_url, 'logo.png'])
if self._check_path(logo_path):
self.config['logo'] = logo_path
def _build_render_vars(self, config, trans=None, **kwargs):
"""