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
alecs_myu
erp5
Commits
e0d26048
Commit
e0d26048
authored
Jun 20, 2019
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5_web_renderjs_ui] Display update action title if configured
parent
6949fb89
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
8 deletions
+24
-8
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/ERP5Document_getHateoas.py
...rtal_skins/erp5_hal_json_style/ERP5Document_getHateoas.py
+1
-0
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_dialog_js.js
...Item/web_page_module/rjs_gadget_erp5_pt_form_dialog_js.js
+21
-6
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_dialog_js.xml
...tem/web_page_module/rjs_gadget_erp5_pt_form_dialog_js.xml
+2
-2
No files found.
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/ERP5Document_getHateoas.py
View file @
e0d26048
...
@@ -1129,6 +1129,7 @@ def renderFormDefinition(form, response_dict):
...
@@ -1129,6 +1129,7 @@ def renderFormDefinition(form, response_dict):
response_dict
[
"pt"
]
=
form
.
pt
response_dict
[
"pt"
]
=
form
.
pt
response_dict
[
"action"
]
=
form
.
action
response_dict
[
"action"
]
=
form
.
action
response_dict
[
"update_action"
]
=
form
.
update_action
response_dict
[
"update_action"
]
=
form
.
update_action
response_dict
[
"update_action_title"
]
=
Base_translateString
(
form
.
update_action_title
)
def
statusLevelToString
(
level
):
def
statusLevelToString
(
level
):
"""Transform any level format to lowercase string representation"""
"""Transform any level format to lowercase string representation"""
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_dialog_js.js
View file @
e0d26048
/*jslint nomen: true, indent: 2, maxerr: 3 */
/*jslint nomen: true, indent: 2, maxerr: 3 */
/*global window, rJS, RSVP, calculatePageTitle, Handlebars, ensureArray */
/*global window, document, rJS, RSVP, calculatePageTitle, Handlebars,
(
function
(
window
,
rJS
,
RSVP
,
calculatePageTitle
,
Handlebars
,
ensureArray
)
{
ensureArray */
(
function
(
window
,
document
,
rJS
,
RSVP
,
calculatePageTitle
,
Handlebars
,
ensureArray
)
{
"
use strict
"
;
"
use strict
"
;
function
checkValidity
()
{
function
checkValidity
()
{
...
@@ -173,6 +175,7 @@
...
@@ -173,6 +175,7 @@
erp5_form
:
options
.
erp5_form
||
{},
erp5_form
:
options
.
erp5_form
||
{},
// editable: true, // ignore global editable state (be always editable)
// editable: true, // ignore global editable state (be always editable)
has_update_action
:
Boolean
(
options
.
form_definition
.
update_action
),
has_update_action
:
Boolean
(
options
.
form_definition
.
update_action
),
update_action_title
:
options
.
form_definition
.
update_action_title
,
// pass extended_search from previous view in case any gadget is curious
// pass extended_search from previous view in case any gadget is curious
extended_search
:
extended_search
,
extended_search
:
extended_search
,
redirect_to_parent
:
options
.
erp5_document
.
_embedded
.
_view
.
field_your_redirect_to_parent
!==
undefined
redirect_to_parent
:
options
.
erp5_document
.
_embedded
.
_view
.
field_your_redirect_to_parent
!==
undefined
...
@@ -221,13 +224,25 @@
...
@@ -221,13 +224,25 @@
return
new
RSVP
.
Queue
()
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
.
push
(
function
()
{
// Set the dialog button
// Set the dialog button
if
(
modification_dict
.
hasOwnProperty
(
'
has_update_action
'
))
{
if
(
modification_dict
.
hasOwnProperty
(
'
has_update_action
'
)
||
modification_dict
.
hasOwnProperty
(
'
update_action_title
'
))
{
return
form_gadget
.
translateHtml
(
dialog_button_template
({
return
form_gadget
.
translateHtml
(
dialog_button_template
({
show_update_button
:
form_gadget
.
state
.
has_update_action
show_update_button
:
form_gadget
.
state
.
has_update_action
}))
}))
.
push
(
function
(
html
)
{
.
push
(
function
(
html
)
{
form_gadget
.
element
.
querySelector
(
'
.dialog_button_container
'
)
var
div
=
document
.
createElement
(
'
div
'
),
.
innerHTML
=
html
;
dialog_button_container
=
form_gadget
.
element
.
querySelector
(
'
.dialog_button_container
'
);
div
.
innerHTML
=
html
;
if
(
form_gadget
.
state
.
update_action_title
)
{
div
.
querySelector
(
'
button[name="action_update"]
'
)
.
textContent
=
form_gadget
.
state
.
form_definition
.
update_action_title
;
}
while
(
dialog_button_container
.
firstChild
)
{
dialog_button_container
.
firstChild
.
remove
();
}
dialog_button_container
.
innerHTML
=
div
.
innerHTML
;
});
});
}
}
})
})
...
@@ -312,4 +327,4 @@
...
@@ -312,4 +327,4 @@
}
}
});
});
}(
window
,
rJS
,
RSVP
,
calculatePageTitle
,
Handlebars
,
ensureArray
));
}(
window
,
document
,
rJS
,
RSVP
,
calculatePageTitle
,
Handlebars
,
ensureArray
));
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_dialog_js.xml
View file @
e0d26048
...
@@ -222,7 +222,7 @@
...
@@ -222,7 +222,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
976.
20956.15292.37495
</string>
</value>
<value>
<string>
976.
34018.48815.32699
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -240,7 +240,7 @@
...
@@ -240,7 +240,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
156
0246152.37
</float>
<float>
156
1041762.03
</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