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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Sebastian
erp5
Commits
c34015d6
Commit
c34015d6
authored
May 03, 2016
by
Cédric Le Ninivin
Committed by
Cédric Le Ninivin
May 24, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_web_renderjs_ui: prepare code to display object action on action gadget
/reviewed-on
nexedi/erp5!110
parent
26e2d0bc
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
46 deletions
+57
-46
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_actionpage_html.html
...m/web_page_module/rjs_gadget_erp5_pt_actionpage_html.html
+2
-16
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_actionpage_js.js
...eItem/web_page_module/rjs_gadget_erp5_pt_actionpage_js.js
+55
-30
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_actionpage_html.html
View file @
c34015d6
...
@@ -16,32 +16,18 @@
...
@@ -16,32 +16,18 @@
<script
src=
"gadget_erp5_global.js"
type=
"text/javascript"
></script>
<script
src=
"gadget_erp5_global.js"
type=
"text/javascript"
></script>
<script
src=
"gadget_erp5_page_action.js"
type=
"text/javascript"
></script>
<script
src=
"gadget_erp5_page_action.js"
type=
"text/javascript"
></script>
<!-- XXX need theme here currently -->
<script
id=
"table-template"
type=
"text/x-handlebars-template"
>
<script
id=
"table-template"
type=
"text/x-handlebars-template"
>
<
section
class
=
"
ui-content-header-plain
"
>
<
section
class
=
"
ui-content-header-plain
"
>
<
h3
class
=
"
ui-content-title ui-body-c
"
data
-
i18n
=
"
[last]{{definition_i18n}}
"
>
<
h3
class
=
"
ui-content-title ui-body-c
"
data
-
i18n
=
"
[last]{{definition_i18n}}
"
>
<
span
class
=
"
ui-icon ui-icon-custom ui-icon-
random
"
>&
nbsp
;
<
/span
>
<
span
class
=
"
ui-icon ui-icon-custom ui-icon-
{{definition_icon}}
"
>&
nbsp
;
<
/span
>
{{
definition_title
}}
{{
definition_title
}}
<
/h3
>
<
/h3
>
<
/section
>
<
/section
>
<
ul
data
-
role
=
"
listview
"
data
-
theme
=
"
c
"
data
-
inset
=
"
true
"
class
=
"
document-listview
"
>
<
ul
data
-
role
=
"
listview
"
data
-
theme
=
"
c
"
data
-
inset
=
"
true
"
class
=
"
document-listview
"
>
{{
#
each
documentlist
}}
{{
#
each
documentlist
}}
<
li
><
a
data
-
i18n
=
"
{{
i18n
}}
"
class
=
"
ui-body-inherit
"
href
=
"
{{link}}
"
>
{{
title
}}
<
/a></
li
>
<
li
><
a
data
-
i18n
=
"
{{
title
}}
"
class
=
"
ui-body-inherit
"
href
=
"
{{link}}
"
>
{{
title
}}
<
/a></
li
>
{{
/
each
}}
{{
/
each
}}
<
/ul
>
<
/ul
>
{{
#
if
action
}}
<
section
class
=
"
ui-content-header-plain
"
>
<
h3
class
=
"
ui-content-title ui-body-c
"
data
-
i18n
=
"
[last]{{section_i18n}}
"
>
<
span
class
=
"
ui-icon ui-icon-custom ui-icon-random
"
>&
nbsp
;
<
/span
>
{{
section_title
}}
<
/h3
>
<
/section
>
<
ul
data
-
role
=
"
listview
"
data
-
theme
=
"
c
"
data
-
inset
=
"
true
"
class
=
"
document-listview
"
>
<
li
><
a
data
-
i18n
=
"
{{action.i18n}}
"
class
=
"
ui-body-inherit
"
href
=
"
{{action.link}}
"
>
{{
action
.
title
}}
<
/a></
li
>
<
/ul
>
{{
/
if
}}
</script>
</script>
</head>
</head>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_actionpage_js.js
View file @
c34015d6
...
@@ -45,63 +45,88 @@
...
@@ -45,63 +45,88 @@
var
gadget
=
this
,
var
gadget
=
this
,
erp5_document
,
erp5_document
,
result_list
,
result_list
,
action
,
view_list
,
view
_list
;
action
_list
;
return
gadget
.
jio_getAttachment
(
options
.
jio_key
,
"
links
"
)
return
gadget
.
jio_getAttachment
(
options
.
jio_key
,
"
links
"
)
.
push
(
function
(
result
)
{
.
push
(
function
(
result
)
{
var
i
,
var
i
,
i_len
,
promise_list
=
[
promise_list
=
[
gadget
.
getUrlFor
({
command
:
'
change
'
,
options
:
{
page
:
undefined
}})
gadget
.
getUrlFor
({
command
:
'
change
'
,
options
:
{
page
:
undefined
}})
];
];
erp5_document
=
result
;
erp5_document
=
result
;
view_list
=
erp5_document
.
_links
.
action_workflow
||
[];
view_list
=
erp5_document
.
_links
.
action_workflow
||
[];
action_list
=
[];
// erp5_document._links.action_object_action
if
(
view_list
.
constructor
!==
Array
)
{
if
(
view_list
.
constructor
!==
Array
)
{
view_list
=
[
view_list
];
view_list
=
[
view_list
];
}
}
if
(
action_list
.
constructor
!==
Array
)
{
view_list
=
[
view_list
];
}
for
(
i
=
0
;
i
<
view_list
.
length
;
i
+=
1
)
{
for
(
i
=
0
;
i
<
view_list
.
length
;
i
+=
1
)
{
promise_list
.
push
(
gadget
.
getUrlFor
({
command
:
'
change
'
,
options
:
{
view
:
view_list
[
i
].
href
,
page
:
undefined
,
editable
:
options
.
editable
}}));
promise_list
.
push
(
gadget
.
getUrlFor
({
command
:
'
change
'
,
options
:
{
view
:
view_list
[
i
].
href
,
page
:
undefined
,
editable
:
options
.
editable
}
})
);
}
}
if
(
erp5_document
.
_links
.
action_object_clone_action
)
{
if
(
erp5_document
.
_links
.
action_object_clone_action
)
{
view_list
.
push
(
erp5_document
.
_links
.
action_object_clone_action
);
action_list
.
push
(
erp5_document
.
_links
.
action_object_clone_action
);
promise_list
.
push
(
gadget
.
getUrlFor
({
}
for
(
i
=
0
,
i_len
=
action_list
.
length
;
i
<
i_len
;
i
+=
1
)
{
promise_list
.
push
(
gadget
.
getUrlFor
({
command
:
'
change
'
,
command
:
'
change
'
,
options
:
{
options
:
{
view
:
erp5_document
.
_links
.
action_object_clone_action
.
href
,
view
:
action_list
[
i
]
.
href
,
page
:
undefined
,
page
:
undefined
,
editable
:
true
editable
:
true
}
}
}));
})
);
}
}
return
RSVP
.
all
(
promise_list
);
return
RSVP
.
all
(
promise_list
);
})
})
.
push
(
function
(
all_result
)
{
.
push
(
function
(
all_result
)
{
var
i
,
var
i
,
tab_list
=
[];
tab_list
=
[],
action_tab_list
=
[];
result_list
=
all_result
;
result_list
=
all_result
;
for
(
i
=
1
;
i
<
all_resul
t
.
length
;
i
+=
1
)
{
for
(
i
=
0
;
i
<
view_lis
t
.
length
;
i
+=
1
)
{
tab_list
.
push
({
tab_list
.
push
({
title
:
view_list
[
i
-
1
].
title
,
title
:
view_list
[
i
].
title
,
link
:
all_result
[
i
],
link
:
all_result
[
i
+
1
],
i18n
:
view_list
[
i
-
1
].
title
i18n
:
view_list
[
i
].
title
});
});
}
}
if
(
erp5_document
.
_links
.
action_object_clone_action
)
{
for
(
i
=
0
;
i
<
action_list
.
length
;
i
+=
1
)
{
action
=
tab_list
.
pop
();
action_tab_list
.
push
({
title
:
action_list
[
i
].
title
,
link
:
all_result
[
i
+
1
+
view_list
.
length
],
i18n
:
action_list
[
i
].
title
});
}
}
return
RSVP
.
all
([
return
RSVP
.
all
([
gadget
.
translateHtml
(
table_template
({
gadget
.
translateHtml
(
table_template
({
definition_title
:
"
Workflow Transitions
"
,
definition_title
:
"
Workflow Transitions
"
,
definition_icon
:
"
random
"
,
documentlist
:
tab_list
,
documentlist
:
tab_list
,
definition_i18n
:
"
Workflow-Transitions
"
,
definition_i18n
:
"
Workflow-Transitions
"
section_i18n
:
"
Actions
"
,
})
+
table_template
({
section_title
:
"
Actions
"
,
definition_i18n
:
"
Actions
"
,
action
:
action
definition_title
:
"
Actions
"
,
})),
definition_icon
:
"
gear
"
,
documentlist
:
action_tab_list
})
),
calculatePageTitle
(
gadget
,
erp5_document
)
calculatePageTitle
(
gadget
,
erp5_document
)
]);
]);
})
})
...
...
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