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