provide book overview that lists all sections with descriptions
This commit is contained in:
parent
9b4098c9da
commit
460fad9212
4 changed files with 27 additions and 1 deletions
|
@ -51,6 +51,13 @@ class Base(object):
|
||||||
return self.nodeView.getViewForTarget(p)
|
return self.nodeView.getViewForTarget(p)
|
||||||
|
|
||||||
|
|
||||||
|
class BookOverview(Base, ConceptView):
|
||||||
|
|
||||||
|
@Lazy
|
||||||
|
def macro(self):
|
||||||
|
return book_template.macros['book']
|
||||||
|
|
||||||
|
|
||||||
class SectionView(Base, ConceptView):
|
class SectionView(Base, ConceptView):
|
||||||
|
|
||||||
@Lazy
|
@Lazy
|
||||||
|
|
|
@ -17,6 +17,14 @@
|
||||||
|
|
||||||
<!-- Views -->
|
<!-- Views -->
|
||||||
|
|
||||||
|
<zope:adapter
|
||||||
|
name="book_overview"
|
||||||
|
for="loops.interfaces.IConcept
|
||||||
|
loops.browser.skin.Lobo"
|
||||||
|
provides="zope.interface.Interface"
|
||||||
|
factory="loops.compound.book.browser.BookOverview"
|
||||||
|
permission="zope.View" />
|
||||||
|
|
||||||
<zope:adapter
|
<zope:adapter
|
||||||
name="section_view"
|
name="section_view"
|
||||||
for="loops.interfaces.IConcept
|
for="loops.interfaces.IConcept
|
||||||
|
|
|
@ -2,7 +2,7 @@ type(u'documenttype', u'Dokumentenart', options=u'qualifier:assign',
|
||||||
viewName=u'')
|
viewName=u'')
|
||||||
|
|
||||||
# book types
|
# book types
|
||||||
type(u'book', u'Buch', viewName=u'', typeInterface=u'',
|
type(u'book', u'Buch', viewName=u'book_overview', typeInterface=u'',
|
||||||
options=u'action.portlet:create_subtype,edit_concept')
|
options=u'action.portlet:create_subtype,edit_concept')
|
||||||
#type(u'page', u'Seite', viewName=u'page_layout',
|
#type(u'page', u'Seite', viewName=u'page_layout',
|
||||||
# typeInterface=u'loops.compound.book.interfaces.IPage',
|
# typeInterface=u'loops.compound.book.interfaces.IPage',
|
||||||
|
|
|
@ -1,6 +1,17 @@
|
||||||
<html i18n:domain="loops">
|
<html i18n:domain="loops">
|
||||||
|
|
||||||
|
|
||||||
|
<metal:book define-macro="book">
|
||||||
|
<metal:info use-macro="view/concept_macros/concepttitle" />
|
||||||
|
<div tal:repeat="related item/children">
|
||||||
|
<h3>
|
||||||
|
<a tal:attributes="href python:view.getUrlForTarget(related)"
|
||||||
|
tal:content="related/title" /></h3>
|
||||||
|
<div tal:content="structure related/renderedDescription" />
|
||||||
|
</div>
|
||||||
|
</metal:book>
|
||||||
|
|
||||||
|
|
||||||
<metal:section define-macro="section">
|
<metal:section define-macro="section">
|
||||||
<metal:info use-macro="view/concept_macros/concepttitle" />
|
<metal:info use-macro="view/concept_macros/concepttitle" />
|
||||||
<div tal:repeat="related item/resources">
|
<div tal:repeat="related item/resources">
|
||||||
|
|
Loading…
Add table
Reference in a new issue