{% extends "cranefly/layout.html" %} {% import "cranefly/macros.html" as macros with context %} {% block title %}{{ macros.page_title(title=_("Forum Map")) }}{% endblock %} {% block container %}
{% if forums %}
{% for category in forums %}{% if loop.index0 is odd and category.subforums %} {{ draw_category(category) }} {% endif %}{% endfor %}
{% for category in forums %}{% if loop.index0 is even and category.subforums %} {{ draw_category(category) }} {% endif %}{% endfor %}
{% else %}

{% trans %}Looks like no forums exist that you have permission to see.{% endtrans %}

{% endif %}
{% endblock %} {% macro draw_category(category) %}

{{ category.name }}

{% for forum in category.subforums%} {{ draw_forum(forum) }} {% endfor %}
{% endmacro %} {% macro draw_forum(forum, depth=0, branch='', last=false) %}

{% if depth %}{% if last -%} {{ draw_tree(branch ~ 'l') }} {%- else -%} {{ draw_tree(branch ~ 't') }} {%- endif %}{% endif %} {{ forum.name }}

{% for subforum in forum.subforums %} {% if depth %} {% if last %} {{ draw_forum(subforum, (depth + 1), (branch ~ 's'), loop.last) }} {% else %} {{ draw_forum(subforum, (depth + 1), (branch ~ 'i'), loop.last) }} {% endif %} {% else %} {{ draw_forum(subforum, (depth + 1), '', loop.last) }} {% endif %} {% endfor %} {% endmacro %} {% macro draw_tree(branch) %} {% for item in branch %} {% endfor %} {% endmacro %}