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_navigation(node):
11 roots = Navigation.objects.for_node(node)
14 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)
22 def is_active(navigation, request):
24 Returns true if the navigation is considered `active`.
26 But what does "active" mean? Should this be defined on the model instead, perhaps?
29 if navigation.target_node == request.node:
30 if request.path == navigation.target_url:
33 if navigation.target_url in request.path: