diff --git a/integrator/browser/bscw.py b/integrator/browser/bscw.py index 4cd68bc..3c3c38c 100644 --- a/integrator/browser/bscw.py +++ b/integrator/browser/bscw.py @@ -77,10 +77,12 @@ class ItemView(BaseView): @property def breadCrumbs(self): - for p in reversed(list(self.context.parents)): + parents = list(self.context.parents) + for p in reversed(parents[:-1]): view = ItemView(p, self.request, self.parentView) yield dict(url=view.url, title=view.title) - yield dict(url=self.url, title=self.title) + #if parents: + # yield dict(url=self.url, title=self.title) class BSCWView(BaseView): diff --git a/integrator/bscw.py b/integrator/bscw.py index 3a8fd82..e087df9 100644 --- a/integrator/bscw.py +++ b/integrator/bscw.py @@ -191,7 +191,7 @@ class ReadContainer(BSCWProxyBase, ReadContainer): def values(self): return sorted((self.get(k) for k in self), - key=lambda x: x.title.lower()) + key=lambda x: (x.itemType != 'Folder', x.title.lower())) def __len__(self): diff --git a/integrator/bscw.txt b/integrator/bscw.txt index 36c4de7..56db52d 100644 --- a/integrator/bscw.txt +++ b/integrator/bscw.txt @@ -118,8 +118,12 @@ The BSCW Repository View 'http://127.0.0.1/++resource++folder.png' >>> list(items[0].breadCrumbs) - [{'url': 'http://127.0.0.1/bscw?id=bs_4', 'title': 'public'}, - {'url': 'http://127.0.0.1/bscw?id=bs_5', 'title': 'Introduction'}] + [] + +The top and the current level are not shown, otherwise we would get: + +[{'url': 'http://127.0.0.1/bscw?id=bs_4', 'title': 'public'}, + {'url': 'http://127.0.0.1/bscw?id=bs_5', 'title': 'Introduction'}] Fin de partie