{% macro tree(replies, visitor, level, margin, hidden) %} {% for msg in replies %} {% if msg.replyto == level %}
{% if (level == 0 and msg.childsCount > 1 and replies.size() > 10) %} {{ tree(msg.childs, visitor, msg.rid, margin + 20, true) }} {% elseif (msg.childsCount > 0) %} {{ tree(msg.childs, visitor, msg.rid, margin + 20, hidden) }} {% endif %} {% endif %} {% endfor %} {% endmacro %}