Commit 82d9a7c6 authored by David Read's avatar David Read
Browse files

[1751] Comment reporting - Jinja prefers recursive loops to recursive macros.

parent 1385878b
......@@ -46,25 +46,19 @@
<div class="dropdown-menu panel panel-default" role="menu" aria-labelledby="dLabel">
<div class="panel-heading">Publisher Hierarchy</div>
<div class="panel-body publisher-dropdown">
{% macro render_child(pub) %}
<div class="publisher">
<div class="publisher-row {% if pub['name']==c.group.name %}active{% endif %}">
<a href="/publisher/{{ pub['name'] }}">{{ pub['title'] }}</a>
</div>
{% for child in pub['children'] %}
{{ render_child(child) }}
{% endfor %}
</div>
{% endmacro %}
<div class="publisher-hierarchy empty-search">
<div class="publisher">
{% set pub=h.publisher_hierarchy_mini(c.group.name) %}
<div class="publisher-row {% if pub['name']==c.group.name %}active{% endif %}">
<a href="/publisher/{{ pub['name'] }}">{{ pub['title'] }}</a>
</div>
{% for child in pub['children'] %}
{{ render_child(child) }}
{% for child in pub['children'] recursive %}
<div class="publisher">
<div class="publisher-row {% if child['name']==c.group.name %}active{% endif %}">
<a href="/publisher/{{ child['name'] }}">{{ child['title'] }}</a>
</div>
{{ loop(child['children']) }}
</div>
{% endfor %}
</div>
</div>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment