diff --git a/pillar/web/utils/jstree.py b/pillar/web/utils/jstree.py index b1f4ef70..0f8e0cac 100644 --- a/pillar/web/utils/jstree.py +++ b/pillar/web/utils/jstree.py @@ -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 diff --git a/src/styles/plugins/_jstree.sass b/src/styles/plugins/_jstree.sass index f13e9242..bdbfa059 100644 --- a/src/styles/plugins/_jstree.sass +++ b/src/styles/plugins/_jstree.sass @@ -20,6 +20,24 @@ $tree-color-highlight-background-text: white +media-xs width: 100% + &[is_free='true'] + .jstree-anchor + padding-right: 20px + &:before + font-family: 'pillar-font' + content: '\e84e' + color: $color-success + font-size: .8em + padding: 0 5px + position: absolute + right: 5px + + &.jstree-clicked + padding-right: 30px + &:before + color: $tree-color-highlight-background-text !important + right: 15px + &[data-node-type="page"], &[data-node-type="blog"] font-size: 1.15em