Display a nice icon on jstree if item is free

This commit is contained in:
2016-11-29 15:35:12 +01:00
parent 9783711818
commit 7fb94a86e8
2 changed files with 23 additions and 0 deletions

View File

@@ -18,6 +18,7 @@ def jstree_parse_node(node, children=None):
# Define better the node type
if node_type == 'asset':
node_type = node.properties.content_type
parsed_node = dict(
id="n_{0}".format(node._id),
a_attr={"href": url_for_node(node=node)},
@@ -25,10 +26,14 @@ def jstree_parse_node(node, children=None):
text=Markup.escape(node.name),
type=node_type,
children=False)
# Append children property only if it is a directory type
if node_type in GROUP_NODES:
parsed_node['children'] = True
if node.permissions and node.permissions.world:
parsed_node['li_attr']['is_free'] = True
return parsed_node