allow suppression of empty topics in book views

This commit is contained in:
Helmut Merz 2013-10-05 09:59:24 +02:00
parent b24619fcd7
commit 26906601f2

View file

@ -1,32 +1,39 @@
<html i18n:domain="loops"> <html i18n:domain="loops">
<metal:children define-macro="children"> <metal:children define-macro="children"
<div tal:repeat="related item/children" tal:define="children children|python:list(item.children())">
tal:define="level python:level + 1" <tal:child repeat="related children">
tal:attributes="class string:content-$level"> <div tal:define="children python:list(related.children());
<h3> resources python:list(related.resources());
<a tal:attributes="href python:view.getUrlForTarget(related)" hideEmpty python:item.getOptions('hide_empty_children');
tal:content="related/title" /> level python:level + 1"
</h3> tal:condition="python:not hideEmpty or children or resources"
<div tal:content="structure related/renderedDescription" /> tal:attributes="class string:content-$level">
<tal:nested condition="python:related.getOptions('show_nested_children')"> <h3><a tal:attributes="href python:view.getUrlForTarget(related)"
<metal:children use-macro="item/book_macros/nested_children" /> tal:content="related/title" />
</tal:nested> </h3>
</div> <div tal:content="structure related/renderedDescription" />
<tal:nested condition="python:related.getOptions('show_nested_children')">
<metal:children use-macro="item/book_macros/nested_children" />
</tal:nested>
</div>
</tal:child>
</metal:children> </metal:children>
<metal:nested define-macro="nested_children"> <metal:nested define-macro="nested_children"
<div tal:repeat="related related/children" tal:define="children children|python:list(item.children())">
tal:define="level python:level + 1" <tal:child repeat="related children">
tal:attributes="class string:nested content-$level"> <div tal:define="level python:level + 1"
<h3> tal:attributes="class string:nested content-$level">
<a tal:attributes="href python:view.getUrlForTarget(related)" <h3>
tal:content="related/title" /> <a tal:attributes="href python:view.getUrlForTarget(related)"
</h3> tal:content="related/title" />
<div tal:content="structure related/renderedDescription" /> </h3>
</div> <div tal:content="structure related/renderedDescription" />
</div>
</tal:child>
</metal:nested> </metal:nested>
@ -120,15 +127,17 @@
</metal:section> </metal:section>
<metal:topic define-macro="topic"> <metal:topic define-macro="topic"
tal:define="children children|python:list(item.children());
textResources textResources|item/textResources">
<metal:info use-macro="view/concept_macros/concepttitle" /> <metal:info use-macro="view/concept_macros/concepttitle" />
<h2 i18n:translate="" <h2 i18n:translate=""
tal:condition="python: list(item.children())">Children</h2> tal:condition="children">Children</h2>
<metal:children use-macro="item/book_macros/children" /> <metal:children use-macro="item/book_macros/children" />
<h2 i18n:translate="" <h2 i18n:translate=""
tal:condition="item/textResources">Text Elements</h2> tal:condition="textResources">Text Elements</h2>
<div> <div>
<div tal:repeat="related item/textResources" <div tal:repeat="related textResources"
tal:define="level python:level + 1" tal:define="level python:level + 1"
tal:attributes="class string:content-$level"> tal:attributes="class string:content-$level">
<h3> <h3>