Commit dde9c3b4 authored by Xiaowu Zhang's avatar Xiaowu Zhang

erp5_web_renderjs_ui: add support for image field

parent 05d7b949
...@@ -182,6 +182,19 @@ def renderField(field, form_relative_url, value=None, meta_type=None, key=None): ...@@ -182,6 +182,19 @@ def renderField(field, form_relative_url, value=None, meta_type=None, key=None):
result["default"] = getFieldDefault(field, result["key"], value)\n result["default"] = getFieldDefault(field, result["key"], value)\n
if meta_type == "FloatField":\n if meta_type == "FloatField":\n
result["precision"] = field.get_value("precision")\n result["precision"] = field.get_value("precision")\n
if meta_type == "ImageField":\n
options = {}\n
options[\'display\'] = field.get_value(\'image_display\')\n
options[\'format\'] = field.get_value(\'image_format\')\n
options[\'quality\'] = field.get_value(\'image_quality\')\n
pre_converted_only = field.get_value(\'image_pre_converted_only\')\n
if pre_converted_only:\n
options[\'pre_converted_only\'] = pre_converted_only\n
parameters = \'&\'.join([\'%s=%s\' % (k, v) for k, v in options.items() \\\n
if v])\n
if parameters:\n
result["default"] = \'%s?%s\' % (result["default"], parameters)\n
\n
elif meta_type == "DateTimeField":\n elif meta_type == "DateTimeField":\n
result = {\n result = {\n
"type": meta_type,\n "type": meta_type,\n
......
...@@ -145,6 +145,8 @@ ...@@ -145,6 +145,8 @@
field_url = \'gadget_erp5_field_gadget.html\';\n field_url = \'gadget_erp5_field_gadget.html\';\n
} else if (type === \'RadioField\') {\n } else if (type === \'RadioField\') {\n
field_url = \'gadget_erp5_field_radio.html\';\n field_url = \'gadget_erp5_field_radio.html\';\n
} else if (type === \'ImageField\') {\n
field_url = \'gadget_erp5_field_image.html\';\n
}\n }\n
return field_url;\n return field_url;\n
}\n }\n
...@@ -508,7 +510,7 @@ ...@@ -508,7 +510,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>943.40750.19186.4829</string> </value> <value> <string>943.40772.7493.11212</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -526,7 +528,7 @@ ...@@ -526,7 +528,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1434006006.8</float> <float>1434089456.97</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
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