Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Solves show_sub_menu by checking visible property in menus.templateta…

…gs.cut_after()
  • Loading branch information...
commit c12012a1333efb6cb1144c3a047c72c3c4ca7d3a 1 parent 91e1bd3
@yakky yakky authored
Showing with 8 additions and 1 deletion.
  1. +8 −1 menus/templatetags/menu_tags.py
View
9 menus/templatetags/menu_tags.py
@@ -22,8 +22,15 @@ def cut_after(node, levels, removed):
removed.extend(node.children)
node.children = []
else:
+ removed_local = []
for n in node.children:
- cut_after(n, levels - 1, removed)
+ if n.visible:
+ cut_after(n, levels - 1, removed)
+ else:
+ removed_local.append(n)
+ for n in removed_local:
+ node.children.remove(n)
+ removed.extend(removed_local)
def remove(node, removed):
removed.append(node)
Please sign in to comment.
Something went wrong with that request. Please try again.