2018-09-20 12:58:10 +01:00
|
|
|
{% macro renderDescendantList(descendants, descendantType, recursed, docTypeMatcher) %}
|
2018-02-08 15:00:53 +00:00
|
|
|
{% if descendants.length %}
|
|
|
|
<ul>
|
2017-09-25 19:59:44 +01:00
|
|
|
{% for descendant in descendants %}
|
|
|
|
<li>
|
2018-02-08 15:00:53 +00:00
|
|
|
<code>{$ descendant.name $}</code>
|
2018-09-20 12:58:10 +01:00
|
|
|
{$ renderDescendantList(descendant.descendants | filterByPropertyValue('docType', docTypeMatcher), docType, recursed, docTypeMatcher) $}
|
2017-09-25 19:59:44 +01:00
|
|
|
</li>
|
|
|
|
{% endfor %}
|
2018-02-08 15:00:53 +00:00
|
|
|
</ul>
|
|
|
|
{% endif %}
|
|
|
|
{% endmacro -%}
|
|
|
|
|
2018-09-20 12:58:10 +01:00
|
|
|
{%- macro renderDescendants(doc, descendantType, title='', recursed=true, docTypeMatcher=descendantType) %}
|
|
|
|
{% set descendants = doc.descendants | filterByPropertyValue('docType', docTypeMatcher) %}
|
2018-02-08 15:00:53 +00:00
|
|
|
{% if descendants.length %}
|
2018-09-20 12:58:10 +01:00
|
|
|
<div class="descendants {$ descendantType $}">
|
2018-02-08 15:00:53 +00:00
|
|
|
{% if title %}<h2>{$ title $}</h2>{% endif %}
|
2018-09-20 12:58:10 +01:00
|
|
|
{$ renderDescendantList(descendants, descendantType, recursed, docTypeMatcher) $}
|
2018-02-08 15:00:53 +00:00
|
|
|
</div>
|
2017-09-25 19:59:44 +01:00
|
|
|
{% endif %}
|
|
|
|
{% endmacro %}
|