[Kimchi-devel] [PATCH ][Wok] Issue # 317: Ginger should NOT depeden on Ginger s390x
atreyee at linux.vnet.ibm.com
atreyee at linux.vnet.ibm.com
Wed Apr 27 16:40:19 UTC 2016
From: Atreyee Mukhopadhyay <atreyee at linux.vnet.ibm.com>
This change will make Gingers390x extend Ginger UI.
All s390x specific functionality changes are moved to js files
in Gingers390x plugin.
---
src/wok/root.py | 8 ++++++++
src/wok/template.py | 2 +-
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/wok/root.py b/src/wok/root.py
index 7a5fe9c..d1a2cc9 100644
--- a/src/wok/root.py
+++ b/src/wok/root.py
@@ -120,6 +120,13 @@ class Root(Resource):
data = {}
data['ui_dir'] = paths.ui_dir
+ data['scripts'] = []
+ for plugin, app in cherrypy.tree.apps.iteritems():
+ if app.root.extends is not None:
+ scripts = app.root.extends.get(script_name, {})
+ if page in scripts.keys():
+ data['scripts'].append(scripts[page])
+
if page.endswith('.html'):
context = template.render('/tabs/' + page, data)
cherrypy.response.cookie["lastPage"] = "/#" + last_page
@@ -140,6 +147,7 @@ class WokRoot(Root):
self.domain = 'wok'
self.messages = messages
self.log_map = ROOT_REQUESTS
+ self.extends = None
@cherrypy.expose
def login(self, *args):
diff --git a/src/wok/template.py b/src/wok/template.py
index b47041a..2162c8a 100644
--- a/src/wok/template.py
+++ b/src/wok/template.py
@@ -99,7 +99,7 @@ def render_cheetah_file(resource, data):
'localedir': paths.mo_dir,
'lang': [lang]}
params['lang'] = gettext_conf
- params['data'] = {'ui_dir': paths.ui_dir}
+ params['data'] = data
return Template(file=filename, searchList=params).respond()
except OSError, e:
if e.errno == errno.ENOENT:
--
2.1.0
More information about the Kimchi-devel
mailing list