Commits

Andy Mikhailenko committed c930db1

Added Crumb.is_active flag along with already existing Crumb.is_current.

Comments (0)

Files changed (3)

navigation/__init__.py

 __author__  = 'Andy Mikhailenko'
 __license__ = 'GNU Lesser General Public License (GPL), Version 3'
 __url__     = 'http://bitbucket.org/neithere/django-navigation/'
-__version__ = '0.6.2'
+__version__ = '0.6.3'

navigation/helpers.py

         `True` if this breadcrumb's URL corresponds to the current request
         path.
 
+    .. attribute:: is_active
+
+        `True` if current request path begins with this breadcrumb's URL.
+
     .. attribute:: is_dummy
 
         `True` if this breadcrumb is a stub, i.e. its URL could not be resolved
         self.url        = url
         self.title      = title
         self.is_current = is_current
+        self.is_active  = is_active
         self.is_dummy   = is_dummy
 
     def __unicode__(self):

navigation/resolvers.py

         crumb = resolver(request, url)
         if crumb is not None:
             crumb.is_current = bool(url == request.path)
+            crumb.is_active = bool(url.startswith(request.path))
             return crumb
 
     # TODO return None instead of a fake breadcrumb object