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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Georgios Dagkakis
erp5
Commits
c6312e40
Commit
c6312e40
authored
Feb 02, 2018
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5_web_renderjs_ui] Add actions list in the contextual menu
parent
f2dedaed
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
8 deletions
+47
-8
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_panel_html.html
...plateItem/web_page_module/rjs_gadget_erp5_panel_html.html
+7
-1
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_panel_html.xml
...mplateItem/web_page_module/rjs_gadget_erp5_panel_html.xml
+2
-2
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_panel_js.js
...hTemplateItem/web_page_module/rjs_gadget_erp5_panel_js.js
+36
-3
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_panel_js.xml
...TemplateItem/web_page_module/rjs_gadget_erp5_panel_js.xml
+2
-2
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_panel_html.html
View file @
c6312e40
...
...
@@ -63,12 +63,18 @@
<
a
data
-
i18n
=
"
{{title}}
"
class
=
"
ui-body-inherit {{class_name}}
"
href
=
"
{{href}}
"
>
{{
title
}}
<
/a
>
<
/dd
>
{{
/
each
}}
<
dt
class
=
"
ui-content-title ui-body-c ui-btn ui-btn-icon-left ui-icon-
cogs
"
data
-
i18n
=
"
Decisions
"
>
Decisions
<
/dt
>
<
dt
class
=
"
ui-content-title ui-body-c ui-btn ui-btn-icon-left ui-icon-
random
"
data
-
i18n
=
"
Decisions
"
>
Decisions
<
/dt
>
{{
#
each
workflow_list
}}
<
dd
data
-
role
=
"
listview
"
data
-
theme
=
"
c
"
data
-
inset
=
"
true
"
class
=
"
document-listview
"
>
<
a
data
-
i18n
=
"
{{title}}
"
class
=
"
ui-body-inherit {{class_name}}
"
href
=
"
{{href}}
"
>
{{
title
}}
<
/a
>
<
/dd
>
{{
/
each
}}
<
dt
class
=
"
ui-content-title ui-body-c ui-btn ui-btn-icon-left ui-icon-cogs
"
data
-
i18n
=
"
Actions
"
>
Actions
<
/dt
>
{{
#
each
action_list
}}
<
dd
data
-
role
=
"
listview
"
data
-
theme
=
"
c
"
data
-
inset
=
"
true
"
class
=
"
document-listview
"
>
<
a
data
-
i18n
=
"
{{title}}
"
class
=
"
ui-body-inherit {{class_name}}
"
href
=
"
{{href}}
"
>
{{
title
}}
<
/a
>
<
/dd
>
{{
/
each
}}
</script>
<!-- custom script -->
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_panel_html.xml
View file @
c6312e40
...
...
@@ -234,7 +234,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
964.5
0043.44596.52002
</string>
</value>
<value>
<string>
964.5
4335.52932.23808
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>
151
5762048.41
</float>
<float>
151
7566016.77
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_panel_js.js
View file @
c6312e40
...
...
@@ -53,18 +53,23 @@
var
erp5_document
=
options
.
erp5_document
,
workflow_list
,
view_list
,
action_list
,
view
=
options
.
view
,
i
,
context
=
this
;
if
(
erp5_document
!==
undefined
)
{
workflow_list
=
erp5_document
.
_links
.
action_workflow
||
[];
view_list
=
erp5_document
.
_links
.
action_object_view
||
[];
action_list
=
erp5_document
.
_links
.
action_object_jio_action
||
[];
if
(
workflow_list
.
constructor
!==
Array
)
{
workflow_list
=
[
workflow_list
];
}
if
(
view_list
.
constructor
!==
Array
)
{
view_list
=
[
view_list
];
}
if
(
action_list
.
constructor
!==
Array
)
{
action_list
=
[
action_list
];
}
if
(
view
===
'
view
'
)
{
for
(
i
=
0
;
i
<
view_list
.
length
;
i
+=
1
)
{
view_list
[
i
].
class_name
=
view_list
[
i
].
name
===
view
?
'
active
'
:
''
;
...
...
@@ -76,17 +81,22 @@
for
(
i
=
0
;
i
<
view_list
.
length
;
i
+=
1
)
{
view_list
[
i
].
class_name
=
view_list
[
i
].
href
===
view
?
'
active
'
:
''
;
}
for
(
i
=
0
;
i
<
action_list
.
length
;
i
+=
1
)
{
action_list
[
i
].
class_name
=
action_list
[
i
].
href
===
view
?
'
active
'
:
''
;
}
}
// Prevent has much as possible to modify the DOM panel
// stateChange prefer to compare strings
workflow_list
=
JSON
.
stringify
(
workflow_list
);
view_list
=
JSON
.
stringify
(
view_list
);
action_list
=
JSON
.
stringify
(
action_list
);
}
return
context
.
getUrlParameter
(
'
editable
'
)
.
push
(
function
(
editable
)
{
return
context
.
changeState
({
workflow_list
:
workflow_list
,
view_list
:
view_list
,
action_list
:
action_list
,
global
:
true
,
editable
:
options
.
editable
||
editable
||
false
});
...
...
@@ -206,6 +216,7 @@
if
((
this
.
state
.
global
===
true
)
&&
(
modification_dict
.
hasOwnProperty
(
"
editable
"
)
||
modification_dict
.
hasOwnProperty
(
"
workflow_list
"
)
||
modification_dict
.
hasOwnProperty
(
"
action_list
"
)
||
modification_dict
.
hasOwnProperty
(
"
view_list
"
)))
{
if
(
this
.
state
.
view_list
===
undefined
)
{
queue
...
...
@@ -218,7 +229,8 @@
var
i
=
0
,
promise_list
=
[],
workflow_list
=
JSON
.
parse
(
gadget
.
state
.
workflow_list
),
view_list
=
JSON
.
parse
(
gadget
.
state
.
view_list
);
view_list
=
JSON
.
parse
(
gadget
.
state
.
view_list
),
action_list
=
JSON
.
parse
(
gadget
.
state
.
action_list
);
for
(
i
=
0
;
i
<
workflow_list
.
length
;
i
+=
1
)
{
promise_list
.
push
(
...
...
@@ -242,14 +254,27 @@
})
);
}
for
(
i
=
0
;
i
<
action_list
.
length
;
i
+=
1
)
{
promise_list
.
push
(
gadget
.
getUrlFor
({
command
:
'
change
'
,
options
:
{
view
:
action_list
[
i
].
href
,
page
:
undefined
}
})
);
}
return
RSVP
.
all
(
promise_list
);
})
.
push
(
function
(
result_list
)
{
var
i
,
result_workflow_list
=
[],
result_view_list
=
[],
result_action_list
=
[],
workflow_list
=
JSON
.
parse
(
gadget
.
state
.
workflow_list
),
view_list
=
JSON
.
parse
(
gadget
.
state
.
view_list
);
view_list
=
JSON
.
parse
(
gadget
.
state
.
view_list
),
action_list
=
JSON
.
parse
(
gadget
.
state
.
action_list
);
for
(
i
=
0
;
i
<
workflow_list
.
length
;
i
+=
1
)
{
result_workflow_list
.
push
({
...
...
@@ -265,9 +290,17 @@
href
:
result_list
[
i
+
workflow_list
.
length
]
});
}
for
(
i
=
0
;
i
<
action_list
.
length
;
i
+=
1
)
{
result_action_list
.
push
({
title
:
action_list
[
i
].
title
,
class_name
:
action_list
[
i
].
class_name
,
href
:
result_list
[
i
+
action_list
.
length
]
});
}
gadget
.
element
.
querySelector
(
"
dl
"
).
innerHTML
=
panel_template_body_desktop
({
workflow_list
:
result_workflow_list
,
view_list
:
result_view_list
view_list
:
result_view_list
,
action_list
:
result_action_list
});
});
}
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_panel_js.xml
View file @
c6312e40
...
...
@@ -230,7 +230,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
965.146
66.28011.17715
</string>
</value>
<value>
<string>
965.146
97.10360.3993
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>
151756
5753.1
</float>
<float>
151756
7841.66
</float>
<string>
UTC
</string>
</tuple>
</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