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
Leo Le Bouter
erp5
Commits
ef1100d9
Commit
ef1100d9
authored
Dec 20, 2016
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5_hal_json_style] Propagate portal status message via a JSON document
parent
ae932987
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
22 deletions
+15
-22
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/Base_edit.py
...emplateItem/portal_skins/erp5_hal_json_style/Base_edit.py
+1
-20
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/Base_newContentFromJS.py
...portal_skins/erp5_hal_json_style/Base_newContentFromJS.py
+1
-1
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
+13
-1
No files found.
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/Base_edit.py
View file @
ef1100d9
...
@@ -262,23 +262,4 @@ if context.REQUEST.get('is_web_mode', False) and \
...
@@ -262,23 +262,4 @@ if context.REQUEST.get('is_web_mode', False) and \
not
editable_mode
:
not
editable_mode
:
form_id
=
'view'
form_id
=
'view'
if
not
selection_index
:
return
context
.
Base_redirect
(
keep_items
=
{
'portal_status_message'
:
message
})
redirect_url
=
'%s?ignore_layout:int=%s&editable_mode:int=%s&portal_status_message=%s'
%
(
form_id
,
ignore_layout
,
editable_mode
,
message
)
else
:
redirect_url
=
'%s?selection_index=%s&selection_name=%s&ignore_layout:int=%s&editable_mode=%s&portal_status_message=%s'
%
(
form_id
,
selection_index
,
selection_name
,
ignore_layout
,
editable_mode
,
message
)
if
silent_mode
:
return
result
,
'redirect'
return
context
.
Base_redirect
(
redirect_url
)
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/Base_newContentFromJS.py
View file @
ef1100d9
...
@@ -34,4 +34,4 @@ for f in form.get_fields():
...
@@ -34,4 +34,4 @@ for f in form.get_fields():
redirect_document
=
context
.
newContent
(
portal_type
=
doaction_param_list
[
'portal_type'
])
redirect_document
=
context
.
newContent
(
portal_type
=
doaction_param_list
[
'portal_type'
])
return
redirect_document
.
Base_redirect
()
return
redirect_document
.
Base_redirect
(
keep_items
=
{
'portal_status_message'
:
'Document created.'
}
)
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/Base_redirect.py
View file @
ef1100d9
...
@@ -7,6 +7,8 @@
...
@@ -7,6 +7,8 @@
be redundant.
be redundant.
"""
"""
from
ZTUtils
import
make_query
from
ZTUtils
import
make_query
import
json
request_form
=
context
.
REQUEST
.
form
request_form
=
context
.
REQUEST
.
form
request_form
.
update
(
kw
)
request_form
.
update
(
kw
)
request_form
=
context
.
ERP5Site_filterParameterList
(
request_form
)
request_form
=
context
.
ERP5Site_filterParameterList
(
request_form
)
...
@@ -32,4 +34,14 @@ context.Base_prepareCorsResponse(RESPONSE=response)
...
@@ -32,4 +34,14 @@ context.Base_prepareCorsResponse(RESPONSE=response)
# http://en.wikipedia.org/wiki/Post/Redirect/Get
# http://en.wikipedia.org/wiki/Post/Redirect/Get
response
.
setStatus
(
201
)
response
.
setStatus
(
201
)
response
.
setHeader
(
"X-Location"
,
"urn:jio:get:%s"
%
context
.
getRelativeUrl
())
response
.
setHeader
(
"X-Location"
,
"urn:jio:get:%s"
%
context
.
getRelativeUrl
())
return
result_dict
=
{
'portal_status_message'
:
"%s"
%
keep_items
.
pop
(
"portal_status_message"
,
""
),
'_links'
:
{
"self"
:
{
# XXX Include query parameters
"href"
:
context
.
Base_getRequestUrl
()
}
}
}
return
json
.
dumps
(
result_dict
,
indent
=
2
)
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