Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Leo Le Bouter
erp5
Commits
a1c67b06
Commit
a1c67b06
authored
10 years ago
by
Romain Courteaud
Committed by
Sebastien Robin
10 years ago
Browse files
Options
Download
Email Patches
Plain Diff
Add parent link on document
parent
fc4cc8f3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
10 deletions
+16
-10
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/ERP5Document_getHateoas.xml
...tal_skins/erp5_hal_json_style/ERP5Document_getHateoas.xml
+15
-9
bt5/erp5_hal_json_style/bt/revision
bt5/erp5_hal_json_style/bt/revision
+1
-1
No files found.
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/ERP5Document_getHateoas.xml
View file @
a1c67b06
...
...
@@ -417,6 +417,20 @@ elif (mode == \'root\') or (mode == \'traverse\'):\n
},\n
"name": traversed_document.getPortalType(),\n
}\n
\n
# Return info about container\n
if not is_portal:\n
container = traversed_document.getParentValue()\n
if container != portal:\n
# Jio does not support fetching the root document for now\n
result_dict[\'_links\'][\'parent\'] = {\n
"href": default_document_uri_template % {\n
"root_url": site_root.absolute_url(),\n
"relative_url": container.getRelativeUrl(), \n
"script_id": script.id\n
},\n
"name": container.getTitle(),\n
}\n
\n
# XXX Loop on form rendering\n
erp5_action_dict = portal.Base_filterDuplicateActions(\n
...
...
@@ -454,15 +468,7 @@ elif (mode == \'root\') or (mode == \'traverse\'):\n
# \'name\': view_action[\'name\']\n
# })\n
\n
# # XXX Check that traversed_document is not the portal\n
# if (traversed_document.getRelativeUrl() != portal.getRelativeUrl()) and (traversed_document.getRelativeUrl() != site_root.getRelativeUrl()):\n
# parent = traversed_document.getParentValue()\n
# if (is_web_mode and (parent.getRelativeUrl() != portal.getRelativeUrl())):\n
# result_dict[\'_links\'][\'parent\'] = {\n
# \'href\': \'%s\' % parent.absolute_url(),\n
# \'name\': parent.getTitle()\n
# }\n
# \n
\n
# if (renderer_form is not None):\n
# traversed_document_property_dict, renderer_form_json = traversed_document.Base_renderFormAsSomething(renderer_form)\n
# result_dict[\'_embedded\'] = {\n
...
...
This diff is collapsed.
Click to expand it.
bt5/erp5_hal_json_style/bt/revision
View file @
a1c67b06
25
\ No newline at end of file
26
\ No newline at end of file
This diff is collapsed.
Click to expand it.
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