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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Eteri
erp5
Commits
ee37a095
Commit
ee37a095
authored
May 26, 2015
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_web_renderjs_ui: add support for multirelationfield
parent
7ce7c30c
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
1148 additions
and
12 deletions
+1148
-12
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/ERP5Document_getHateoas.xml
...tal_skins/erp5_hal_json_style/ERP5Document_getHateoas.xml
+9
-7
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_form_js.xml
...hTemplateItem/web_page_module/rjs_gadget_erp5_form_js.xml
+5
-2
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_multirelationstringfield_html.xml
..._module/rjs_gadget_erp5_multirelationstringfield_html.xml
+356
-0
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_multirelationstringfield_js.xml
...ge_module/rjs_gadget_erp5_multirelationstringfield_js.xml
+775
-0
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_relationstringfield_js.xml
...eb_page_module/rjs_gadget_erp5_relationstringfield_js.xml
+3
-3
No files found.
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/ERP5Document_getHateoas.xml
View file @
ee37a095
...
@@ -189,8 +189,7 @@ def renderField(field, form_relative_url, meta_type=None, key=None):\n
...
@@ -189,8 +189,7 @@ def renderField(field, form_relative_url, meta_type=None, key=None):\n
for subkey in ("year", "month", "day", "hour", "minute", "ampm", "timezone"):\n
for subkey in ("year", "month", "day", "hour", "minute", "ampm", "timezone"):\n
result["subfield_%s_key" % subkey] = traversed_document.Field_getSubFieldKeyDict(field, subkey, key=result["key"])\n
result["subfield_%s_key" % subkey] = traversed_document.Field_getSubFieldKeyDict(field, subkey, key=result["key"])\n
\n
\n
\n
elif meta_type in ("RelationStringField", "MultiRelationStringField"):\n
elif meta_type in ("RelationStringField"):\n
portal_type_list = field.get_value(\'portal_type\')\n
portal_type_list = field.get_value(\'portal_type\')\n
if portal_type_list:\n
if portal_type_list:\n
portal_type_list = [x[0] for x in portal_type_list]\n
portal_type_list = [x[0] for x in portal_type_list]\n
...
@@ -201,13 +200,13 @@ def renderField(field, form_relative_url, meta_type=None, key=None):\n
...
@@ -201,13 +200,13 @@ def renderField(field, form_relative_url, meta_type=None, key=None):\n
for k, v in field.get_value(\'parameter_list\'):\n
for k, v in field.get_value(\'parameter_list\'):\n
kw[k] = v\n
kw[k] = v\n
\n
\n
accessor_name = \'get%sValue\' % \\\n
accessor_name = \'get%sValue
List
\' % \\\n
\'\'.join([part.capitalize() for part in base_category.split(\'_\')])\n
\'\'.join([part.capitalize() for part in base_category.split(\'_\')])\n
jump_reference = getattr(traversed_document, accessor_name)(\n
jump_reference
_list
= getattr(traversed_document, accessor_name)(\n
portal_type=[x[0] for x in field.get_value(\'portal_type\')],\n
portal_type=[x[0] for x in field.get_value(\'portal_type\')],\n
\n
filter=kw\n
filter=kw\n
)\n
)\n
\n
query = url_template_dict["jio_search_template"] % {\n
query = url_template_dict["jio_search_template"] % {\n
"query": make_query({"query": sql_catalog.buildQuery(\n
"query": make_query({"query": sql_catalog.buildQuery(\n
{"portal_type": portal_type_list}\n
{"portal_type": portal_type_list}\n
...
@@ -239,8 +238,11 @@ def renderField(field, form_relative_url, meta_type=None, key=None):\n
...
@@ -239,8 +238,11 @@ def renderField(field, form_relative_url, meta_type=None, key=None):\n
"item", key=result["key"]\n
"item", key=result["key"]\n
)\n
)\n
\n
\n
if jump_reference:\n
if jump_reference_list:\n
result["relation_item_relative_url"] = jump_reference.getRelativeUrl()\n
url = [jump_reference.getRelativeUrl() for jump_reference in jump_reference_list]\n
uid = [jump_reference.getUid() for jump_reference in jump_reference_list]\n
result["relation_item_relative_url"] = url\n
result["relation_item_uid"] = uid\n
\n
\n
elif meta_type == "CheckBoxField":\n
elif meta_type == "CheckBoxField":\n
result = {\n
result = {\n
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_form_js.xml
View file @
ee37a095
...
@@ -125,6 +125,8 @@
...
@@ -125,6 +125,8 @@
field_url = \'gadget_erp5_field_string.html\';\n
field_url = \'gadget_erp5_field_string.html\';\n
} else if (type === \'RelationStringField\') {\n
} else if (type === \'RelationStringField\') {\n
field_url = \'gadget_erp5_field_relationstring.html\';\n
field_url = \'gadget_erp5_field_relationstring.html\';\n
} else if (type === \'MultiRelationStringField\') {\n
field_url = \'gadget_erp5_field_multirelationfield.html\';\n
} else if (type === \'TextAreaField\') {\n
} else if (type === \'TextAreaField\') {\n
field_url = \'gadget_erp5_field_textarea.html\';\n
field_url = \'gadget_erp5_field_textarea.html\';\n
} else if (type === \'DateTimeField\') {\n
} else if (type === \'DateTimeField\') {\n
...
@@ -251,6 +253,7 @@
...
@@ -251,6 +253,7 @@
if (group[0] !== "bottom") {\n
if (group[0] !== "bottom") {\n
field_element.appendChild(label_element);\n
field_element.appendChild(label_element);\n
}\n
}\n
\n
\n
field_url = getFieldTypeGadgetUrl(renderered_field.type);\n
field_url = getFieldTypeGadgetUrl(renderered_field.type);\n
\n
\n
...
@@ -585,7 +588,7 @@
...
@@ -585,7 +588,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
94
2.57027.49275.723
6
</string>
</value>
<value>
<string>
94
3.1808.36899.3411
6
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -603,7 +606,7 @@
...
@@ -603,7 +606,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
143
1049784.59
</float>
<float>
143
2174400.48
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_multirelationstringfield_html.xml
0 → 100644
View file @
ee37a095
This diff is collapsed.
Click to expand it.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_multirelationstringfield_js.xml
0 → 100644
View file @
ee37a095
This diff is collapsed.
Click to expand it.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_relationstringfield_js.xml
View file @
ee37a095
...
@@ -266,7 +266,7 @@ promiseEventListener */\n
...
@@ -266,7 +266,7 @@ promiseEventListener */\n
function
setRelationJump(my_gadget,
my_initial_call,
my_selected_value)
{\n
function
setRelationJump(my_gadget,
my_initial_call,
my_selected_value)
{\n
var
props =
my_gadget.property_dict,\n
var
props =
my_gadget.property_dict,\n
field_json =
props.field_json,\n
field_json =
props.field_json,\n
target_url =
my_selected_value
||
field_json.relation_item_relative_url,\n
target_url =
my_selected_value
||
field_json.relation_item_relative_url
[0]
,\n
is_init =
my_initial_call
===
true;\n
is_init =
my_initial_call
===
true;\n
\n
\n
if
(target_url
&&
field_json.allow_jump)
{\n
if
(target_url
&&
field_json.allow_jump)
{\n
...
@@ -767,7 +767,7 @@ promiseEventListener */\n
...
@@ -767,7 +767,7 @@ promiseEventListener */\n
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
94
2.57468.41646.2928
6
</string>
</value>
<value>
<string>
94
3.11588.15892.2387
6
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -785,7 +785,7 @@ promiseEventListener */\n
...
@@ -785,7 +785,7 @@ promiseEventListener */\n
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
143
1075656.16
</float>
<float>
143
2255062.93
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
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