Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
erp5
Commits
b8c6c386
Commit
b8c6c386
authored
Mar 06, 2020
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GadgetField: handle gadget fields loaded from a web site
parent
ceb4cb4d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
product/ERP5Form/GadgetField.py
product/ERP5Form/GadgetField.py
+6
-2
No files found.
product/ERP5Form/GadgetField.py
View file @
b8c6c386
...
@@ -41,11 +41,15 @@ class GadgetWidget(Widget.Widget):
...
@@ -41,11 +41,15 @@ class GadgetWidget(Widget.Widget):
return
self
.
render_view
(
field
,
value
,
REQUEST
,
render_prefix
,
key
)
return
self
.
render_view
(
field
,
value
,
REQUEST
,
render_prefix
,
key
)
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
):
gadget_url
=
field
.
get_value
(
'gadget_url'
)
if
gadget_url
:
gadget_component
=
field
.
restrictedTraverse
(
gadget_url
,
None
)
if
gadget_component
is
not
None
:
gadget_url
=
gadget_component
.
absolute_url
()
kw
=
{
kw
=
{
'data-gadget-sandbox'
:
field
.
get_value
(
'js_sandbox'
),
'data-gadget-sandbox'
:
field
.
get_value
(
'js_sandbox'
),
# Duplicate the absolute url logic of xhtml style
# Duplicate the absolute url logic of xhtml style
'data-gadget-url'
:
urljoin
(
field
.
getPortalObject
().
absolute_url
()
+
'/'
,
'data-gadget-url'
:
gadget_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'
)))
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment