show nested children (grandchildren) in book_topic_view if option 'show_nested_children' is set
This commit is contained in:
parent
3c153ce058
commit
c7cb323d20
3 changed files with 21 additions and 2 deletions
|
@ -609,7 +609,6 @@ class BaseView(GenericView, I18NView):
|
||||||
for opt in (self.options, self.typeOptions, self.globalOptions):
|
for opt in (self.options, self.typeOptions, self.globalOptions):
|
||||||
if isinstance(opt, DummyOptions):
|
if isinstance(opt, DummyOptions):
|
||||||
continue
|
continue
|
||||||
#import pdb; pdb.set_trace()
|
|
||||||
v = opt
|
v = opt
|
||||||
for key in keys.split('.'):
|
for key in keys.split('.'):
|
||||||
if isinstance(v, list):
|
if isinstance(v, list):
|
||||||
|
|
|
@ -302,6 +302,10 @@ fieldset.box td {
|
||||||
margin-top: -1px;
|
margin-top: -1px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.nested {
|
||||||
|
margin-left: 2em;
|
||||||
|
}
|
||||||
|
|
||||||
.content-1 h1, h1 {
|
.content-1 h1, h1 {
|
||||||
padding-top: 0.5em;
|
padding-top: 0.5em;
|
||||||
font-size: 180%;
|
font-size: 180%;
|
||||||
|
|
|
@ -10,10 +10,26 @@
|
||||||
tal:content="related/title" />
|
tal:content="related/title" />
|
||||||
</h3>
|
</h3>
|
||||||
<div tal:content="structure related/renderedDescription" />
|
<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>
|
</div>
|
||||||
</metal:children>
|
</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:book define-macro="book">
|
||||||
<metal:info use-macro="view/concept_macros/concepttitle" />
|
<metal:info use-macro="view/concept_macros/concepttitle" />
|
||||||
<metal:info use-macro="item/book_macros/children" />
|
<metal:info use-macro="item/book_macros/children" />
|
||||||
|
|
Loading…
Add table
Reference in a new issue