1 from django import template
2 from django.conf import settings
3 from philo.contrib.navigation.models import Navigation
6 register = template.Library()
10 def get_descendants(roots):
13 root_qs = root.get_descendants(include_self=True).complex_filter({'%s__lte' % root._mptt_meta.level_attr: root.get_level() + root.depth}).exclude(depth__isnull=True)
21 def is_active(navigation, request):
23 Returns true if the navigation is considered `active`.
25 But what does "active" mean? Should this be defined on the model instead, perhaps?
28 if navigation.target_node == request.node:
29 if request.path == navigation.target_url:
32 if navigation.target_url in request.path: