Commit 4fa3a69f authored by Xiaowu Zhang's avatar Xiaowu Zhang

Add Support for formulator GadgetField in erp5_web_renderjs_ui

parent 38f105a4
...@@ -124,6 +124,19 @@ def renderField(field, meta_type=None):\n ...@@ -124,6 +124,19 @@ def renderField(field, meta_type=None):\n
"title": field.get_value("title"),\n "title": field.get_value("title"),\n
"required": field.get_value("required"),\n "required": field.get_value("required"),\n
}\n }\n
elif meta_type == "GadgetField":\n
result = {\n
"type": meta_type,\n
"key": field.generate_field_key(),\n
"default": field.get_value("default"),\n
"editable": field.get_value("editable"),\n
"css_class": field.get_value("css_class"),\n
"hidden": field.get_value("hidden"),\n
"description": field.get_value("description"),\n
"title": field.get_value("title"),\n
"url": field.get_value("gadget_url"),\n
"sandbox": field.get_value("js_sandbox"),\n
}\n
elif meta_type == "ListBox":\n elif meta_type == "ListBox":\n
# XXX Not implemented\n # XXX Not implemented\n
columns = field.get_value("columns")\n columns = field.get_value("columns")\n
...@@ -341,7 +354,6 @@ sql_catalog = portal.portal_catalog.getSQLCatalog()\n ...@@ -341,7 +354,6 @@ sql_catalog = portal.portal_catalog.getSQLCatalog()\n
\n \n
# Calculate the site root to prevent unexpected browsing\n # Calculate the site root to prevent unexpected browsing\n
is_web_mode = (context.REQUEST.get(\'current_web_section\', None) is not None) or (hasattr(context, \'isWebMode\') and context.isWebMode())\n is_web_mode = (context.REQUEST.get(\'current_web_section\', None) is not None) or (hasattr(context, \'isWebMode\') and context.isWebMode())\n
# is_web_mode = traversed_document.isWebMode()\n # is_web_mode = traversed_document.isWebMode()\n
if is_web_mode:\n if is_web_mode:\n
site_root = context.getWebSectionValue()\n site_root = context.getWebSectionValue()\n
......
...@@ -112,7 +112,7 @@ https://netdna.bootstrapcdn.com/font-awesome/4.0.3/fonts/fontawesome-webfont.eot ...@@ -112,7 +112,7 @@ https://netdna.bootstrapcdn.com/font-awesome/4.0.3/fonts/fontawesome-webfont.eot
https://netdna.bootstrapcdn.com/font-awesome/4.0.3/fonts/fontawesome-webfont.woff?v=4.0.3\n https://netdna.bootstrapcdn.com/font-awesome/4.0.3/fonts/fontawesome-webfont.woff?v=4.0.3\n
https://netdna.bootstrapcdn.com/font-awesome/4.0.3/fonts/fontawesome-webfont.ttf?v=4.0.3\n https://netdna.bootstrapcdn.com/font-awesome/4.0.3/fonts/fontawesome-webfont.ttf?v=4.0.3\n
https://netdna.bootstrapcdn.com/font-awesome/4.0.3/fonts/fontawesome-webfont.svg?v=4.0.3#fontawesomeregular\n https://netdna.bootstrapcdn.com/font-awesome/4.0.3/fonts/fontawesome-webfont.svg?v=4.0.3#fontawesomeregular\n
RSVP.js\n rsvp.js\n
URI.js\n URI.js\n
codemirror.css\n codemirror.css\n
codemirror.js\n codemirror.js\n
...@@ -148,6 +148,8 @@ gadget_erp5_field_string.html\n ...@@ -148,6 +148,8 @@ gadget_erp5_field_string.html\n
gadget_erp5_field_string.js\n gadget_erp5_field_string.js\n
gadget_erp5_field_textarea.html\n gadget_erp5_field_textarea.html\n
gadget_erp5_field_textarea.js\n gadget_erp5_field_textarea.js\n
gadget_erp5_field_gadget.html\n
gadget_erp5_field_gadget.js\n
gadget_erp5_form.html\n gadget_erp5_form.html\n
gadget_erp5_form.js\n gadget_erp5_form.js\n
gadget_erp5_header.html\n gadget_erp5_header.html\n
...@@ -310,7 +312,7 @@ NETWORK:\n ...@@ -310,7 +312,7 @@ NETWORK:\n
</item> </item>
<item> <item>
<key> <string>actor</string> </key> <key> <string>actor</string> </key>
<value> <string>romain</string> </value> <value> <string>xiaowu</string> </value>
</item> </item>
<item> <item>
<key> <string>comment</string> </key> <key> <string>comment</string> </key>
...@@ -324,7 +326,7 @@ NETWORK:\n ...@@ -324,7 +326,7 @@ NETWORK:\n
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>938.4615.36506.28108</string> </value> <value> <string>940.17441.54956.1450</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -342,8 +344,8 @@ NETWORK:\n ...@@ -342,8 +344,8 @@ NETWORK:\n
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1412758909.58</float> <float>1421155553.4</float>
<string>GMT</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
</object> </object>
......
...@@ -232,6 +232,8 @@ ...@@ -232,6 +232,8 @@
field_url = \'gadget_erp5_field_textarea.html\';\n field_url = \'gadget_erp5_field_textarea.html\';\n
// field_url = \'gadget_codemirror.html\';\n // field_url = \'gadget_codemirror.html\';\n
// sandbox = \'iframe\';\n // sandbox = \'iframe\';\n
} else if (renderered_field.type === \'GadgetField\') {\n
field_url = \'gadget_erp5_field_gadget.html\';\n
}\n }\n
\n \n
return field_queue\n return field_queue\n
...@@ -472,7 +474,7 @@ ...@@ -472,7 +474,7 @@
</item> </item>
<item> <item>
<key> <string>actor</string> </key> <key> <string>actor</string> </key>
<value> <string>zope</string> </value> <value> <string>xiaowu</string> </value>
</item> </item>
<item> <item>
<key> <string>comment</string> </key> <key> <string>comment</string> </key>
...@@ -486,7 +488,7 @@ ...@@ -486,7 +488,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>940.11553.26313.55261</string> </value> <value> <string>940.17393.53012.39048</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -504,8 +506,8 @@ ...@@ -504,8 +506,8 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1421080954.49</float> <float>1421153349.36</float>
<string>GMT</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
</object> </object>
......
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