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
1
Merge Requests
1
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
Cédric Le Ninivin
erp5
Commits
24121747
Commit
24121747
authored
Mar 30, 2016
by
Cédric Le Ninivin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_web_renderjs_ui: Add Tabs on Action Gadget
parent
c6c7f700
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
63 additions
and
32 deletions
+63
-32
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
+1
-15
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
+62
-17
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_actionpage_html.html
View file @
24121747
...
...
@@ -19,7 +19,7 @@
<script
id=
"table-template"
type=
"text/x-handlebars-template"
>
<
section
class
=
"
ui-content-header-plain
"
>
<
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
}}
<
/h3
>
<
/section
>
...
...
@@ -29,20 +29,6 @@
<
li
><
a
data
-
i18n
=
"
{{i18n}}
"
class
=
"
ui-body-inherit
"
href
=
"
{{link}}
"
>
{{
title
}}
<
/a></
li
>
{{
/
each
}}
<
/ul
>
{{
#
if
action_tab_list
}}
<
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
"
>
{{
#
each
action_tab_list
}}
<
li
><
a
data
-
i18n
=
"
{{i18n}}
"
class
=
"
ui-body-inherit
"
href
=
"
{{link}}
"
>
{{
title
}}
<
/a></
li
>
{{
/
each
}}
<
/ul
>
{{
/
if
}}
</script>
</head>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_actionpage_js.js
View file @
24121747
...
...
@@ -46,7 +46,9 @@
erp5_document
,
result_list
,
view_list
,
action_list
;
workflow_list
,
action_list
,
inner_html
;
return
gadget
.
jio_getAttachment
(
options
.
jio_key
,
"
links
"
)
.
push
(
function
(
result
)
{
...
...
@@ -56,17 +58,32 @@
gadget
.
getUrlFor
({
command
:
'
change
'
,
options
:
{
page
:
"
breadcrumb
"
}})
];
erp5_document
=
result
;
vie
w_list
=
erp5_document
.
_links
.
action_workflow
||
[];
workflo
w_list
=
erp5_document
.
_links
.
action_workflow
||
[];
action_list
=
erp5_document
.
_links
.
action_object_action
||
[];
view_list
=
erp5_document
.
_links
.
view
;
if
(
view_list
.
constructor
!==
Array
)
{
view_list
=
[
view_list
];
}
if
(
workflow_list
.
constructor
!==
Array
)
{
workflow_list
=
[
workflow_list
];
}
if
(
action_list
.
constructor
!==
Array
)
{
view_list
=
[
view
_list
];
action_list
=
[
action
_list
];
}
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
:
undefined
}}));
promise_list
.
push
(
gadget
.
getUrlFor
({
command
:
'
change
'
,
options
:
{
view
:
"
view
"
,
page
:
undefined
,
editable
:
undefined
}}));
for
(
i
=
0
;
i
<
view_list
.
length
-
1
;
i
+=
1
)
{
promise_list
.
push
(
gadget
.
getUrlFor
({
command
:
'
change
'
,
options
:
{
view
:
view_list
[
i
].
href
,
editable
:
true
,
page
:
undefined
}}));
}
for
(
i
=
0
;
i
<
workflow_list
.
length
;
i
+=
1
)
{
promise_list
.
push
(
gadget
.
getUrlFor
({
command
:
'
change
'
,
options
:
{
view
:
workflow_list
[
i
].
href
,
page
:
undefined
,
editable
:
undefined
}}));
}
if
(
erp5_document
.
_links
.
action_object_clone_action
)
{
action_list
.
push
(
erp5_document
.
_links
.
action_object_clone_action
);
...
...
@@ -77,34 +94,62 @@
return
RSVP
.
all
(
promise_list
);
})
.
push
(
function
(
all_result
)
{
var
i
,
var
i
,
j
,
tab_list
=
[],
workflow_action_list
=
[],
action_tab_list
=
[];
result_list
=
all_result
;
for
(
i
=
0
;
i
<
view_list
.
length
;
i
+=
1
)
{
j
=
3
;
for
(
i
=
0
;
i
<
view_list
.
length
-
1
;
i
+=
1
)
{
tab_list
.
push
({
title
:
view_list
[
i
].
title
,
link
:
all_result
[
i
+
2
],
link
:
all_result
[
j
],
i18n
:
view_list
[
i
].
title
});
j
+=
1
;
}
for
(
i
=
0
;
i
<
workflow_list
.
length
;
i
+=
1
)
{
workflow_action_list
.
push
({
title
:
workflow_list
[
i
].
title
,
link
:
all_result
[
j
],
i18n
:
workflow_list
[
i
].
title
});
j
+=
1
;
}
for
(
i
=
0
;
i
<
action_list
.
length
;
i
+=
1
)
{
action_tab_list
.
push
({
title
:
action_list
[
i
].
title
,
link
:
all_result
[
i
+
view_list
.
length
+
2
],
link
:
all_result
[
j
],
i18n
:
action_list
[
i
].
title
});
j
+=
1
;
}
return
gadget
.
translateHtml
(
table_template
({
inner_html
=
table_template
({
definition_title
:
"
Views
"
,
definition_i18n
:
"
Views
"
,
definition_icon
:
"
eye
"
,
documentlist
:
[{
title
:
view_list
[
0
].
title
,
link
:
all_result
[
2
]
}]
})
+
table_template
({
definition_title
:
"
Editables
"
,
definition_i18n
:
"
Editables
"
,
definition_icon
:
"
edit
"
,
documentlist
:
tab_list
})
+
table_template
({
definition_title
:
"
Workflow Transitions
"
,
documentlist
:
tab
_list
,
documentlist
:
workflow_action
_list
,
definition_i18n
:
"
Workflow-Transitions
"
,
section_i18n
:
"
Actions
"
,
section_title
:
"
Actions
"
,
action_tab_list
:
action_tab_list
}));
definition_icon
:
"
random
"
})
+
table_template
({
definition_title
:
"
Actions
"
,
definition_i18n
:
"
Actions
"
,
documentlist
:
action_tab_list
,
definition_icon
:
"
gear
"
});
return
gadget
.
translateHtml
(
inner_html
);
})
.
push
(
function
(
my_translated_html
)
{
gadget
.
props
.
element
.
innerHTML
=
my_translated_html
;
...
...
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