Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ayush Tiwari
erp5
Commits
e741f6e5
Commit
e741f6e5
authored
Nov 06, 2017
by
Ayush Tiwari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bt5_config: Add color schema to differentiate between states
parent
a1b3d8e0
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
16 deletions
+46
-16
product/ERP5/bootstrap/erp5_business_package/SkinTemplateItem/portal_skins/erp5_business_package/business_manager_select_action_gadget.css.css
...ess_package/business_manager_select_action_gadget.css.css
+17
-2
product/ERP5/bootstrap/erp5_business_package/SkinTemplateItem/portal_skins/erp5_business_package/business_manager_select_action_gadget.html.html
...s_package/business_manager_select_action_gadget.html.html
+2
-2
product/ERP5/bootstrap/erp5_business_package/SkinTemplateItem/portal_skins/erp5_business_package/business_manager_select_action_gadget.js.js
...iness_package/business_manager_select_action_gadget.js.js
+27
-12
No files found.
product/ERP5/bootstrap/erp5_business_package/SkinTemplateItem/portal_skins/erp5_business_package/business_manager_select_action_gadget.css.css
View file @
e741f6e5
...
@@ -55,3 +55,18 @@ li > input:first-child:checked ~ ul {
...
@@ -55,3 +55,18 @@ li > input:first-child:checked ~ ul {
li
>
input
:first-child:checked
+
label
:before
{
li
>
input
:first-child:checked
+
label
:before
{
content
:
'-'
;
content
:
'-'
;
}
}
/* Default color should be green for no state change */
li
>
input
[
name
$
=
"path"
]
+
label
{
color
:
green
;
}
/* if state is Changed, turn the color orange of child and parent path */
li
>
input
[
name
$
=
"path"
]
+
label
[
state
=
'Changed'
]
{
color
:
orange
;
}
/* if state is Deleted, turn the color red of child and parent path */
li
>
input
[
name
$
=
"path"
]
+
label
[
state
=
'Deleted'
]
{
color
:
red
;
}
product/ERP5/bootstrap/erp5_business_package/SkinTemplateItem/portal_skins/erp5_business_package/business_manager_select_action_gadget.html.html
View file @
e741f6e5
...
@@ -13,10 +13,10 @@
...
@@ -13,10 +13,10 @@
{{
#
if
tree_html
}}
{{
#
if
tree_html
}}
<
input
type
=
"
checkbox
"
id
=
"
{{id}}
"
/>
<
input
type
=
"
checkbox
"
id
=
"
{{id}}
"
/>
<
label
for
=
"
{{id}}
"
><
/label
>
<
label
for
=
"
{{id}}
"
><
/label
>
<
label
><
input
type
=
"
checkbox
"
/
>
{{
title
}}
<
/label
>
<
input
type
=
"
checkbox
"
id
=
"
{{id}}
"
name
=
'
parent_path
'
/><
label
state
=
"
{{state}}
"
>
{{
title
}}
<
/label
>
{{
else
}}
{{
else
}}
<
label
><
/label
>
<
label
><
/label
>
<
label
><
input
type
=
"
checkbox
"
name
=
"
item_path_list:list
"
/
>
{{
title
}}
<
/label
>
<
input
type
=
"
checkbox
"
id
=
"
item_path_list:list
"
name
=
'
child_path
'
/><
label
state
=
"
{{state}}
"
>
{{
title
}}
<
/label
>
{{
/
if
}}
{{
/
if
}}
{{
#
if
tree_html
}}
{{
#
if
tree_html
}}
...
...
product/ERP5/bootstrap/erp5_business_package/SkinTemplateItem/portal_skins/erp5_business_package/business_manager_select_action_gadget.js.js
View file @
e741f6e5
...
@@ -56,15 +56,17 @@
...
@@ -56,15 +56,17 @@
key
,
key
,
node_list
=
[],
node_list
=
[],
subid
,
subid
,
state
,
node
;
node
;
if
(
tree
.
hasOwnProperty
(
'
sub
'
))
{
if
(
tree
.
hasOwnProperty
(
'
sub
'
))
{
for
(
key
in
tree
.
sub
)
{
for
(
key
in
tree
.
sub
)
{
if
(
tree
.
sub
.
hasOwnProperty
(
key
))
{
if
(
tree
.
sub
.
hasOwnProperty
(
key
))
{
subid
=
id
+
key
;
subid
=
id
+
key
;
state
=
tree
.
sub
[
key
].
value
;
node
=
{
id
:
subid
,
title
:
key
};
node
=
{
id
:
subid
,
title
:
key
};
if
(
tree
.
sub
[
key
].
hasOwnProperty
(
'
value
'
))
{
if
(
tree
.
sub
[
key
].
hasOwnProperty
(
'
value
'
))
{
node
.
title
+=
'
(
'
+
tree
.
sub
[
key
].
value
+
'
)
'
node
.
state
=
tree
.
sub
[
key
].
value
;
}
}
if
(
tree
.
sub
[
key
].
hasOwnProperty
(
'
sub
'
))
{
if
(
tree
.
sub
[
key
].
hasOwnProperty
(
'
sub
'
))
{
node
.
tree_html
=
buildTreeHTML
(
subid
,
tree
.
sub
[
key
]);
node
.
tree_html
=
buildTreeHTML
(
subid
,
tree
.
sub
[
key
]);
...
@@ -77,34 +79,47 @@
...
@@ -77,34 +79,47 @@
return
html
;
return
html
;
}
}
function
getParentNode
(
data
,
childName
)
{
// Get the tree created from `item_path_list` and use it to find out parent
}
rJS
(
window
)
rJS
(
window
)
.
declareMethod
(
'
render
'
,
function
(
options
)
{
.
declareMethod
(
'
render
'
,
function
(
options
)
{
var
parameter_dict
=
JSON
.
parse
(
options
.
value
),
var
parameter_dict
=
JSON
.
parse
(
options
.
value
),
item_path_list
=
parameter_dict
.
item_path_list
;
item_path_list
=
parameter_dict
.
item_path_list
;
this
.
action_url
=
parameter_dict
.
action_url
;
this
.
action_url
=
parameter_dict
.
action_url
;
var
node_list
=
buildTreeHTML
(
'
tree
'
,
convertPathListToTree
(
item_path_list
));
var
html_tree
=
buildTreeHTML
(
'
tree
'
,
convertPathListToTree
(
item_path_list
));
this
.
element
.
innerHTML
=
buildTreeHTML
(
'
tree
'
,
convertPathListToTree
(
item_path_list
));
this
.
element
.
innerHTML
=
html_tree
console
.
log
(
node_list
);
console
.
log
(
html_tree
);
})
})
.
onEvent
(
'
change
'
,
function
(
evt
)
{
.
onEvent
(
'
change
'
,
function
(
evt
)
{
if
((
evt
.
target
.
type
===
'
checkbox
'
)
&&
(
!
evt
.
target
.
id
))
{
if
((
evt
.
target
.
type
===
'
checkbox
'
)
&&
(
evt
.
target
.
name
)
&&
(
evt
.
target
.
id
))
{
// XXX Update the checkbox state of children (and parents too)
// XXX Update the checkbox state of children (and parents too)
// querySelectorAll and parent ancestors
// Rules:
// var parentSelected = this.element.querySelectorAll('input[type=checkbox][name=""]:checked')
// 1 . State of parent shouldn't be dependent on the state of children
var
val
=
this
.
element
.
querySelectorAll
(
'
input[type=checkbox][name="item_path_list:list"]:checked
'
);
// and vice-versa if both of them some value(i.e, if there has been
// any change in the path).
// 2 . If parent has no value:
// - All children checked -> Parent checked
// - Parent checked -> All children checked
var
childrenSelected
=
this
.
element
.
querySelectorAll
(
'
input[type=checkbox][id="item_path_list:list"][name="child_path"]:checked
'
);
var
parentSelected
=
this
.
element
.
querySelectorAll
(
'
input[type=checkbox][id^="tree"][name="parent_path"]:checked
'
);
// Spread the result value so that we can use map on it
// Spread the result value so that we can use map on it
var
labelValues
=
[...
val
].
map
(
function
(
x
){
var
parentValues
=
[...
parentSelected
].
map
(
function
(
x
){
return
x
.
nextSibling
.
data
;
return
x
.
nextSibling
.
textContent
;
});
});
var
childrenValues
=
[...
childrenSelected
].
map
(
function
(
x
){
return
x
.
nextSibling
.
textContent
;
})
console
.
log
(
'
Update the checkbox state of children (and parents too)
'
);
console
.
log
(
'
Update the checkbox state of children (and parents too)
'
);
console
.
log
(
labelValues
);
}
}
},
false
,
false
)
},
false
,
false
)
.
declareMethod
(
'
getContent
'
,
function
(
options
)
{
.
declareMethod
(
'
getContent
'
,
function
(
options
)
{
var
input_list
=
this
.
element
.
querySelectorAll
(
'
input[type=checkbox][name="item_path_list:list"]:checked
'
);
var
val
=
this
.
element
.
querySelectorAll
(
'
input[type=checkbox][name="item_path_list:list"]:checked
'
);
var
val_tree
=
this
.
element
.
querySelectorAll
(
'
input[type=checkbox][name^="tree"]:checked
'
);
console
.
log
(
input_list
);
console
.
log
(
input_list
);
return
jIO
.
util
.
ajax
({
return
jIO
.
util
.
ajax
({
type
:
'
POST
'
,
type
:
'
POST
'
,
...
...
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