breadcrumbs for sections and pages
This commit is contained in:
parent
c8470483a8
commit
9ff3c9214e
3 changed files with 30 additions and 3 deletions
|
@ -27,7 +27,9 @@ from zope.cachedescriptors.property import Lazy
|
|||
|
||||
from cybertools.typology.interfaces import IType
|
||||
from loops.browser.lobo import standard
|
||||
from loops.browser.concept import ConceptRelationView as BaseConceptRelationView
|
||||
from loops.browser.concept import ConceptView
|
||||
from loops.browser.concept import ConceptRelationView as \
|
||||
BaseConceptRelationView
|
||||
from loops.browser.resource import ResourceView as BaseResourceView
|
||||
from loops.common import adapted, baseObject
|
||||
|
||||
|
@ -36,7 +38,24 @@ standard_template = standard.standard_template
|
|||
book_template = ViewPageTemplateFile('view_macros.pt')
|
||||
|
||||
|
||||
class PageLayout(standard.Layout):
|
||||
class Base(object):
|
||||
|
||||
@Lazy
|
||||
def isPartOfPredicate(self):
|
||||
return self.conceptManager['ispartof']
|
||||
|
||||
@Lazy
|
||||
def breadcrumbsParent(self):
|
||||
for p in self.context.getParents([self.isPartOfPredicate]):
|
||||
return self.nodeView.getViewForTarget(p)
|
||||
|
||||
|
||||
class SectionView(Base, ConceptView):
|
||||
|
||||
pass
|
||||
|
||||
|
||||
class PageLayout(Base, standard.Layout):
|
||||
|
||||
def getParts(self):
|
||||
parts = ['headline', 'keyquestions', 'quote', 'maintext',
|
||||
|
|
|
@ -17,6 +17,14 @@
|
|||
|
||||
<!-- Views -->
|
||||
|
||||
<zope:adapter
|
||||
name="section_view"
|
||||
for="loops.interfaces.IConcept
|
||||
loops.browser.skin.Lobo"
|
||||
provides="zope.interface.Interface"
|
||||
factory="loops.compound.book.browser.SectionView"
|
||||
permission="zope.View" />
|
||||
|
||||
<zope:adapter
|
||||
name="page_layout"
|
||||
for="loops.interfaces.IConcept
|
||||
|
|
|
@ -7,7 +7,7 @@ type(u'book', u'Buch', viewName=u'', typeInterface=u'',
|
|||
type(u'page', u'Seite', viewName=u'page_layout',
|
||||
typeInterface=u'loops.compound.book.interfaces.IPage',
|
||||
options=u'action.portlet:edit_concept')
|
||||
type(u'section', u'Kapitel', viewName=u'', typeInterface=u'',
|
||||
type(u'section', u'Kapitel', viewName=u'section_view', typeInterface=u'',
|
||||
options=u'action.portlet:create_subtype,edit_concept')
|
||||
|
||||
concept(u'system', u'System', u'domain')
|
||||
|
|
Loading…
Add table
Reference in a new issue