Display a nice icon on jstree if item is free
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user