git.ithinksw.org
/
philo.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added an abstract TargetURLModel to handle issues related to targeting a node, a...
[philo.git]
/
contrib
/
shipherd
/
templatetags
/
shipherd.py
diff --git
a/contrib/shipherd/templatetags/shipherd.py
b/contrib/shipherd/templatetags/shipherd.py
index
97475fd
..
98e3e6b
100644
(file)
--- a/
contrib/shipherd/templatetags/shipherd.py
+++ b/
contrib/shipherd/templatetags/shipherd.py
@@
-83,7
+83,13
@@
def recursenavigation(parser, token):
@register.filter
@register.filter
-def has_navigation(node): # optional arg for a key?
+def has_navigation(node, key=None):
+ nav = node.navigation
+ if key is not None:
+ if key in nav and bool(node.navigation[key]):
+ return True
+ elif key not in node.navigation:
+ return False
return bool(node.navigation)
return bool(node.navigation)