show nested children (grandchildren) in book_topic_view if option 'show_nested_children' is set

This commit is contained in:
Helmut Merz 2013-09-08 17:14:53 +02:00
parent 3c153ce058
commit c7cb323d20
3 changed files with 21 additions and 2 deletions

View file

@ -609,7 +609,6 @@ class BaseView(GenericView, I18NView):
for opt in (self.options, self.typeOptions, self.globalOptions):
if isinstance(opt, DummyOptions):
continue
#import pdb; pdb.set_trace()
v = opt
for key in keys.split('.'):
if isinstance(v, list):

View file

@ -302,6 +302,10 @@ fieldset.box td {
margin-top: -1px;
}
.nested {
margin-left: 2em;
}
.content-1 h1, h1 {
padding-top: 0.5em;
font-size: 180%;

View file

@ -10,10 +10,26 @@
tal:content="related/title" />
</h3>
<div tal:content="structure related/renderedDescription" />
<!-- TODO: show next level (+/-) -->
<tal:nested condition="python:related.getOptions('show_nested_children')">
<metal:children use-macro="item/book_macros/nested_children" />
</tal:nested>
</div>
</metal:children>
<metal:nested define-macro="nested_children">
<div tal:repeat="related related/children"
tal:define="level python:level + 1"
tal:attributes="class string:nested content-$level">
<h3>
<a tal:attributes="href python:view.getUrlForTarget(related)"
tal:content="related/title" />
</h3>
<div tal:content="structure related/renderedDescription" />
</div>
</metal:nested>
<metal:book define-macro="book">
<metal:info use-macro="view/concept_macros/concepttitle" />
<metal:info use-macro="item/book_macros/children" />