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
Labels
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Romain Courteaud
erp5
Commits
5225bf78
Commit
5225bf78
authored
Dec 19, 2019
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WIP [erp5_hal_json_style] xxx jump / redirect
parent
a281b433
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
5 deletions
+19
-5
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/Base_redirect.py
...ateItem/portal_skins/erp5_hal_json_style/Base_redirect.py
+15
-2
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/ERP5Document_getHateoas.py
...rtal_skins/erp5_hal_json_style/ERP5Document_getHateoas.py
+4
-3
No files found.
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/Base_redirect.py
View file @
5225bf78
...
@@ -60,10 +60,23 @@ result_dict = {
...
@@ -60,10 +60,23 @@ result_dict = {
}
}
}
}
# web_section_value = context.getWebSectionValue()
# web_section_value = context.REQUEST.get('current_web_section', None)
# web_section_url = web_section_value.absolute_url()
# raise NotImplementedError(web_section_url)
# Drop the automatically added VirtualHostMonster object ID
if
(
not
context
.
isWebMode
())
and
(
context
.
REQUEST
.
get
(
'web_section_value'
,
None
)
is
not
None
):
portal
=
context
.
getPortalObject
()
# raise NotImplementedError(context.REQUEST['web_section_value'])
web_section
=
portal
.
restrictedTraverse
(
"/"
.
join
(
context
.
REQUEST
[
'web_section_value'
]))
context
=
getattr
(
web_section
,
context
.
getRelativeUrl
())
# raise NotImplementedError(context)
# form_id = 'view' means use default document view. Let the JS handle it
# form_id = 'view' means use default document view. Let the JS handle it
# In case of dialog submit, if redirecting to the original form, let the JS handle the navigation history
# In case of dialog submit, if redirecting to the original form, let the JS handle the navigation history
if
(
form_id
is
not
None
)
and
\
if
(
form_id
not
in
[
None
,
'Base_viewFakePythonScriptActionForm'
]
)
and
\
(
form_id
not
in
[
'view'
,
'Base_viewFakePythonScriptActionForm'
]
)
and
\
(
(
form_id
!=
'view'
)
or
(
keep_items
is
not
None
)
)
and
\
(
form_id
!=
previous_form_id
)
and
\
(
form_id
!=
previous_form_id
)
and
\
(
not
form_id
.
startswith
(
'http'
))
and
\
(
not
form_id
.
startswith
(
'http'
))
and
\
(
context
.
isWebMode
()):
(
context
.
isWebMode
()):
...
...
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/ERP5Document_getHateoas.py
View file @
5225bf78
...
@@ -1352,7 +1352,7 @@ def calculateHateoas(is_portal=None, is_site_root=None, traversed_document=None,
...
@@ -1352,7 +1352,7 @@ def calculateHateoas(is_portal=None, is_site_root=None, traversed_document=None,
# If our "form" is actually a Script (nothing is sure in ERP5) or anything else than Form
# If our "form" is actually a Script (nothing is sure in ERP5) or anything else than Form
# (e.g. function or bound class method will) not have .meta_type thus be considered a Script
# (e.g. function or bound class method will) not have .meta_type thus be considered a Script
# then we execute it directly
# then we execute it directly
if
"Script"
in
getattr
(
view_instance
,
"meta_type"
,
"Script"
):
if
(
"Script"
in
getattr
(
view_instance
,
"meta_type"
,
"Script"
))
or
(
):
view_instance
=
getattr
(
traversed_document
,
'Base_viewFakePythonScriptActionForm'
)
view_instance
=
getattr
(
traversed_document
,
'Base_viewFakePythonScriptActionForm'
)
if
view_instance
.
pt
==
"form_dialog"
:
if
view_instance
.
pt
==
"form_dialog"
:
...
@@ -1402,7 +1402,7 @@ def calculateHateoas(is_portal=None, is_site_root=None, traversed_document=None,
...
@@ -1402,7 +1402,7 @@ def calculateHateoas(is_portal=None, is_site_root=None, traversed_document=None,
global_action_type
=
(
"view"
,
"workflow"
,
"object_new_content_action"
,
global_action_type
=
(
"view"
,
"workflow"
,
"object_new_content_action"
,
"object_clone_action"
,
"object_delete_action"
,
"object_clone_action"
,
"object_delete_action"
,
"object_list_action"
)
"object_list_action"
,
"object_jump"
)
if
(
erp5_action_key
==
view_action_type
or
if
(
erp5_action_key
==
view_action_type
or
erp5_action_key
in
global_action_type
or
erp5_action_key
in
global_action_type
or
"_jio"
in
erp5_action_key
):
"_jio"
in
erp5_action_key
):
...
@@ -1428,7 +1428,8 @@ def calculateHateoas(is_portal=None, is_site_root=None, traversed_document=None,
...
@@ -1428,7 +1428,8 @@ def calculateHateoas(is_portal=None, is_site_root=None, traversed_document=None,
"extra_param_json"
:
urlsafe_b64encode
(
json
.
dumps
(
ensureSerializable
(
extra_param_json
)))
"extra_param_json"
:
urlsafe_b64encode
(
json
.
dumps
(
ensureSerializable
(
extra_param_json
)))
}
}
if
erp5_action_key
==
'object_jump'
:
if
erp5_action_key
==
'object_jumpX'
:
# XXX couscous
if
'Base_jumpToRelatedObject?'
in
view_action
[
'url'
]:
if
'Base_jumpToRelatedObject?'
in
view_action
[
'url'
]:
# Fetch the URL arguments
# Fetch the URL arguments
# XXX Correctly unquote arguments
# XXX Correctly unquote arguments
...
...
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