Exemplo n.º 1
0
 def _create_breadcrumbs(self):
     crumbs = [Breadcrumb(self.context, self.request)]
     current = self.context.parent
     while not IRootResource.providedBy(current):
         crumbs.append(Breadcrumb(current, self.request))
         current = current.parent
     # And add in the default page if the context isn't the default.
     if not IDefaultPage.providedBy(self.context):
         crumbs.append(Breadcrumb(current.default_resource, self.request))
     return reversed(crumbs)
Exemplo n.º 2
0
 def _create_breadcrumbs(self):
     crumbs = []
     current = self.context
     view = None
     while not IRootResource.providedBy(current):
         crumbs.append(Breadcrumb(
                 current, self.request, view, title=current.base_name))
         current = current.parent
         # Add listings to subsequent urls.
         view = 'listing'
     # Add in the root dir.
     crumbs.append(Breadcrumb(current, self.request, 'listing',
                              title='wiki root'))
     # And add in the default page.
     crumbs.append(Breadcrumb(current.default_resource, self.request))
     return reversed(crumbs)
Exemplo n.º 3
0
 def parent(self):
     if IRootResource.providedBy(self):
         return None
     return self.factory.get_resource_at_path(self.dir_name)