Ejemplo n.º 1
0
def keyword_widget(node, kw):
    tree = {}
    for name, content_type in core.SEARCHABLE_CONTENTS.items():
        tree.update({name: get_attr_tree(content_type=content_type)})

    tree = json.dumps(tree)
    return KeywordsTreeWidget(source_tree=tree, )
Ejemplo n.º 2
0
def keyword_widget(node, kw):
    request = node.bindings['request']
    levels = request.get_site_folder.get_tree_nodes_by_level()
    level = len(levels)
    return KeywordsTreeWidget(min_len=1,
                              max_len=level,
                              can_create=level + 1,
                              levels=levels)
Ejemplo n.º 3
0
def keyword_widget(node, kw):
    request = node.bindings['request']
    root = request.root
    levels = root.get_tree_nodes_by_level()
    return KeywordsTreeWidget(can_rename=False,
                              min_len=2,
                              max_len=DEFAULT_TREE_LEN,
                              can_create=1000,
                              levels=levels)
Ejemplo n.º 4
0
def keyword_widget(node, kw):
    root = getSite()
    can_create = 0
    levels = root.get_tree_nodes_by_level()
    return KeywordsTreeWidget(
        min_len=1,
        max_len=DEFAULT_TREE_LEN,
        can_create=can_create,
        levels=levels)
Ejemplo n.º 5
0
def keyword_widget(node, kw):
    request = node.bindings['request']
    root = request.root
    can_create = 0
    levels = root.get_tree_nodes_by_level()
    return KeywordsTreeWidget(min_len=1,
                              max_len=DEFAULT_TREE_LEN,
                              can_create=can_create,
                              levels=levels)
Ejemplo n.º 6
0
def keyword_widget(node, kw):
    can_create = 0
    root = getSite()
    values = root.get_tree_nodes_by_level()
    if values:
        values = values[1:]

    return KeywordsTreeWidget(min_len=1,
                              max_len=DEFAULT_TREE_LEN,
                              can_create=can_create,
                              levels=values)
Ejemplo n.º 7
0
def keyword_widget(node, kw):
    request = node.bindings['request']
    site = request.get_site_folder
    can_create = 0
    if has_role(role=('Member', )):
        can_create = 1
    if has_any_roles(roles=('Admin', ('SiteAdmin', site))):
        can_create = 0

    levels = site.get_tree_nodes_by_level()
    return KeywordsTreeWidget(
        min_len=2,
        max_len=DEFAULT_TREE_LEN,
        can_create=can_create,
        levels=levels)