Commit ef7c21d5 authored by Romain Courteaud's avatar Romain Courteaud Committed by Xiaowu Zhang

ERP5Form/GadgetField: generate the absolute url for xhtml style

parent 978096f2
...@@ -6,6 +6,7 @@ from zLOG import LOG, ERROR ...@@ -6,6 +6,7 @@ from zLOG import LOG, ERROR
from cStringIO import StringIO from cStringIO import StringIO
from json import dumps from json import dumps
from Acquisition import aq_base from Acquisition import aq_base
from urlparse import urljoin
class GadgetWidget(Widget.Widget): class GadgetWidget(Widget.Widget):
""" """
...@@ -42,7 +43,9 @@ class GadgetWidget(Widget.Widget): ...@@ -42,7 +43,9 @@ class GadgetWidget(Widget.Widget):
def render_view(self, field, value, REQUEST=None, render_prefix=None, key=None): def render_view(self, field, value, REQUEST=None, render_prefix=None, key=None):
kw = { kw = {
'data-gadget-sandbox': field.get_value('js_sandbox'), 'data-gadget-sandbox': field.get_value('js_sandbox'),
'data-gadget-url': field.get_value('gadget_url'), # Duplicate the absolute url logic of xhtml style
'data-gadget-url': urljoin(field.getPortalObject().absolute_url() + '/',
field.get_value('gadget_url')),
'data-gadget-value': value, 'data-gadget-value': value,
'data-gadget-renderjs-extra': dumps(dict(field.get_value('renderjs_extra'))) 'data-gadget-renderjs-extra': dumps(dict(field.get_value('renderjs_extra')))
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment