{% extends "td_cms/layouts/sidebar_block.html" %}

{% load i18n %}
{% load mptt_tags %}
{% load td_cms_tags %}

{% block sidebar_block_class %}{{ category.slug }}{% endblock sidebar_block_class %}

{% block sidebar_block %}
<!-- Page category list (sidebar) -->
<div class="category-list">

    {% get_parent_categories as categories %}
    <ul class="nav-menu">
        {% recursetree categories %}
        {% if node.is_leaf_node %}
        <li><a href="{{ node.get_absolute_url }}" {% if node == category %}class="active"{% endif %}>{{ node.name }}</a></li>
        {% else %}
        <li>
            <a href="{{ node.get_absolute_url }}" class="has-children {% if node == category %}active{% endif %}">{{ node.name }}</a>
            <ul>
                {{ children }}
            </ul>
        </li>
        {% endif %}
        {% endrecursetree %}
    </ul>

</div>
<!-- /Page category list (sidebar) -->
{% endblock sidebar_block %}
