{% load mptt_tags %}

<ol class="dc-breadcrumb breadcrumb">
    <li>
        {% block dc-breadcrumb-home %}
            <a href="{% url 'document_catalogue:catalogue_list' %}">Catalogue Home</a>
        {% endblock %}
    </li>

    {% for cat in category.get_ancestors %}
        <li>
            <a class="dc-category" href="{{ cat.get_absolute_url }}">{{ cat.name }}</a>
        </li>
    {% endfor %}

    {% if current_category_link %}
        <li>
            <a class="dc-category" href="{{ category.get_absolute_url }}">{{ category.name }}</a>
        </li>
    {% elif category.is_leaf_node %}
        <li>
            {{ category }}
        </li>
    {% else %}
        <li class="active dc-descendants-menu">
            <div class="dropdown">
                <a class="dropdown-toggle" href="#" type="button" id="dc-descendants-menu-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
                    {{ category.name }}
                    <span class="caret"></span>
                </a>
                <span class="dropdown-menu" aria-labelledby="dc-descendants-menu">
                    {% include 'document_catalogue/include/categories.html' with categories=category.get_descendants %}
                </span>
            </div>
        </li>
    {% endif %}
</ol>