Commit 05210e87 authored by Romain Courteaud's avatar Romain Courteaud

erp5_web_renderjs_ui: add LabelField support

parent 5b93b30f
...@@ -47,6 +47,8 @@ ...@@ -47,6 +47,8 @@
field_url = 'gadget_erp5_field_file.html'; field_url = 'gadget_erp5_field_file.html';
} else if (field_type === 'IntegerField') { } else if (field_type === 'IntegerField') {
field_url = 'gadget_erp5_field_integer.html'; field_url = 'gadget_erp5_field_integer.html';
} else if (field_type === 'LabelField') {
field_url = 'gadget_erp5_field_label.html';
} else if (field_type === 'ListBox') { } else if (field_type === 'ListBox') {
field_url = 'gadget_erp5_field_listbox.html'; field_url = 'gadget_erp5_field_listbox.html';
} else if (field_type === 'EditorField') { } else if (field_type === 'EditorField') {
......
...@@ -148,11 +148,13 @@ ...@@ -148,11 +148,13 @@
</record> </record>
<record id="3" aka="AAAAAAAAAAM="> <record id="3" aka="AAAAAAAAAAM=">
<pickle> <pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/> <global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle> </pickle>
<pickle> <pickle>
<tuple> <dictionary>
<none/> <item>
<key> <string>_log</string> </key>
<value>
<list> <list>
<dictionary> <dictionary>
<item> <item>
...@@ -196,16 +198,20 @@ ...@@ -196,16 +198,20 @@
</item> </item>
</dictionary> </dictionary>
</list> </list>
</tuple> </value>
</item>
</dictionary>
</pickle> </pickle>
</record> </record>
<record id="4" aka="AAAAAAAAAAQ="> <record id="4" aka="AAAAAAAAAAQ=">
<pickle> <pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/> <global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle> </pickle>
<pickle> <pickle>
<tuple> <dictionary>
<none/> <item>
<key> <string>_log</string> </key>
<value>
<list> <list>
<dictionary> <dictionary>
<item> <item>
...@@ -228,7 +234,7 @@ ...@@ -228,7 +234,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>975.47815.40095.24627</string> </value> <value> <string>977.38881.34981.23125</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -246,7 +252,7 @@ ...@@ -246,7 +252,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1557925216.18</float> <float>1590484760.02</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
...@@ -255,16 +261,20 @@ ...@@ -255,16 +261,20 @@
</item> </item>
</dictionary> </dictionary>
</list> </list>
</tuple> </value>
</item>
</dictionary>
</pickle> </pickle>
</record> </record>
<record id="5" aka="AAAAAAAAAAU="> <record id="5" aka="AAAAAAAAAAU=">
<pickle> <pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/> <global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle> </pickle>
<pickle> <pickle>
<tuple> <dictionary>
<none/> <item>
<key> <string>_log</string> </key>
<value>
<list> <list>
<dictionary> <dictionary>
<item> <item>
...@@ -312,7 +322,9 @@ ...@@ -312,7 +322,9 @@
</item> </item>
</dictionary> </dictionary>
</list> </list>
</tuple> </value>
</item>
</dictionary>
</pickle> </pickle>
</record> </record>
</ZopeData> </ZopeData>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width" />
<title>ERP5 Labelfield</title>
<link rel="http://www.renderjs.org/rel/interface" href="interface_erp5_field.html">
<link rel="http://www.renderjs.org/rel/interface" href="interface_erp5_form_content_provider.html">
<!-- renderjs -->
<script src="rsvp.js" type="text/javascript"></script>
<script src="renderjs.js" type="text/javascript"></script>
<!-- custom script -->
<script src="gadget_erp5_field_label.js" type="text/javascript"></script>
</head>
<body>
</body>
</html>
\ No newline at end of file
/*global window, rJS */
/*jslint indent: 2, maxerr: 3 */
(function (window, rJS) {
"use strict";
rJS(window)
.setState({
tag: 'p'
})
.declareMethod('render', function (options) {
var field_json = options.field_json || {};
return this.changeState({
value: field_json.value || field_json.default || ""
});
})
.onStateChange(function () {
this.element.innerHTML = this.state.value;
})
.declareMethod('getContent', function () {
return {};
})
.declareMethod('checkValidity', function () {
return true;
});
}(window, rJS));
\ No newline at end of file
...@@ -46,6 +46,8 @@ url_list = [ ...@@ -46,6 +46,8 @@ url_list = [
'gadget_erp5_field_image.js', 'gadget_erp5_field_image.js',
'gadget_erp5_field_integer.html', 'gadget_erp5_field_integer.html',
'gadget_erp5_field_integer.js', 'gadget_erp5_field_integer.js',
'gadget_erp5_field_label.html',
'gadget_erp5_field_label.js',
'gadget_erp5_field_list.html', 'gadget_erp5_field_list.html',
'gadget_erp5_field_list.js', 'gadget_erp5_field_list.js',
'gadget_erp5_field_lines.html', 'gadget_erp5_field_lines.html',
......
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