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
Laurent S
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
Hide 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
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
\n
\n
elif meta_type in ("RelationStringField"):\n
elif meta_type in ("RelationStringField", "MultiRelationStringField"):\n
portal_type_list = field.get_value(\'portal_type\')\n
if 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
for k, v in field.get_value(\'parameter_list\'):\n
kw[k] = v\n
\n
accessor_name = \'get%sValue\' % \\\n
accessor_name = \'get%sValue
List
\' % \\\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
\n
filter=kw\n
)\n
\n
query = url_template_dict["jio_search_template"] % {\n
"query": make_query({"query": sql_catalog.buildQuery(\n
{"portal_type": portal_type_list}\n
...
...
@@ -239,8 +238,11 @@ def renderField(field, form_relative_url, meta_type=None, key=None):\n
"item", key=result["key"]\n
)\n
\n
if jump_reference:\n
result["relation_item_relative_url"] = jump_reference.getRelativeUrl()\n
if jump_reference_list:\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
elif meta_type == "CheckBoxField":\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 @@
field_url = \'gadget_erp5_field_string.html\';\n
} else if (type === \'RelationStringField\') {\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
field_url = \'gadget_erp5_field_textarea.html\';\n
} else if (type === \'DateTimeField\') {\n
...
...
@@ -251,6 +253,7 @@
if (group[0] !== "bottom") {\n
field_element.appendChild(label_element);\n
}\n
\n
field_url = getFieldTypeGadgetUrl(renderered_field.type);\n
\n
...
...
@@ -585,7 +588,7 @@
</item>
<item>
<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>
<key>
<string>
state
</string>
</key>
...
...
@@ -603,7 +606,7 @@
</tuple>
<state>
<tuple>
<float>
143
1049784.59
</float>
<float>
143
2174400.48
</float>
<string>
UTC
</string>
</tuple>
</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
function
setRelationJump(my_gadget,
my_initial_call,
my_selected_value)
{\n
var
props =
my_gadget.property_dict,\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
\n
if
(target_url
&&
field_json.allow_jump)
{\n
...
...
@@ -767,7 +767,7 @@ promiseEventListener */\n
</item>
<item>
<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>
<key>
<string>
state
</string>
</key>
...
...
@@ -785,7 +785,7 @@ promiseEventListener */\n
</tuple>
<state>
<tuple>
<float>
143
1075656.16
</float>
<float>
143
2255062.93
</float>
<string>
UTC
</string>
</tuple>
</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